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

310 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

It’s a different architecture so the instructions don’t match. x64 bit instructions won’t run (natively) on 64bit ARM chips. It is possible to translate and emulate however by emulating instruction sets the chip won’t perform as well as a chip that understand the instruction set natively. My explanation is simplified, but it gives a picture of how it works. It’s like having someone who only speaks Spanish having a conversation with someone who only speaks English. ARM use RISC and x64 use CISC.

Anonymous 0 Comments

Every CPU has a set of instructions that it understands. Stuff like add, multiply, compare, etc.

ARM and x86 are basically two lists of those instructions. So if a program is made for x86 and you try to run it on ARM, the CPU will receive an instruction it either doesn’t know or interprets as a different one than it’s supposed to, so the program will very quickly fail.

You can search Wikipedia for “x86 instruction listings” if you would like to see the actual instructions and what they do.

Anonymous 0 Comments

Imagine you and I want to have a chat where you give me a recipe.

We can only converse in numbers, however.

So we decide to come up with a code that maybe “instruction 1” is “pour”, 2 is “whisk”, 3 is “cover with foil”, and so on. And we also have codes for locations, so maybe 1 is “the bowl”, 2 is “the oven”, and so on.

That works fine while we both use the same codes for instructions. And while we have the same set of instructions at all (e.g. maybe you have a code “parboil” but I don’t know what that means). But what if your code for 1 is “pour” and my code for 1 is “flame-grill”? It’s all going to go wrong.

Intel and ARM and MIPS and Z80 and all kinds of chips have historically used different codes, for different reasons and in different ways. Some chips are designed to kind the number of codes to an absolute minimum (Reduced Instruction Set Computers – RISC) and others have far more codes for all kinds of things that are rarely used. Some chips have thousands of storage locations (registers – a bit like the bowl / oven examples above) they can use in calculations, others keep it to just a few and move things around a lot more, reusing the same bowls over and over for performance reasons.

As time has gone by, Intel has kept the same codes that they were using 40 years ago, and ARM have done similarly, and they’ve both expanded with new codes when processors gained new abilities – but those codes are inherently different and the designs very different too.

So an ARM program is talking entirely different codes to an Intel program and they can’t understand each other. The job of formulating that code for any particular program is the job of a compiler, and you can “compile to ARM” or “compile to Intel” or whatever else, but the final result is a program that only runs on one type of machine.

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.

Anonymous 0 Comments

the most ELI5 explanation is that they can do the same things but speak different languages

Anonymous 0 Comments

The same reason that metric bolts and non-metric bolts aren’t interchangeable. In both cases, some smart folks agreed on some specific choices for bolt diameter and thread pitch. Not having standards means every nut and bolt would have to be sold as a pair and chaos (to extend your analogy, every program would have to run on it’s own brand of CPU).

Today, we have only a few of these Instruction Set Architectures, X64, ARM, Apple’s M, and some others.

Anonymous 0 Comments

A program is like a manager and the CPU is a worker. An ARM CPU can only understand French and a x64 CPU can only understand English. The manager can only speak one of those languages.

You can run ARM programs on an x86 CPU and vice versa, but you need an interpreter/translator between the CPU and the program in order for them to understand each other. That’s where you’ll hear the term “emulator”. The same type of program you would use to play older console games (like N64, SNES, etc) or Android games on your laptop.

There are plenty of other under-the-hood differences. For example, x86 tends to be like a diesel engine in a semi truck whereas ARM is like your v4 in a typical sedan. In other words, x86 tends to be very good at raw computing power while the ARM CPU is energy efficient for scenarios that don’t need that power. The lines get more and more blurred everyday but isn’t quite there yet. For example, ARM has been trying to break into the datacenter market (like the cloud servers) for well over a decade with limited success. And Intel has more or less given up on their ultra-low power consumption x86 chips.

Anonymous 0 Comments

A CPU is a collection of electronic circuits. The circuits are arranged in specific ways to perform useful math and logic operations. Those circuits are activated by sending electrical signals to specific inputs on the CPU pins. The mapping of specific electrical signals to operations like “add these two numbers” or “which of these two numbers is bigger” or “store this number in this memory address” is called the Instruction Set Architecture (ISA), of which x86-64 (“x64”) and ARM are two examples.

Much like programming languages, there are different ISAs. They’re so fundamental to computing that there aren’t many competing standards, but there are multiple; some born because of intellectual property licensing limitations with existing ones, some because someone thought they could do better, or they needed one tailored to be more efficient for a particular use case.

If one CPU expects pins 0-3 to be set to 0011 (voltage off, off, on, on) to add two 4-bit binary numbers which are sent on pins 4-7 and 8-11, but another CPU expects pins 32-39 to be set to 10011000 to perform the same addition of two 8-bit numbers input to pins 48-55 and 56-63, then clearly trying to execute instructions meant for one ISA, on a CPU designed for a different ISA, is not going to work out well.