Table of Contents

Harvard architecture

Harvard archictecture is a type of computer archictecture. It's a type of architecture where code and data are kept in separate memories.

The Harvard architecture can be contrasted against von-Neumann archictecture. In the latter, code and data are both stored in the same working memory (RAM). The CPU has to fetch both the instructions and data by accessing the same memory bus, leading to what is known as von-Neumann bottleneck. This doesn't really matter, of course – virtually all modern architectures (x86-64, RiscV, ARM, Apple M1, etc.) are von-Neumann architectures. This is laregely because the von-Neumann architecture allows the computer to modify its own behavior on the fly and the von-Neumann bottleneck itself is mitigated by layered caching, branch prediction and many other techniques.

For comparison, Harvard architecture splits data and code into two different memories. For example, data can be stored in RAM or EEPROM, while code is stored in flash memory. This makes it popular in microcontrollers (MCUs) like PIC. You flash an MCU once and it always behaves the same way. The MCU usually has no way to modify its own code so it's slightly more immune to errors and hacking.