Professional Documents
Culture Documents
Compter Organization: Digital Systems
Compter Organization: Digital Systems
Chapter 5
1 Compter organization
Dr. Iness NEDJI MILAT (Lecturer)
iness.nedji@ensia.edu.dz
Stored program
Buses
Von-Neumann Architecture comprised of three major bus systems for data transfer :
Address bus, Control bus and Data bus
8 Types of Buses
Address Bus
Control Bus
1
0
Data Bus 1
0
1
1
1 Parallel lines
0
A bus structure consists of a set of common lines, one for each bit of a binary information.
9 Types of Buses
Data Bus
Carries the data between the CPU, the memory and the Input/Output devices
Bidirectional : Either the CPU writes data to memory, or it read data from
memory
May consist of 32, 64 or more separate lines
The number of lines is referred to as the width of the data bus,
The number of lines determines how many bits can be transferred at a time
The width of the data bus is a key factor in determining overall system
performance
10 Types of Buses
Address Bus
Carries the address of data between the CPU and the memory units,
Unidirectional : the CPU always sets the bus to indicate the address of memory word
being read or written.
Its width determines the maximum possible memory capacity.
Control Bus
Carries control signals (commands) from the CPU in order to control and coordinate
all the activities within the computer,
Unidirectional : the CPU always sets it to indicate operations to be performed.
11
Main Memory
12 Conceptual view of memory
▪ The memory unit that establishes direct communication with the CPU is called Main
Memory. It is often referred to as RAM (Random Access Memory).
▪ A memory unit stores binary information (Instruction or data) in groups of bits called
words.
▪ The data consists of m lines : n address lines
n
Main Memory
▪ Data input lines provide the information to be stored 2n words
(written) into the memory, CS m bits per word
R/W
▪ Data output lines carry the information out (read) from
the memory.
m
▪ The address consists of n lines which specify which word (among
the 2n words available) to be selected for reading or writing.
m data lines
▪ The control line Read/Write (1/0) specifies the direction of transfer of the data (Memory
operation).
▪ The control line Chip Select (CS) selects the chip box to be read from/written to.
13 Array Organization of Memory
Main Memory
2n- 1 Word 2n -1
Address •
•
• n lines
bus •
CS Deepth
R/W • (2n)
Data •
m lines
•
bus
2
1 Word 1
Width (m)
14 Array Organization of Memories : Example
Address bus : n = 3 lines Main memory
Memory size = 23 words = 8 words 7 0 0 1 1
5 is 1000 3 1 0 1 1
2 1 0 0 0
1 0 1 1 0
0 0 0 0 1
addresses
Width
15 Memory array architecture
Main memory
Memory is a 2D array of bits. Cell
Word 2n -1
Each bit stored in a cell memory.
Address bus
Address Decoder selects a word line
Decoder
R/W selector determines access type
Data bus
16 Memory: Write and Read Operations
The need to refresh DRAM demands more complicated circuitry and timing than SRAM.
Tri-State Buffers
If enabled (E=1), then Q = D
Otherwise, Q is not connected
20 DRAM Write operation
Tri-State buffer
=0
=1
Destructive reads
22
Central Processing Unit
23 Central Processing Unit (CPU) : Registers
The CPU is responsible for executing the instructions of a computer programs. Its major
components are : Control Unit, ALU and a variety of registers.
Central processing Unit Program Counter : holds the memory address of the
next instruction to be executed.
How they are
PC organized into the : holds the memory address
Memory Address Register
Control Unit CPU?
of either the data or the instruction.
MAR
Accumulator : holds the results of calculations carried
ACC
Registers out by the ALU
m bits
Instr.
IR Decoder @0
m bits
MDR Control unit
m bits
m lines m lines
25 CPU : Control unit vs Processing unit
The control unit allows:
to sequence the execution of the programs’ instructions,
to ensure the fetching and the decoding of the instruction to execute
(which is encoded in binary form)
to organize the execution of the instruction,
to carry out the preparation of the following instruction.
1. First we need to :
Fetch the instruction
2. Then we need to :
Decode instruction / fetch register operands
3. Then we need to :
Do the operation
4. Then we need to :
Write the result into register-file
Store the result into memory
5. Finally we need to :
Calculate the next instruction address
27 FETCH – DECODE – EXECUTE Cycle
As soon as a computer is turned on it starts fetching instructions from memory,
decoding them and executing them.
This process is repeated continuously, therefore it is known as the
Fetch-Decode-Execute Cycle.
Fetch
Execute Decode
0110 0010 0100
Instr. 1
IR Decoder
0110 0010 0100 0
m bits
12 lines 12 lines
FETCH - DECODE - EXECUTE (Data path)
29 Buses
R1
PC Memory
51
50 50
R2
MAR ...
R3 50 ADD R4, R1, R2
010110001
IR
R4 MDR 16-bit
010 11 00 01 010110001
B A
ALU
R1 10
PC Memory
51 50
R2 30
MAR ...
R3 50 ADD R4, R1, R2
IR (Data path)
R4 40 MDR 16-bit
010 11 00 01 010110001
B A
+
ALU
The number of bits allocated for the opcode can determine the number of machine
instructions
Ex : if Opcode size is 4 bits -> the CPU can execute 16 kind of instructions
35 Addressing mode
Addressing modes specify where an operand is located. They can specify a constant, a register or a
memory location.
Immediate addressing is where the data is part of instruction
add R5 , R3 , 50 ; R5=R3 + 50
add 50 ; ACC=ACC + 50
Direct addressing is where the address of data is given in the instruction
load R5 , 0x1FA5 ; R5= [0x1FA5]
mov R1, [300] ;
Indirect addressing gives the address of the address of the data in the instruction
load R5 , (0x1FA5) ; R5= [[0x1FA5]]
Register addressing is where the data is located in a register
add R3, R1, R2 ; R3= R1+R2
36 Instruction set architecture ISA
Instruction set architecture (ISA) of CPU is a blueprint defining:
the set of machine instructions (Opcode),
the CPU registers (number and size),
the memory size,
the addressing mode,
…
37
38
39 RISC vs. CISC
Complex instruction set computer (CISC): Reduced instruction set computer (RISC):
• Large instruction set; • Small instruction set;