Von Neuman Model-Part-1
Von Neuman Model-Part-1
ABV-IIITM, Gwalior
Odd Semester 2022-23
The Stored Program Computer
1943: ENIAC (Electronic Numerical Integrator and Computer)
Presper Eckert and John Mauchly -- first general electronic computer.
(or was it John V. Atanasoff in 1939?)
Hard-wired program -- settings of dials and switches.
1944: Beginnings of EDVAC (Electronic Discrete Variable Automatic Computer)
among other improvements, includes program stored in memory
1945: John von Neumann
wrote a report on the stored program concept,
known as the First Draft of a Report on EDVAC
The basic structure proposed in the draft became known
as the “von Neumann machine” (or model).
a memory, containing instructions and data
a processing unit, for performing arithmetic and logical operations
a control unit, for interpreting instructions
Memory
Processing unit
Input
Output
Control unit
4
The Von Neumann Model
MEMORY
Mem Addr Reg
Mem Data Reg
CONTROL UNIT
PC or IP Inst Register
5
The Von Neumann Model
MEMORY
Mem Addr Reg
Mem Data Reg
CONTROL UNIT
PC or IP Inst Register
6
Memory
The memory stores
Data
Programs
7
Word-Addressable Memory
Each data word has a unique address
In MIPS, a unique address for each 32-bit data word
In LC-3, a unique address for each 16-bit data word
. . .
. . .
00000003 D1617A1C Word 3
00000002 13C81755 Word 2
. . .
. . .
0000000C D 1 61 7A 1 C Word 3
00000008 1 3 C8 17 5 5 Word 2
00000004 F 2 F1 F0 F 7 Word 1
How are these four bytes
00000000 8 9 addressed?
AB CD EF Word 0
9
Big Endian vs Little Endian
Little Endians broke their eggs on the little end of the egg
Big Endians broke their eggs on the big end of the egg
10
Big Endian vs Little Endian
Big Endian Little Endian
Byte Address Byte
Address of the Address
. . .
. . .
Word
. . .
C D E F C F E D C
8 9 A B 8 B A 9 8
4 5 6 7 4 7 6 5 4
0 1 2 3 0 3 2 1 0
MSB LSB MSB LSB
(Most Significant Byte) (Least Significant Byte)
11
Big Endian vs Little Endian
Big Endian Little Endian
Byte Word Byte
Does
Address thisAddress
really matter?
Address
. . .
. . .
. . .
Answer: No, it is a convention
C D E F C F E D C
8 9 A B 8 B A 9 8
Qualified answer: No, except when one big-
endian
4 5system
6 and
7 one 4little-endian
7 6system
5 4
have
0 to
1 share
2 data
3 0 3 2 1 0
MSB LSB MSB LSB
(Most Significant Byte) (Least Significant Byte)
12
Accessing Memory: MAR and MDR
There are two ways of accessing memory
Reading or loading
Writing or storing
To read
Step 1: Load the MAR with the address
Step 2: Data is placed in MDR
To write
Step 1: Load the MAR with the address and the MDR with the data
Step 2: Activate Write Enable signal
13
The Von Neumann Model
MEMORY
Mem Addr Reg
Mem Data Reg
CONTROL UNIT
PC or IP Inst Register
14
Processing Unit
The processing unit can consist of many functional units
15
Registers
Memory is big but slow
Registers
Ensure fast access to operands
Typically one register contains one word
16
MIPS Register File
Name Register Number Usage
$0 0 the constant value 0
$at 1 assembler temporary
$v0-$v1 2-3 function return value
$a0-$a3 4-7 function arguments
$t0-$t7 8-15 temporary variables
$s0-$s7 16-23 saved variables
$t8-$t9 24-25 temporary variables
$k0-$k1 26-27 OS temporaries
$gp 28 global pointer
$sp 29 stack pointer
$fp 30 frame pointer
$ra 31 function return address
17
The Von Neumann Model
MEMORY
Mem Addr Reg
Mem Data Reg
CONTROL UNIT
PC or IP Inst Register
18
Input and Output
Many devices can be used for input and output
19
The Von Neumann Model
MEMORY
Mem Addr Reg
Mem Data Reg
CONTROL UNIT
PC or IP Inst Register
20
Control Unit
The control unit is similar to the conductor of an orchestra
21
Programmer Visible (Architectural) State
M[0]
M[1]
M[2]
M[3] Registers
M[4] - given special names in the ISA
(as opposed to addresses)
- general vs. special purpose
M[N-1]
Memory Program Counter
array of storage locations memory address
indexed by an address of the current instruction
CONTROL UNIT
PC or IP Inst Register
23
Von Neumann Model: Two Key Properties
Von Neumann model is also called stored program computer
(instructions in memory). It has two key properties:
Stored program
Instructions stored in a linear memory array
Memory is unified between instructions and data
The interpretation of a stored value depends on the control signals
24
LC-3: A Von Neumann Machine
Program
Counter
Instruction
Register ALU: 2 inputs, 1 output
ALU operation
GateALU
Monitor
Memory Address 16-bit DDR (data), DSR (status)
Register addressable
25