Harvard Architecture
While the Von Neumann architecture uses a single memory for both instructions and data, the Harvard architecture takes a different approach. Named after the Harvard Mark I relay computer (1944), it uses separate memory systems for instructions and data.
Separate Memory Spaces
In a Harvard architecture, the CPU has two separate buses - one for instructions and one for data. This means both can be accessed simultaneously!
Harvard Architecture
+---------------------------------------------+
| |
| +-------------+ +------------------+ |
| | | | Instruction | |
| | CPU | | Memory | |
| | | +------------------+ |
| | +-------+ | ^ |
| | |Control| | | |
| | | Unit |<-----Instruction Bus |
| | +-------+ | | |
| | | ALU | | v |
| | +-------+ | +------------------+ |
| | |Regis- | | | Data Memory | |
| | | ters | | +------------------+ |
| | +-------+ | ^ |
| +------+------+ | |
| | Data Bus | |
| +----------------->+ |
| | |
| v |
| +-------------+ |
| | I/O | |
| +-------------+ |
+---------------------------------------------+
Advantages of Harvard Architecture
- Parallel Access: Can fetch instructions while reading/writing data
- Higher Bandwidth: Two memory systems provide more total throughput
- Predictable Performance: No contention between instruction and data fetches
- Simpler Control: The hardware doesn't need to arbitrate between instruction and data requests
Modern Usage
You might think Harvard architecture is outdated, but it's actually alive and well! Modern processors use a modified Harvard approach internally:
- DSPs (Digital Signal Processors): Often use true Harvard architecture for high-speed signal processing
- Microcontrollers: Many embedded systems use Harvard for efficiency
- Modern CPUs: Use separate L1 caches for instructions and data (modified Harvard)
Harvard vs Von Neumann
The main trade-off is complexity vs performance. Harvard requires more hardware (two memory systems, two buses) but offers better performance for applications that need simultaneous access to instructions and data. Von Neumann is simpler and cheaper but can suffer from the bottleneck when both types of access are needed simultaneously.