Harvard vs Von Neumann Architecture:

Icodewithben
3 min readDec 3, 2023

--

Video on this and PPQ: https://youtu.be/LeEDQDUffoU

How does a CPU work and how you can program it https://medium.com/@icodewithben/cpu-and-machine-code-999405b19d3e

The Von Neumann and Harvard architectures are two fundamental types of computer architectures that describe the structure and functionality of most computer systems. Here are the key differences between them:

Memory Structure

Von Neumann Architecture:

  • It features a shared memory for storing both data and program instructions.
  • Memory is organized as a single sequence of words or bytes.

Harvard Architecture:

  • It has separate memory modules for storing data and program instructions.
  • Pipelining — allows simultaneous access to both the data and the instruction memories, which can increase the system’s speed.
  • Use of Cache, a small amount of high performance memory is stored next to the CPU which can store frequently used data and instructions

Execution of Instructions

Von Neumann Architecture:

  • Because instruction data and program data share the same bus, the process of fetching and executing instructions is sequential. This can lead to a bottleneck, known as the Von Neumann bottleneck, where the system can be delayed as it waits for previous tasks to complete.

Harvard Architecture:

  • With separate buses for instruction and data, the CPU can fetch an instruction and perform a data operation simultaneously, thus potentially achieving greater throughput and efficiency.

System Complexity and Cost

Von Neumann Architecture:

  • Typically simpler and less expensive to implement than Harvard architecture because it requires fewer buses and less physical memory separation.
  • Easier to program as the same memory space is shared between instructions and data.

Harvard Architecture:

  • Generally more complex and costly due to the need for separate memory and buses.
  • Often used in systems where speed and efficiency in instruction execution are critical, such as signal processing.

Flexibility and Upgradability

Von Neumann Architecture:

  • More flexible in terms of upgrading software since the program can alter itself as it runs, provided that it adheres to certain safety and control protocols.
  • It’s easier to implement certain mechanisms like just-in-time compilation or self-modifying code.

Harvard Architecture:

  • Less flexible in terms of software since the physical separation of memory makes it difficult for the program to write to its own instruction memory.
  • This makes it inherently more secure against certain types of attacks that exploit the ability to write to executable memory.

Use Cases

Von Neumann Architecture:

  • Used in most general-purpose computing systems where the flexibility and simplicity of the architecture are more beneficial.

Harvard Architecture:

  • Often found in embedded systems, digital signal processing (DSP), and systems where performance needs to be optimized for specific tasks.
Main differences between Harvard and Von Neumann is the separate stores of data and instructions code, leading to less bottlenecks. Also pipelining meaning Harvard can fetch, decode and execute all at the same time!

PPQ 2022:

--

--