eli5 what makes a ARM Cpu different from a x64 cpu ? why can’t apps from x64 run on ARM or vice versa

316 views

eli5 what makes a ARM Cpu different from a x64 cpu ? why can’t apps from x64 run on ARM or vice versa

In: 1

8 Answers

Anonymous 0 Comments

They use a different instruction set, but what that means requires a little more explanation.

CPUs are made of a lot of very simple circuits – they’re made of two specific circuits, called AND gates and NOT gates. Everything a computer does can be done by chaining these two circuits together, but some things also require a fast pulse of electricity, which comes from the “clock” – just pulses of electricity at regular intervals.

You can combine this into more complex circuits to do different things. You can make an adder, for example, that adds two numbers of a given length (4 bits or 8 bits or 16bits, etc). If I make a 4 bit adder, I can add larger numbers, by first reducing them to 4 bit constituents, and then adding those and recombining them. Or, I can make an 8 bit adder. If my CPU is likely to encounter a lot of numbers larger than 4 bits, the second option is probably more efficient.

Now let’s talk multiplication. A computer can multiply numbers even if all it can do is compare numbers, add numbers, and count. I can multiply 5 * 3 by initializing some result (0), then if the second number is greater than 0, I add the first number to the result (0+5=5) and subtract one from the second number (3-1=2), then go back to the step where I checked if it was greater than zero, and repeat until it is no longer greater than zero. Step 2: (0+5+5=10) (3-1-1=1). Step 3: (0+5+5+5=15) (3-1-1-1=0 : stop) result is 15.
I could put a circuit on the cpu that multiplies numbers, or I could make you do that by using the add, count, and compare operations. If I expect you to be multiplying a lot, the former is more efficient, otherwise the second might be better. If I make you multiply the long way, then telling my CPU to perform a multiplication won’t do any good.

A CPU can run any software with only a handful of instructions. Again, at it’s root, a CPU is actually just two operations: AND and NOT. But I can make it better by “hardwiring” more complex tasks that are likely to come up a lot, instead of making you get the same results by combining other instructions. x86 and ARM make different decisions about what instructions are hardwired into the CPU, versus making you get the same results by combining other instructions.

You are viewing 1 out of 8 answers, click here to view all answers.