</>EmbeddedInterview

What is the difference between Harvard and von Neumann architecture?

EasyMicrocontrollers & ARM Cortex-M

Short answer: In a von Neumann architecture, instructions and data share one memory and one bus, so an instruction fetch and a data access cannot happen at the same time. In a Harvard architecture, instructions and data have separate memories and buses, so both can happen in the same cycle. Most modern cores, including Cortex-M3/M4/M7 and Cortex-A, are modified Harvard: separate instruction and data buses or caches, but one unified address space.

Von Neumann Harvard Modified Harvard
Buses one shared separate instruction and data separate paths/caches, single address map
Can execute from RAM / read constants from flash yes not directly (separate spaces) yes
Examples Cortex-M0/M0+ (single AHB-Lite bus), original 8086 8051, AVR, PIC, many DSPs Cortex-M3/M4/M7, Cortex-A (split L1 I/D caches)

Cortex-M3/M4 bus details: an I-code bus fetches instructions from the code region (flash), a D-code bus reads literal data from the code region, and a System bus accesses SRAM and peripherals. Code can still run from SRAM (via the System bus, typically slower) and data can still be read from flash, because all buses share one 4 GB address map.

Practical consequences

  • On classic Harvard MCUs like AVR, a constant table in flash needs special access (PROGMEM, pgm_read_byte), because a normal pointer points into RAM. On Arm this is unnecessary: const data in flash is read with normal pointers.
  • On Cortex-M7, putting code in ITCM and data in DTCM gives the full Harvard benefit (single-cycle, parallel access).
  • Self-modifying code or loading code into RAM on a modified Harvard core with caches needs cache maintenance (clean D-cache, invalidate I-cache) because the two paths are separate.