OCR H446, section 1.1.1 (e)
A processor's architecture is the way its components are arranged and connected, in particular how it handles instructions and data. There are two classic designs, and a modern compromise.
Von Neumann architecture
In the von Neumann architecture, instructions and data are stored together in the same main memory and use the same buses.
- It follows the stored program concept: the program is held in memory as binary, in the same way as data, and is fetched and executed in sequence.
- There is a single memory, a single address bus and a single data bus.
Advantages
- Simple and cheap to design and build.
- Flexible: memory can be divided between programs and data however is needed, and programs can be loaded and changed easily.
- Because programs are data, one program can create or modify another (for example, a compiler).
Disadvantages
- The von Neumann bottleneck. Instructions and data share the same bus, so the processor can't fetch an instruction and read or write data at the same time. The single bus limits the speed.
- A program that goes wrong could overwrite its own instructions, because they are in the same memory as the data.
Used in
General purpose computers: PCs, laptops, servers and games consoles.
Harvard architecture
In the Harvard architecture, instructions and data are held in separate memories, with separate buses for each.
Advantages
- The processor can fetch the next instruction and access data at the same time, which is faster.
- The memories can be different sizes and types, and have different word lengths.
- The program memory can be protected (read-only) so that instructions can't be overwritten by mistake.
- No bottleneck on a single bus.
Disadvantages
- More complex and expensive: more buses and more wiring.
- Less flexible, since the split between the memories is fixed. Unused data memory can't be used for instructions.
Used in
Embedded systems and digital signal processors (DSPs), such as microcontrollers in appliances and audio and video processors, where speed and predictable performance matter.
Contemporary processor architecture
Modern general-purpose processors use a mix, often called a modified Harvard architecture.
- Main memory (RAM) is shared, so instructions and data are held together, as in von Neumann. This keeps the system flexible.
- Inside the processor, the cache is split into a separate instruction cache and data cache, each with its own path, as in Harvard.
This gets the speed of Harvard (instructions and data fetched at the same time from the caches) and the flexibility of von Neumann (one memory in which programs and data live). Most phones, laptops and desktops work this way.
Modern processors also use other features that are not part of the basic von Neumann or Harvard ideas, including pipelining, multiple cores, several levels of cache and branch prediction.
Comparison
| Von Neumann | Harvard | Contemporary (modified Harvard) | |
|---|---|---|---|
| Instructions and data | Same memory | Separate memories | Shared main memory, separate caches |
| Buses | One set | Separate sets | Separate for the caches, shared for RAM |
| Fetch instruction and data together? | No (bottleneck) | Yes | Yes, from the caches |
| Complexity and cost | Lowest | Higher | Highest |
| Typical use | Simple general purpose designs | Embedded systems, DSPs | Modern PCs, phones, servers |
Worked example
Task: a company is designing a small controller for a washing machine, and a games console. Which architecture suits each, and why?
- Washing machine controller: Harvard. It runs one fixed program that never changes, so the program can sit in its own protected memory. It needs predictable, quick instruction fetching, and a simple, low-cost design.
- Games console: a modern, modified Harvard design (von Neumann main memory with split caches). It must load many different games into the same memory, which suits shared memory, but it also needs the speed of fetching instructions and data at the same time.
Exam tip: the key difference is shared or separate memory for instructions and data. For von Neumann, name the bottleneck. For contemporary processors, say that they use split caches with shared main memory, to get the benefits of both.
Check yourself
What is the main difference between von Neumann and Harvard architectures?
Von Neumann uses one memory and one set of buses for both instructions and data. Harvard uses separate memories and buses, so an instruction and data can be accessed at the same time.
What is the von Neumann bottleneck?
Because instructions and data share a single bus, the processor can't fetch an instruction and transfer data at the same time, which limits the speed.
Where is Harvard architecture typically used?
In embedded systems and digital signal processors.
How do contemporary processors combine the two designs?
They have a shared main memory, as in von Neumann, but split the cache into separate instruction and data caches, as in Harvard.