Control Unit - Lec 2
Control Unit - Lec 2
Instruction Decoder
Master
clock
0 1 2 3 64 255
T1
T2
T3
Timing
Generator
T4 Control Matrix
Tn
Sequenced
control
RESET signals
Condition codes
The timing generator generates pulses at corresponding time slots as
shown below
Master clock
T1 t
T2 t
t
T3
t
Similarly all the timing signals are generated up to Tn. Then start
again from T1. Same thing repeats in a cyclic manner.
Now consider the fetch cycle.
Control signals to activate are listed below according to the order
T1 (PC)outA
T2 (MAR)inA
T3 (MAR)out
T4 Read
T5 (MBR)in
T6 (MBR)outD
T7
(IR)inD
T8
(PC)inc
The above control signals are activated in the given order.
For that timing generator outputs are hard wired to an array of AND
gates.
Selected Line corresponding to the OPcode -64 line LOAD A
‘1’
(PC)outA
T1
(MAR)inA
T2
(MAR)out
T3
Read
T4
(MBR)in
T5
(MBR)outD
T6
(IR)inD
T7
(PC)inc
T8
• Instruction decoder select a line out of 255
according to the Opcode part (64th line for
LOAD A OPcode).
(MAR)out
T11
FETCH cycle T3
(MAR)in A
I t is possible to carry out some operations in parallel without affecting
the other. E.g. put ACC to Bus D & IR to Bus A.
So that the time taken to complete the execution of an instruction can
be reduced. Consider the execution cycle of STORE A,(address)
‘1’
(IR)outA / (ACC)outD
T9
(MAR)inA / (MBR)inD
T10
(MAR)out / (MBR)out
T11
Write
T12 RESET
T13
• Disadvantage of hard wired CU is that it
makes the instruction set fixed and no
modifications or enhancements to the
instruction set is possible after it is
manufactured.
• However hard wired control units can be
operated at high clock rates and more
suitable for high speed CPUs.
Micro Program Control Unit
(IR) OPCODE OPERAND
LOAD
RESET
-PC
- Program memory - IR
Control
(Control memory) signals
Instruction
Decoder
The control memory is -ins1
divided in to number of -ins2
micro instruction segments. Fragment
Each segment contains 1
number of micro -insN
instructions.
Fragment
There is a micro instruction
2
fragment corresponding to
fetch cycle. usually the first
one, fragnent1. Similarly Fragment
there is a micro instruction 3
fragment corresponding for
each execution cycle , of
the machine code
instruction cycle.
ICSS Load with fragment 1(fetch cycle) starting address
ICSS -PC
- Program memory - IR
Increment -PC
- Program memory - IR
Increment -PC
- Program memory - IR
Increment -PC
………..
Until the end of the fetch cycle.
Activate LOAD signal
ICSS load with starting address of the execution fragment
ICSS -PC
- Program memory - IR
Increment -PC
- Program memory - IR
Increment -PC
- Program memory - IR
Increment -PC
…………………………..
Until the end of the Execution Cycle.
Activate RESET signal
Continue the Same cycle again for the
next instruction
…………………….
The instruction counter source selector (ICSS) provides
the starting address of the micro instruction fragment
corresponding with the current machine code instruction.
The micro program counter starts counting from this
starting address.
The micro instruction currently being executed, is held
in the micro instruction register,and is decoded by the
instruction decoder for final control outputs.
• At he end of each fetch cycle micro
instruction program counter is loaded by
the output of the ICSS at the end of each
execution cycle the -PC is reset, initiating
the next fetch cycle.
• Micro program CU can be implemented in
three different ways.
1. Horizontal microprogramming
2. Vertical microprogramming
3. Combined microprogramming
Horizontal microprogramming
1 0 0 0 0 0 0 0 0 0 1 0 0 0
2 1 0 0 0 0 0 0 0 0 0 0 0 0
3 0 1 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 1 0 0 0 0 0 0
5 0 0 0 1 0 0 0 0 0 0 0 0 0
6 0 0 0 0 1 0 0 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 0 1 0 0
8 0 0 0 0 0 0 0 0 1 0 0 0 0
9 0 0 0 0 0 0 0 0 0 0 0 1 0
In horizontal micro programming an instruction decoder is not
necessary inside the control unit. Control signals are straight away
derived from the micro instruction register.
Each out put of micro instruction register correspond to a control
signal output.
In horizontal microprogramming the length of the micro
instruction is relatively large.(If there are 200 control signals to be
generated, each micro instruction will be 200 bit long). This is
considered to be a disadvantage of the horizontal
microprogramming.
However this technique supports the parallel operation of
controls. If parallel operation of controls are provided a micro
instruction can contain more than a single one ‘1’.
Further advantage of this technique is that it does not require an
instruction decoder
Draw the control memory for the execution cycle of
ADD A,(address) instruction
Draw the control memory for the execution cycle of
STORE A,(address) instruction
Vertical microprogramming
This technique is an effort to reduce the micro instruction length.
There by reducing the complexity of micro IR and the control
memory.
Ex assume that there are 256 controls 7 each micro instruction
activates a single control out of the 256 controls.
Since 256 = 28 an 8 bit coded micro instruction can be used this
technique is known as Vertical micro programming and an instruction
decoder is required to get the final control outputs.
The advantages of vertical micro programming are the
reduced micro instruction length & control memory size.
The disadvantages are Parallel operation of controls is not
possible. Additional instruction decoder is required. Due to the
additional instruction decoder the speed of the control unit can be
slower compared to horizontal micro programming.
Combined microprogramming
This is a hybrid version of horizontal and vertical micro programming.
This technique tries to reduce the micro instruction length, while
allowing parallel operation of controls.
In this technique the control signals are grouped in such a way so that
parallel operation of controls is not required within a group.
e.g. group1 Bus D controls (ACC)out D (R0)out D (TEMP)out D)…
group2 Bus D out put controls (ACC)in D (R0)in D …
group3 ALU controls.