No history yet

Von Neumann Architecture

The Stored-Program Idea

What separates a computer from a simple calculator? A calculator is a fixed-logic machine. It can add, subtract, multiply, and divide, but it can't be reprogrammed to do anything else. Its instructions are hardwired. A modern computer, on the other hand, is a general-purpose machine. It can be a word processor, a game console, or a video editor because its instructions, or program, are stored in memory and can be changed.

This is the revolutionary concept of the stored-program computer. Instead of building a new machine for every new task, you just load a new program into its memory. The dominant design for achieving this is the Von Neumann architecture, which treats instructions and the data they operate on as the same kind of information, storing them together in a single, shared memory space.

In a widely circulated paper, mathematician John von Neumann outlines the architecture of a stored-program computer, including electronic storage of programming information and data -- which eliminates the need for more clumsy methods of programming such as plugboards, punched cards and paper.

Core Components

The Von Neumann architecture is elegantly simple, consisting of a few key parts that work together. At its heart is the Central Processing Unit (CPU), the brain of the operation. The CPU communicates with the Memory Unit, where both the program's instructions and the data are held. Input and Output units handle communication with the outside world, like a keyboard or a screen.

Lesson image

The CPU itself is divided into two main components. The Arithmetic Logic Unit (ALU) is the calculator of the system; it performs all mathematical operations (like addition and subtraction) and logical comparisons (like AND, OR, NOT). The Control Unit (CU) is the director. It doesn't perform calculations but instead fetches instructions from memory, decodes them, and coordinates the actions of all other components to execute those instructions.

These parts are all connected by a set of wires called a bus, which acts as a highway for information to travel between the CPU and memory.

The CPU's Registers

To manage its tasks, the CPU uses a small amount of extremely fast, on-chip memory called registers. Each register has a specific job in the process of fetching and executing instructions. Think of them as the CPU's short-term scratchpad. While there are many registers in a modern CPU, four are fundamental to its operation.

RegisterNamePurpose
PCProgram CounterHolds the memory address of the next instruction to be executed.
IRInstruction RegisterHolds the current instruction while it is being decoded and executed.
MARMemory Address RegisterHolds the memory address the CPU wants to read from or write to.
MDRMemory Data RegisterTemporarily holds data fetched from memory or data waiting to be stored.

Together, these registers orchestrate the continuous fetch-decode-execute cycle that forms the basis of all computation. The PC points to an instruction, the MAR and MDR are used to fetch it, it lands in the IR to be decoded by the CU, and then the ALU executes it. Once done, the PC is updated, and the cycle begins again, millions or billions of times per second.

The Bottleneck Problem

The elegance of the Von Neumann architecture—its shared memory and single bus—is also its primary weakness. Because instructions and data travel along the same path, the CPU cannot fetch an instruction and read data at the same time. One must wait for the other. This traffic jam is famously known as the Von Neumann bottleneck.

As CPUs became faster than memory, this bottleneck became more significant. The CPU could process information faster than the bus could supply it, leaving the processor idle and waiting.

An alternative approach is the , which uses separate memories and separate buses for instructions and data. This allows the CPU to fetch the next instruction while simultaneously accessing data for the current one, improving throughput. While most general-purpose computers today are still fundamentally Von Neumann machines, they incorporate elements of the Harvard design, especially in their use of separate CPU caches for instructions and data to ease the bottleneck.

Understanding this architecture is key to seeing how software instructions translate into physical operations within a machine. It's the bridge between the code we write and the logic gates that do the work.

Quiz Questions 1/6

What is the primary characteristic that distinguishes a modern computer from a simple calculator?

Quiz Questions 2/6

In the Von Neumann architecture, what is the role of the Arithmetic Logic Unit (ALU)?