Lecture 6
Lecture 6
Topics covered:
CPU Architecture
Control path
2
Fetch/execute cycle
Step I:
Fetch the contents of the memory location pointed to by
Program Counter (PC).
PC points to the memory location which has the instruction to
be executed.
Load the contents of the memory location into Instruction
Register (IR).
Step II:
Increment the contents of the PC by 4 (assuming the
memory is byte addressable and the word length is 32 bits).
Step III:
Carry out the operation specified by the instructions in the IR.
3
Internal organization of a processor
4
Internal organization of a processor
Internal processor
bus
Control signals
PC
Instruction
Address
decoder and
lines
MAR control logic
Memory
bus
MDR
Data
lines IR
Constant 4 R0
Select MUX
Add
A B
ALU Sub R( n - 1)
control ALU
lines
Carry-in
XOR TEMP
Z
Single bus organization
6
Single bus organization (contd..)
Instruction decoder and control logic block, or control
unit issues signals to control the operation of all units
inside the processor and for interacting with the
memory bus.
Control signals depend on the instruction loaded in the
Instruction Register (IR)
Outputs from the control logic block are connected to:
Control lines of the memory bus.
ALU, to determine which operation is to be performed.
Select input of the multiplexer MUX to select between
Register Y and constant 4.
Control lines of the registers, to select the registers.
7
Single bus organization (contd..)
8
Registers and the bus
bus line 0
bus line 1
register
10
Registers and the bus (contd..)
11
Riin
Each register Ri has two control signals,
Riin and Riout.
Ri
If Riin=1, the data from the bus is loaded
into the register.
Riout If Riout=1, the data from the register is
Yin
loaded onto the bus.
The same holds for registers Y and Z as
well.
Y
Constant 4
Select MUX
A B
ALU
Zin
Zout
Registers and the bus (contd..)
Bus
D Q
1
Riout
Q
Clock
Ri in
13
Registers and the bus (contd..)
Bus
D Q
1
Riout
Q
Clock
Ri in
Riin = 1:
Multiplexer selects the data on the bus.
Data is loaded into the flip-flop at the rising edge of the clock.
Riin = 0:
Multiplexer feeds back the value currently stored in the flip-flop.
Q output represents the value currently stored in the flip-flop.
14
Registers and the bus (contd..)
Bus
D Q
1
Riout
Q
Clock
Ri in
Riout = 1:
Tri-state gate loads the value of the flip-flop onto the bus.
Data is loaded onto the bus at the rising edge of the clock.
Riout = 0:
Gate’s output is in high-impedance (electrically disconnected) state.
Corresponds to open-circuit state.
15
Registers and the bus (contd..)
0 0
D Q D Q
1 1
Clock
Q Clock
Q
Riin Riin
16
Registers and the bus (contd..)
Low-to-High transition
•Data is loaded from the register to the bus (or to the register from the bus)
at the rising edge of the clock.
•Data is loaded at the L-H transition of the clock.
17
Registers and the bus (contd..)
18
Simple register transfer example
Clock period
1 2 3
1. Control signals R3out and R4in become 1. They stay valid until the end of
the clock cycle.
2.After a small delay, the contents of R3 are placed onto the bus. The contents
of R3 stay onto the bus until the end of the clock cycle.
3. At the end of the clock cycle, the data onto the bus is loaded into R4. R3 out
and R4in become 0.
19
Loading multiple registers from the bus
Clock period
1 2 3
1. Control signals R3out, R4in and R5in become 1. They stay valid until the end of
the clock cycle.
2.After a small delay, the contents of R3 are placed onto the bus. The contents
of R3 stay onto the bus until the end of the clock cycle.
3. At the end of the clock cycle, the data onto the bus is loaded into R4. and R5.
R3out, R4in and R5in become 0.
20
Loading multiple registers from the bus
(contd..)
It is possible to load multiple registers simultaneously
from the bus.
For e.g., transfer the contents of register R3 to registers R4
and R7 simultaneously.
The number of registers that can be simultaneously
loaded depends on:
Drive capability (fan-out)
Noise.
Note that this is an electrical issue, not a logical issue.
21