DLCA Module 4 Introduction
DLCA Module 4 Introduction
• Directs the flow of data between the CPU and the other devices
Control unit operations
• When these control signals are generated by hardware, the control unit is
hardwired.
• When these control signals originate in data stored in a special unit and
constitute a program (on the small scale), the control unit is
microprogrammed.
Control unit – operations
• The execution of each sub cycle involves one or more shorter operations, that
is, micro-operations.
Program Execution
µ Op µ Op µ Op µ Op
Micro – operations
1. Address field of the instruction is transferred to the MAR. t3 : IR (Address) ← (MBR (Address))
2. It is used to fetch the address of the operand.
performs interface
Instruction Register
Control Bus
Flags Control Signals to Control Bus
Control
Unit
Control Signals from Control Bus
Clock
Control Signals
within CPU
Control Unit Inputs
Clock
• One micro-operation (or set of parallel micro-operations) per clock cycle
Instruction register
• For op-code & addressing mode for current instruction
• Determines which micro-operations to perform.
Flags
• Status of CPU &
• Results of previous ALU operations
Control signals from control bus
• Interrupts
• Acknowledgements
Control Unit – Outputs
Control signals within CPU
Control signals to Control Bus Three types of control signals are used :
Data Path PC
Instruction
Address
decoder and
lines
MAR control logic
MDR HAS Memory
ALU & all registers TWO bus
OUTPUTS
internal processor
Y
bus Constant 4 R0
Temporary register
Select MUX
Add
A B
This architecture assumes that - ALU Sub R( n - 1)
control
a. Each instruction comprises 4 bytes & is lines
ALU
Scratch pad
Rithesh Kini, Computer Engg Dept., TSEC
Executing an Instruction
1. Transfer a word of data from one processor register to another or to the ALU.
3. Fetch the contents of a given memory location and load them into a processor
register.
4. Store a word of data from a processor register into a given memory location.
Internal processor
bus
Riin
Register Transfers
Ri
Riout
Yin
Y
Constant 4
Select MUX
A B
ALU
Zin
Register R1 to R4
Figure: Input and output gating for the registers.
Rithesh Kini, Computer Engg Dept., TSEC
Performing an Arithmetic or Logic Operation
Internal processor
bus
Control signals
Suppose we want to add the contents
PC
of Register R1 to R2 and store the
Instruction
result in R3 Address
lines
decoder and
MAR control logic
Memory
Sequence of operations : bus
Select MUX
Signals whose names are given in any
step are activated for the duration of Add
A B
Sub R( n - 1)
clock cycle corresponding to that step. ALU
control ALU
lines
Carry-in
XOR TEMP
Z
Fetching a Word from Memory
Address into MAR; issue Read operation control signal; data into MDR.
MDR
MDR MDRin
inE
• To accommodate this, the processor waits until it receives an indication that the requested
operation has been completed (Memory-Function-Completed, MFC).
1. MAR ← [R1]
5. R2 ← [MDR]
Step 1 2 3
Simultaneously Address
2. WMFC, MDRinE Wait for the MFC response from the memory
MFC
3. MDRout, R2in
MDR out Load MDR from the memory bus R2 ← [MDR]
MOVE (R1), R2
• The contents of R2 should
be stored in the memory
address given by R1 MDR
1. R1out, MARin
2. R2out, MDRin , Write
MDR MDRin
3. MDRoutE, WMFC inE
Execution of a Complete Instruction
Add R1, (R3)
• 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
Internal processor
bus
R i in
Architecture used Ri
R i out
Y in
Constant 4
Select MUX
A B
ALU
Z in
Z out
Figure 7.2. Input and output gating for the registers in Figure 7.1.
Internal processor
bus
Instruction
Add R1, (R3) Address
decoder and
lines
MAR control logic
Step Action Memory
bus
MDR
1 PCout , MARin , Read,Select4,Add, Zin Data
lines IR
Opcode 2 Zout , PCin , WMFC
Fetch
3 MDRout , IRin Y
Constant 4 R0
4 R3out , MARin , Read
Execute 5 R1out , Yin , WMFC Select MUX
R1<-R1+(R3) 6 MDRout , SelectY,Add, Zin Add
A B
7 Zout , R1in , End ALU Sub R( n - 1)
control ALU
lines
Carry-in
XOR TEMP
Z
Figure7.6. Control sequence
for executionof the instruction Add (R3),R1.
Internal processor
bus
Instruction
Add R1, R2 Address
decoder and
lines
MAR control logic
Step Action Memory
bus
MDR
1 PCout , MARin , Read,Select4,Add, Zin Data
lines IR
Opcode 2 Zout , PCin , WMFC
Fetch 3 MDRout , IRin Y
Constant 4 R0
Z
Figure7.6. Control sequence
for executionof the instruction Add (R3),R1.
Execution of Branch Instructions
• A branch instruction replaces the Step Action
contents of PC with the branch target
1 PCout , MAR in , Read, Select4,Add, Z in
address, which is usually obtained by Fetch 2 Zout , PCin , Yin , WMF C
adding an offset X given in the branch 3 MDR out , IR in
instruction. 4 Offset-field-of-IRout, Add, Z in
5 Z out , PCin , End
• The offset X is usually the difference
between the branch target address
Figure 7.7. Control sequence for an unconditional
and the address immediately branch instruction.
• Conditional branch
Multiple-Bus Organization
Step Action
Step Action
Figure 7.6. Control sequence for execution of the instruction Add (R3),R1.
Overview
Control Word (CW) : a word whose individual bits represent control signal.
Microroutine : A sequence of CWs corresponding to the control sequence of
a machine instruction.