x86 Architecture

The x86 architecture stems from the Von Neumann architecture. This architecture consists of:

  • CPU: the computer's brain which fetches, decodes, and executes instructions. It contains:

    • Arithmetic Logic Unit (ALU): performs the arithmetic (+-x/) and logical (AND, OR, NOT) operations.

    • Control Unit: directs the flow of operations by fetching instructions from the memory and telling other components what to do. The address of the next instruction is stored in a register called the Instruction Pointer (EIP in 32-bit systems, RIP in 64-bit systems).

    • Registers: Small, high-speed storage locations within the CPU used for temporary storage of data and instructions during processing. Examples are the Program Counter/EIP/RIP, Memory Address Register, Memory Data Register, and Accumulator.

  • Main Memory (RAM): storage of data and instructions in binary format.

  • Input/Output Devices: mouse, keyboards, monitor for us to interact with the computer.

  • System Bus: a shared communication channel that connects the CPU, RAM, and I/O devices.

Why is the Von Neumann architecture the dominant one today?

Here are the main reasons, namely:

  1. Flexibility: The primary reason is the stored-program concept. It creates a general-purpose machine that can run any type of program, from a web browser to a video game, without any physical changes. This flexibility is arguably the foundation of the modern software industry.

  2. Simplicity and Cost-Effectiveness: The design is relatively easier to implement in hardware compared to more complex architectures. Additionally, a single memory system is simpler and cheaper to build than multiple disparate ones.

  3. Vast Ecosystem: Decades of development have built a massive ecosystem of programming languages, operating systems, compilers, and software tools all optimized for this architecture. Migrating away from it at this point would require rebuilding the aforementioned ecosystem from scratch, incurring unfeasible costs.

Limitations

However, this architecture is not without its limitations. The most significant one is the memory wall, which is a bottleneck created by the single system bus for both data and instructions. This means that the CPU cannot fetch an instruction and read/write data at the same time, and the CPI has to wait for data to be transferred from the slower RAM. This gave rise to other architectures such as the Harvard architecture, dataflow architecture, and systolic arrays.

The x86 architecture used by Intel and AMD in PCs and servers is based on Von Neumann, but heavily augmented with Harvard principles (separate instruction/data caches), pipelining, out-of-order execution, and multi-core designs. However, the ARM architecture is dominant in phones and laptops, and gaining ground in laptops too. This displacement is primarily due to ARM's increased power efficiency, improved performance, flexible licensing models, and growth in mobile-centricity.

Okay cool, that's about as deep as I poked and prodded. GPUs and AI accelerators are cans of worms for another time.

Anyway, back to more familiar territory. Another drawback is that storing data and instructions in the same memory space opens the door to attacks such as buffer overflows. This is when malicious code is executed as an instruction.


Fun fact

Von Neumann may sound familiar as it refers to John Von Neumann. A great book about this distinguished gentleman is The Man from the Future: The Visionary Life of John Von Neumann by Ananyo Bhattacharya. Be prepared to wallow in inadequacy.

Last updated

Was this helpful?