Chapter 5 - Computer Organization (2025)
Chapter 5 - Computer Organization (2025)
Chapter 5
1 Computer organization
Dr. Iness NEDJI MILAT
[email protected]
Buses
Main
CPU Input/Output
Memory
Address Bus
Control Bus
1
0
Data Bus 1
0
1
1
1
0
Parallel lines
A bus structure consists of a set of common lines, one for each bit of a binary
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
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) Main
in groups
n
of bits called words. n address Memory
lines 2n words
▪The data lines (bus) consists of m lines which CS m bits per
transfer information from or to the memory,
R/W word
2n- Word 2n -1
1
Addres •
• n lines •
s bus
CS • Deepth
R/W (2n)
Data • •
• m lines
bus
2
1 Word 1
Width (m)
14 Array Organization of Memory : Example
Main
Address bus : n = 3 lines
memory
Memory size = 23 words = 8 words 7 0 0 1 1
4
For example, the 4-bit word stored at address 1 0 1 1
Deept
h
3 1 0 1 1
5 is 1000
2 1 0 0 0
1 0 1 1 0
0 0 0 0 1
addresse
s
Width
15 Memory array architecture
Main
Memory is a 2D array of bits. memory
Cell
Word 2n -1
Each bit stored in a cell memory.
Address
Decoder
bus
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.
20
Central Processing Unit
Central Processing Unit (CPU) :
21
Registers
The CPU is responsible for executing the instructions of computer
programs. Its major components are : Control Unit, ALU and a
Program Counter : holds the memory
varietyprocessing
Central of registers.
address of the next instruction to be
Unit executed.
PC
How these
Memory Address Register : holds the
components are
memory address of either the data or the
Control Unit
MAR organized inside
instruction.
the CPU?
Accumulator : holds the results of
ACC
Registers calculations carried out by the ALU
IR Decoder @0
m bits
MDR Control unit
m bits
m lines m lines
CPU : Control unit vs Processing
23
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.
?
Assembly language
program
CISC :
ADD S, A,
Lw R1, A
Lw R2, B
B ADD R3, R1, Machine
R2 instructions
Assembler
Sw S, R3
0000 1001 1100 0110 1010 1111 0101 1000
Binary Machine 0000 1001 0101 1000 0000 1001 1100 0110
Langage Program 1100 0110 1010 1111 0101 1000 0000 1001
0100 0110 0000 1001 1100 0110 1010 1111
26 Machine instruction
The machine instruction is simply a sequence of bits that can be directly
decoded and executed by the CPU,
For executing instruction, the CPU needs to know : the operation, the
operands and their addressing modes,
The machine instruction consists of two fields :
Operation Code (Opcode) : specifies the operation to be performed by
CPU,
Operand (s) : specifies the data to be operated by the CPU. The operand
can either be stored in main memory Constant
or in CPU register.
(immediate addressing mode) Lw R1, 5
R3 PSW PC 1000
1001
S = 6 0000000000000
ACC 000
d
0000000000001 Sequencer e16-bitB = 4 0000000000000
100 EN = 1
(Control logic
0110 010 )
0010bloc
R/W
R/W == 1
0
1 c 111
+ 0 o 3
d
ALU A=2 0000000000000
e 101
Instr. r 1
IR +Decoder
0110 0110 0010 010 0
16 bits 0 16 bits
IR +Decoder
0110 0011 0001 001 0
16 bits 0 16 bits