The Von Neumann Architecture
In 1945 Jone von Neumann was the first published architecture of the computer, which was known as Von Neumann architecture. According to Von Neumann Architecture, The basic function performed by a computer is the execution of a program. A program is a set of machine instructions. An instruction is a form of control code, which supplies the information about an operation and the data on which the operation is to be performed. A typical Von Neumann machine consists of five functionally independent units :
- Input unit
- Output unit
- Arithmetic and logic units
- Control unit
- Memory unit
The basic structure of a conventional Von Neumann machine is shown below.
Computers accept coded information through input units, which read the data. The most common input device is the keyboard. Whenever a key is pressed, the corresponding letter or digit is translated into its corresponding code and sent to the processor. There are many other kinds of input devices like :
- Floppy drive
Output unit sends processed result to outside world. The familiar example of such device k printer. There are many other kinds of output devices like :
- Video terminal
- Floppy drive
Arithmetic and Logic Unit (ALU)
Arithmetic or logic operations like multiplication, addition, division are performed by ALU. Operands are brought into the ALU, where the necessary operation is performed.
Operations of ALU, memory and input and output units are coordinated and controlled the control unit. Control unit sends control signals to other units. Data transfer between processor and memory are controlled by the control unit through timing signals.
Main memory is needed in a computer to store instructions and the data at the time of program execution. It was pointed out by Von Neumann that the same memory can be used for storing data and instruction. The memory unit stores all information in a group of memory cells as binary digits. Each memory location has a unique address and can be addressed independently. The contents of the desired memory locations are provided to the central processing unit by referring to the address of the memory location. The amount of information, which can be transferred between CPU and memory, depends on the size of the BUS connecting the two.
Key Features of a Von Neumann Machine
- The Von Neumann machine uses stored program concept. The program and data are stored in the same memory unit. The computers prior to this idea used to store programs and data in separate memories. Entering and modifying these programs were very difficult as they were entered manually.
- Each location of the memory can be addressed independently.
- Execution of instruction in Von Neumann machine is carried out in a sequential fashion (unless explicitly altered by the program itself) from one instruction to the next.
Basic Structure of the CPU
The design of CPU in modern form was proposed by John Von Neumann and his colleagues for the IAS computer. The IAS computer had a minimal number of registers along with the essential circuits. This computer had a small set of instructions and instruction was allowed to contain only one operand address. The figure shown below gives the structure of the IAS computer.
The structure of the CPU consists of the following registers.
Accumulator (AC): It interacts with ALU and stores the input or output result.
Data Register (DR) or Memory Buffer Register (MBR): It acts as a buffer storage between the main memory and the CPU.
Program Counter (PC): It contains the address of the next instruction to be executed.
Instruction Register (IR): Holds the current instruction.
Memory Address Register (MAR): It provides the address of memory location from where data is to be retrieved or to which data is to be stored.
Execution of a Program by Von Neumann Machine :
- The program to be executed is loaded in main (primary) memory.
- A special register, PC (Program counter) is made to point to the first instruction of the program. CPU fetches the instruction pointed by PC. PC contents are subsequently changed to point to the next instruction.
- If the initial value of PC = 0000 (in binary), instruction number I will be fetched for execution. After fetching “Instruction number 1”, PC will be incremented by one. It is assumed that the size- of each instruction is 1 byte.
PC = PC+1=0 +1=1
Fetching an instruction
- CPU interacts with memory thrcugh two special registers :
- MAR (Memory Address Register): It provides the address of memory location from where data is to be retrieved or to which data is to be stored.
- DR (Data Register): It acts as buffer storage between the main memory and the CPU.
- Instruction to be executed next is brought from the memory to the CPU, through the following steps :
- The next instruction address is transferred from PC to MAR.
(2) MAR puts this signal on the address bus for selection of the required location of the memory.
(3) Controller generates the RD (read control signal) signal to perform read operation on memory. Required instruction flows on data bus. Instruction on data bus is accepted in DR (Data Register).
Execution of instruction
- The fetched instruction is in the form of binary code and is loaded into instruction register (IR ) from DR (Data Register). The instruction specifies what action the CPU has to take.
- The CPU interprets the instruction and performs the required action. The action could be :
- CPU to memory data transfer or memory to CPU data transfer.
- CPU to I/O or I/O to CPU data transfer. Data may be transferred to or from the outside world.
- The CPU may perform some arithmetic or logic operation on data.
The instruction cycle consists of following stages :
- First, the address of the next instruction is calculated based on the width of instruction and memory organization. For example, if in a computer instruction is 16 bits and if memory is organized as 16-bit words, then the address of the next instruction is evaluated by adding 1 in the address of the previous instruction. In case, the memory is organized in bytes, which can be addressed individually, then we need to add 2 in the previous address to get the address of the next instruction.
- Then, an instruction is fetched from the memory location pointed by the PC to the CPU.
- The instruction is decoded to determine the type of operation desired arid what are the operands to be used.
- In case, the operands need to be fetched from memory or via I/O, then the address of the memory location or I/O device is calculated.
- Next, the operand is fetched from the memory or read from the I/O device.
- Now, the operation asked by the instruction is performed.
- Finally, the result is written back.
An Advanced Structure of Von Neumann Machine :
An advanced machine based on Von Neumann architecture is shown in the figure below. It is more powerful machine. Few additional features have been added. Some of them are :
- Provides additional registers for storing operands and addresses. A single register AC (Accumulator) is replaced by a set of registers. These are general-purpose registers and they can store either operands or addresses.
- Increased capability of the ALU circuit. For example, most microprocessors have capabilities for performing addition and subtraction. This capability with only a little extra circuit can be used for multiplication and division.
- Includes a special register to facilitate conditional jumps within a program. A status register which gives information about various conditions like :
- Sign of the result.
- Whether there is arithmetic overflow.
- if the result is zero.
- Whether there is carry out from the arithmetic operation.
- This status register can be checked for a typical condition for the execution of a conditional branch instruction.
- We know that a call instruction is implemented through a stack. The return address is pushed on top of the stack. It includes a special register for transfer of control between different subroutines or subprograms or interrupts. It uses a special area in the main memory for holding data of stack and a special register called stack pointer (SP). The stack pointer points to the top of the stack.