What is the difference between a x84 CPU and an ARM CPU


What is the difference between a x84 CPU and an ARM CPU

In: 157


They have different instructions they can accept. An instruction might be “multiply this number by another number”, “store this data here”, and so on. An instruction set is all the instructions a CPU can accept. x86 is one instruction set, ARM is another. They have pros and cons and are the consequence of different cpu designs.

As an analogy, imagine that you’re making an errand list for your CPU. x86 has a “go get milk”, “go get eggs”, “pick the kids up” instructions. ARM instead has “leave the house”, “drive”, “turn the wheel”, “reach”, “grab”, “look” instructions. Each one is much shorter but you combine them into larger operations. These two philosophies are called CISC (complex instruction set computers, like x86) and RISC (reduced instruction set computers, like ARM).

They both have wildly different histories, and differ in thousands of ways, but pretty much they both decided to “talk” in different languages (instruction sets) many years ago, for different purposes (e.g. ease of use for programmers, or simplicity of the circuit hence reducing costs), and have evolved differently because of that and the demands of their customers.

ARM is basically a low-wattage CPU that tries to do lots of very simple things very quickly.

Intel is basically a high-wattage CPU that offers lots of very complex things that make programmers lives a bit easier.

Hence, ARM is often used in handheld consoles (Nintendo Switch, etc.), mobile phones and smaller, low-power, battery devices for specific jobs, and Intel is often used in more-powerful, higher-wattage, very mixed and general uses like desktops and servers.

However, because of the years of evolution that both have had, ARM is now giving Intel a run for its money and “producing” extremely powerful chips (ARM don’t actually make chips, they just licence their design to others how make them) that are creeping into the server and datacentre market, and Intel have always made smaller and lower-power mobile chips and are increasing getting more out of each watt.

But, pretty much, they are like a motorbike and a juggernaut. You wouldn’t want to take a motorbike when you need to do lots of heavy-lifting, and you wouldn’t want to have to take a juggernaut to pop down the shops when you’re trying to save on fuel.

The difference is much like how English and French use very similar alphabets but are read very differently.

At the core level, all current computers use binary, made up of 1s and 0s, to represent *everything*. This includes the commands you want to give it, such as “add these two numbers”. x86 and ARM are two different “languages” the processor can understand.

These “languages” use different paradigms for what types of instructions exist and how to encode them. Of note, x86 has been slowly expanded since the 8086 processor came out in 1978 but is still fundamentally compatible, which leaves a lot of cruft and odd edges to it. ARM was more carefully engineered and has put less effort into maintaining backwards compatibility, allowing more of the cruft to be removed in newer versions.

The end result is that the processors are better at different things, though both can perform any operation and both compete quite well as super computers.

CPU’s can be thought of as having 2 parts:
Registers, where they store the data that they manipulate in each instructions
an Instruction Pipeline, which takes and instruction, and uses the contents of one or more registers to perform and then store the results of that Instruction

x86 were build when memory was _really_ expensive. So it has a few of special purpose registers, and 2 (or kinda 4, but really really, 2) “GENERAL PURPOSE” registers. This means that most instructions are REALLY short, because implicit in the instruction is which registers it is operating on. You CAN have VERY long complicated instructions but many of the very high usage instructions can be 8 bits or fewer. So you can fit a lot of instructions in a little space.

This design has interesting consequences for performance, but in a world where memory is REALLY expensive, and instructions have to fit in memory, those consequences are not all bad.

ARM comes around when memory is relatively cheaper. It has 32 General purpose registers. [ALMOST] all instructions are 32 bits long. That is important, because if you have an instruction that takes 2 input registers, and 1 output register, 15 of those bits are going to be telling you “which registers are we using here?”. So the code to run an ARM is generally bigger. That said, it pipelines a hell of a lot easier, and parallelizes much more nicely, cause there are all these places you can put stuff you are about to use, or just used, and you don’t have to flush your registers to memory all the time, just to do the next instruction.