15-Micro Programmed Control Unit-13!02!2023
15-Micro Programmed Control Unit-13!02!2023
L T PC
3 0 03
Dr. M. Bhuvaneswari
Assistant Professor Senior Gr.2
School of Computer Science and Engineering
Vellore Institute of Technology, Vellore
[email protected]
Basic Processing Unit
ALU and Datapath
References:
Carl Hamacher, Zvonko Vranesic, Safwat Zaky, Computer organization,
Mc Graw Hill, Fifth edition, Reprint 2011.
Computer Architecture organization – NPTEL – IIT Kharagpur
Fundamental Concepts
Phases of an Instruction Cycle
Fetch Cycle
Execution Cycle
PC
PC
Instruction
Instruction
Address
Address decoder
decoderand
and
lines
lines
MAR
MAR control
control logic
logic
Single Bus
Memory
Memory
bus
bus
Organization of the
MDR
MDR
Data
Data
lines IR
IR
lines
Select
Select MUX
MUX
Add
Add
AA BB
ALU Sub
Sub RRnn -- 11
ALU
control
control ALU
lines ALU
lines
Carry-in
Carry-in
XOR
XOR TEMP
TEMP
ZZ
Figure
Figure 7.1.
7.1. Single-bus
Single-bus organization
organization of
of the
the datapath
datapath inside
inside aa processor.
processor.
Executing an Instruction
An instruction can be executed by performing
one or more of the following operations in some
specified sequence.
Transfer a word of data from one processor
register to another or to the ALU.
Perform an arithmetic or a logic operation
and store the result in a processor register.
Fetch the contents of a given memory
location and load them into a processor
register.
Store a word of data from a processor register
into a given memory location.
Register Transfers
Internal processor
bus
Riin
Ri
The decoder generates the
Riout
control signals needed to
Yin select the registers involved
Y
and direct the transfer of
Constant 4 data.
Select MUX Registers + ALU +
A B interconnecting bus =
Datapath
ALU
Zin
Z out
Figure 7.2. Input and output gating for the registers in Figure 7.1.
Register Transfers
All operations and data transfers are controlled
by the processor clock.
Bus
Bus
00
D
D Q
Q
11
Q
Q
Ri
Riout
out
Ri
Riinin
Clock
Clock
Figure
Figure 7.3. Input and output gating for one register bit.
Figure7.3. Input and
7.3. Input andoutput
outputgating
gatingfor
forone
oneregister
registerbit.
bit.
Performing an Arithmetic or
Logic Operation
The ALU is a combinational circuit that has no
internal storage.
ALU gets the two operands from MUX and bus.
The result is temporarily stored in register Z.
What is the sequence of operations to add
the contents of register R1 to those of R2 and
store the result in R3?
1. R1out, Yin
3. Zout, R3in
Fetching a Word from Memory
The response time of each memory access
varies (cache miss, memory-mapped I/O,…).
To accommodate this, the processor waits until
it receives an indication that the requested
operation has been completed (Memory-
Function-Completed, MFC).
Move (R1), R2
MAR ← [R1]
Start a Read operation on the memory bus
Wait for the MFC response from the memory
Load MDR from the memory bus
R2 ← [MDR]
Fetching a Word from Memory
Address into MAR; issue Read operation; data into MDR.
Memory-bus Internal processor
data lines MDRoutE MDRout bus
MDR
Figure 7.4.
Figure 7.4. Connection and control
Connection and controlsignals
signalsfor
forregister
registerMDR.
MDR.
Storing a word in memory
Execution of a Complete
Instruction
Add (R3), R1
Fetch the instruction
Fetch the first operand (the contents of the
memory location pointed to by R3)
Perform the addition
Load the result into R1
Execution of a Complete
Instruction Internal processor
bus
PC
Instruction
Address
decoder and
lines
MAR control logic
Memory
bus
MDR
Data
lines IR
Y
Constant 4 R0
Select MUX
Add
A B
ALU Sub R n - 1
control ALU
lines
Carry-in
XOR TEMP
Step Action
Incrementer
PC
Register
file
Constant 4
MUX
A
ALU R
Instruction
decoder
IR
MDR
MAR
Step Action
sequence for
Instruction
Address
decoder and
lines
MAR control logic
instruction Data
lines
MDR
IR
architecture)
Z
Add (R3), R1
Hardwired control unit
T4 T6
T1
Figure 7.12. Generation of the Zin control signal for the processor in Figure 7.1.
Microprogrammed
Control Unit
Microprogrammed Control Unit Design
Starting and
branch address Condition
IR codes
generator
Clock PC
Control
store CW
Figure 7.6. Con trol sequence for execution of the instruction Add (R3),R1.
Microprogrammed Control Unit Design
MDRout
WMFC
MAR in
Select
PCout
R1out
R3out
Micro -
Read
PCin
R1 in
Z out
Add
End
IRin
Yin
instruction
Zin
1 0 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0
2 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0
3 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0
4 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0
5 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0
6 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1