Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

von neumann vs harvard architecture

Why computer architecture based on von Neumann architecture is preferred over Harvard architecture, when designing personal computers; while Harvard architecture is used for designing microcomputer based computer systems and DSP based computer systems?

like image 799
SouvikMaji Avatar asked Nov 09 '14 07:11

SouvikMaji


People also ask

What is the main difference between Von Neumann and Harvard architectures?

The major difference between the two architectures is that in a Von Neumann architecture all memory is capable of storing all program elements, data and instructions; in a Harvard architecture the memory is divided into two memories, one for data and one for instructions.

Is Von Neumann or Harvard architecture better?

Harvard architecture has a higher performance than Von Neumann due to the presence of the two separate memory spaces (data memory and instructions memory). This makes Harvard architecture execute data and instructions faster as compared to Von Neumann architecture.

Why is Harvard architecture not used?

A pure Harvard architecture suffers from the disadvantage that the mechanism must be provided to separate the load from the program to be executed into instruction memory and thus leaving any data to be operated upon into the data memory.


2 Answers

Well current CPU designs for PC's have both Harvard and Von Neumann elements (more Von Neumann though).

If you look at the L1 caches you would see that in AMD, ARM and Intel systems you have Instruction L1 Cache and Data L1 Cache, that can be accessed independently and in parallel. That's the Harvard part. However, in L2, L3 or in DRAM, data and codes are mixed. That's the Von Neumann part.

So why isn't a pure Harvard architecture adopted for PC's? My opinion is that it does not make sense. If you profile main majority of applications, you would see that the L1 Instruction Cache miss ratio is very small. This means that generally code size is not a problem. So it wouldn't make sense to design a fully separate path for code. Data can grow very large but code can't really.

In DSP's it makes sense to use separate code and data paths. That's because DSP's work mainly on "streaming data" meaning that the need for caching is rather small. Also the DSP codes can contain pre-computed coefficients that increase the code size. So there is a balance between data size and code size, meaning that it makes sense using a Harvard architecture.

like image 55
VAndrei Avatar answered Sep 29 '22 11:09

VAndrei


The fundamental difference between Von Neumann architecture and Harvard architecture is that while in the Harvard architecture, instruction memory is distinct from data memory, in Von Neumann they are the same. This reflects the practical reality of PCs (in which programs are stored and read from the same medium as data, usually disk and RAM), and microcontrollers (in which the program is stored in non-volatile memory, and data is stored in volatile memory).

like image 29
MooseBoys Avatar answered Sep 29 '22 13:09

MooseBoys