Chapter 3 Microprogram Control Organisation
Chapter 3 Microprogram Control Organisation
•It is designed with minimum number of components and maximize the speed
of operation.
• Once the unit is constructed ,the only way to implement changes in control
unit is by redesigning the entire unit—therefore said to be HARDWIRED.
•The control memory stores a set of micro programs designed to implement the
behavior of the given instruction set.
•Each instruction causes the corresponding micro program to be fetched and its
Control Unit Implementation
Hardwired
Memory Instruction code
Sequential . Control
Status Signals
Logic Circuits . signals
2
•Microprogramming control unit design is more systematic organization.
Disadvantages:
3
Hardwired
Method 1 (Classical method): The classical method of sequential circuit design is used. It attempts to
minimize the amount of Hardware in particular, by using only log 2P flip-flops to realize a P-state circuit.
Method 2 (One-hot encoding): An approach that uses one flip-flop per state and is known as the one-hot
method. While expensive in terms flip-flops; this method simplifies Control Unit design and debugging.
Definitions:
Control signals
◦ Group of bits used to select paths in
multiplexers, decoders, arithmetic logic
units
Control variables
◦ Binary variables specify microoperations
Certain microoperations initiated while others
idle
Control word
◦ String of 1’s and 0’s represent control
variables
5
Definitions
Control memory
◦ Memory contains control words
Microinstructions
◦ Control words stored in control memory
◦ Specify control signals for execution of
microoperations
Microprogram routine
◦ Sequence of microinstructions
◦ Each computer instruction has its own
micro program routine to generate micro
operations that execute the instruction
Control memory
◦ Contains microprograms (set of
microinstructions)
◦ Microinstruction contains
Bits initiate microoperations
Bits determine address of next microinstruction
Control address register (CAR)
◦ Specifies address of next microinstruction
9
Microprogrammed Control
Organization
Next address generator (Micro program
sequencer)
◦ Determines address sequence for control
memory
10
Microprogrammed Control
Organization
Control data register (CDR)- or pipeline
register
◦ Holds microinstruction read from control
memory
◦ Allows execution of microoperations
specified by control word simultaneously
with generation of next microinstruction
Control unit can
External
input operate
Next Address without
Control CDR
Control
Generator CAR Memory word
(sequencer) (ROM)
14
Selection of address for
control memory
Instruction code
Mapping
logic
Subroutine
Register
Control Address Register (SBR)
(CAR)
Incrementer
select a status
bit
Microoperations
Branch address
15
The diagram shows control memory and the associated H/W needed for
selecting the next microinstruction address.
The diagram shows four different paths from which the CAR receives the
address.---Address sequencing capabilities
•The Incrementer increments the content of the CAR by one, to select the next
microinstruction in sequence.
•Branching is achieved by specifying the branch address in one of the fields of the
microinstruction.
•An external address is transferred into control memory via a mapping logic circuit.
17
Mapping of Instruction
Example
◦ Mapping 4-bit operation code to 7-bit
address
OP-codes of Instructions
ADD 0000
0001
AND 0010 Control
LDA
memory
Mapping bits 0 xxxx 00
Address
0 0000 00 ADD Routine
19
Don’t read
Microinstruction Fields
F1 Microoperation Symbol F2 Microoperation Symbol
000 None NOP 000 None NOP
001 AC AC + DR ADD 001 AC AC - DR SUB
010 AC 0 CLRAC 010 AC AC DR OR
011 AC AC + 1 INCAC 011 AC AC DR AND
100 AC DR DRTAC 100 DR M[AR] READ
101 AR DR(0-10) DRTAR 101 DR AC ACTDR
110 AR PC PCTAR 110 DR DR + 1 INCDR
111 M[AR] DR WRITE 111 DR(0-10) PC PCTDR
F3 Microoperation Symbol
000 None NOP
001 AC AC DR XOR
010 AC AC’ COM
011 AC shl AC SHL
100 AC shr AC SHR
101 PC PC + 1 INCPC
110 PC AR ARTPC
111 Reserved
20
Microinstruction Fields
Don’t read
BR Symbol Function
00 JMP CAR AD if condition = 1
CAR CAR + 1 if condition = 0
01 CALL CAR AD, SBR CAR + 1 if condition = 1
CAR CAR + 1 if condition = 0
10 RET CAR SBR (Return from subroutine)
11 MAP CAR(2-5) DR(11-14), CAR(0,1,6) 0
21
Fetch Routine
Fetch routine Don’t read
- Read instruction from memory
- Decode instruction and update PC
Microinstructions for fetch routine:
AR PC
DR M[AR], PC PC + 1
AR DR(0-10), CAR(2-5) DR(11-14), CAR(0,1,6) 0
22
Binary Microprogram Don’t read
L
I0 3 2 1 0
Input Load
I1 logic S1 MUX1 SBR
T S0
1 Incrementer
I MUX2 Test
S
Z Select
Clock CAR
Control memory
Microops CD BR AD
... ...
24
The control memory is included in the diagram to show the interaction between
the sequencer and memory.
There are two MUX’s in the circuit. The first MUX selects an address from one of four
Sources
1. The Incrementer increments the content of the CAR by one, to select the next
microinstruction in sequence.
4. An external address is transferred into control memory via a mapping logic circuit.
• The CD field of the microinstruction selects one of the status bits in the second MUX .
• If the bit selected is equal to 1,the T (test)variable is equal to 1;otherwise ,it is equal to 0
The T value together with two bits from the BR (branch) field go to an input logic circuit.
The input logic circuit has three inputs I0,I1 and T and three outputs S0,S1 and L.
The binary values of the two selection variables determine the path in the MUX.
The bit values for s1 & s0 are determined from the stated function and path in the
Multiplexer that establishes the required transfer .
The SBR register is loaded with the incremented value of CAR during a call
Micro instruction (BR=01) provided that the status bit condition is satisfied (T=1).
The truth table can be used to obtain the simplified boolean functions for the input logic.
27