Custom Search

Thursday, April 12, 2007

Von Neumann Architecture

Von Neumann architecture is a computer architecture model that uses a single structure to hold both the data and the instructions. In other words for a computer to be totally based on a Von Neumann architecture, the CPU shouldn’t make any difference between the Instructions and the data. Von Neumann architecture implements a universal turing machine.

Von Neumann architecture defines an instruction set and details computation as a series of instructions. The machine hence becomes much more flexible. By treating those instructions in the same way as data, a stored-program machine can easily change the program, and can do so under program control. The separation of storage from the processing unit is implicit in the von Neumann architecture.

A stored-program design, as Von Neumann architecture is also called sometimes, lets programs modify themselves while running. One early motivation for such a facility was the need for a program to increment or otherwise modify the address portion of instructions, which had to be done manually in early designs. Of course, this became less important when index registers and indirect addressing became customary features of machine architecture.
Self-modifying code is deprecated today since it is hard to understand and debug, and modern processor pipelining and caching schemes make it inefficient.


In some simple stored-program computer designs, a malfunctioning program can damage itself, other programs, or the operating system, possibly leading to a crash. A buffer overflow is one very common example of such a malfunction. Memory protection and other forms of access control can help protect against both accidental and malicious program modification. These features are generally part of the operating system.

On a large scale, the ability to treat instructions as data is what makes assemblers, compilers and other automated programming tools possible. One can "write programs which write programs".

The separation between the CPU and memory (where the instructions and the data is stored) leads to the von Neumann bottleneck, the limited throughput (data transfer rate) between the CPU and memory in comparison with the amount of memory.

In modern machines, throughput is much smaller than the rate at which the CPU can work. Under some circumstances (when the CPU is required to perform minimal processing on large amounts of data), this gives rise to a serious limitation in overall effective processing speed. The CPU is continuously forced to wait for vital data to be transferred to or from memory. As CPU speed and memory size have increased much faster than the throughput between them, the bottleneck has become more of a problem.

The performance problem is reduced by a cache between CPU and main memory, and by the development of branch prediction algorithms

Harvard architecture is a computer architecture with physically separate storage and signal pathways for instructions and data. The term originated from the Harvard Mark I relay-based computer, which stored instructions on punched tape (24 bits wide) and data in electro-mechanical counters (23 digits wide). These early machines had limited data storage, entirely contained within the data processing unit, and provided no access to the instruction storage as data, making loading and modifying programs an entirely offline process. eg - A calculator.

In a computer with the contrasting von Neumann architecture, the CPU can be either reading an instruction or reading/writing data from/to the memory. Both cannot occur at the same time since the instructions and data use the same signal pathways and memory. In a computer with Harvard architecture, the CPU can read both an instruction and data from memory at the same time. A computer with Harvard architecture can be faster because it is able to fetch the next instruction at the same time it completes the current instruction. Speed is gained at the expense of more complex electrical circuitry.

Computers today use a hybrid of both :))

1 comment:

PluvR said...

Frustu logo ka Blog lag raha tha yeh...esa lag raha tha exam ke liye pad rahi hu..