04 Chap 07 Microprogrammed Control
04 Chap 07 Microprogrammed Control
1
Reference: http://ecl.incheon.ac.kr/
We will study …
2
Control Unit
3
Comparison of Control Unit
Implementation
Control Unit Implementation
Hardwired Control Unit (Combinational Logic Circuits)
4
Terminology – (1)
Microprogram
Program stored in control memory that generates all the
control signals required to execute the instruction set
correctly
Consists of microinstructions
Microinstruction
Contains a control word and a sequencing word
Control Word - All the control information required for one
clock cycle
Sequencing Word - Information needed to decide the next
microinstruction address
Vocabulary to write a microprogram
5
Terminology – (2)
Control Memory (CM)
Storage in the microprogrammed control unit to store the
microprogram
ROM
6
Terminology – (3)
Dynamic Microprogramming
Computer system whose control unit is implemented with a
microprogram in Writable CM
Microprogram can be changed by a systems programmer,
but not an occasional user.
7
Terminology – (4)
The general configuration of a microprogrammed
control unit is demonstrated in the following block
diagram
9
Microinstruction Sequencing (1)
10
Microinstruction Sequencing (2)
11
Microinstruction Sequencing (3)
Circuit to determine the Microinstruction Address:
Clock
12
Conditional Branching
Conditional Branch
If Condition is true, then
Branch (address from
the next address field of
the current
microinstruction)
else Fall Through
(address register is
incremented)
Conditions to test:
O(overflow),
N(negative), Z(zero),
C(carry), etc.
Unconditional Branch
Fixing the value of one
status bit at the input of
the MUX to 1 13
Mapping of Instructions to
Microroutines (1)
Assume that the op-code has 4 bits (gives 16 distinct
instructions)
Assume that the control memory has 128 words
(needs 7 bits address)
For each operation code there exists a microprogram
routine in control memory that executes the
instruction.
Thus, we need one simple mapping process that
converts the 4-bit operation code to a 7-bit address
for control memory
14
Mapping of Instructions to
Microroutines (2)
Mapping from the opcode of an instruction to the
address of the microinstruction, which is the starting
microinstruction of its execution microprogram
(provides each computer instruction a microprogram
routine with a capacity of four microinstructions)
15
Mapping of Instructions to
Microroutines (3)
Generalization: Mapping function implemented by
ROM
Input: opcode
Output: CM address
16
Microprogram Example
Computer HW Configuration (similar but not identical to Chap 5)
Two memory units:
Main memory (2048x16)
Instructions and Data
Control memory (128x20)
Microprogram
4 registers for processing
PC, AR, DR, AC
2 registers for CU
CAR, SBR
Info transfer through MUXs
AR recv from PC and DR
PC recv from AR
DR recv from Mem, PC, AC
Arith, logic, and shift unit
Process data in DR and AC
Put result in AC
Data read from mem can go
only to DR
Data written to mem comes
17
only from DR
Machine Instruction Format
Microinstruction Format
18
Microinstruction field – F1, F2, F3, CD,
BR
19
Symbolic Microinstructions
Symbols are used in microinstructions as in assembly language
A symbolic microprogram can be translated into its binary equivalent by a
microprogram assembler.
Format
five fields : label; micro-ops; CD; BR; AD
S : sign of AC -- AC(15)
BR : one of {JMP,CALL,RET,MAP}
AD : one of {symbolic address, NEXT, empty}
21
Symbolic Microprogram
Control Memory : 128 20-bit words
The first 64 words: Routines for the 16 machine
instructions
The last 64 words: Used for other purpose (e.g.,
fetch routine and other subroutines)
22
Symbolic Microprogram
23
Binary Microprogram
25
Microprogram Sequencer – (1)
26
Microprogram Sequencer – (2)
MUX1 selects an address from one of four sources and routes it
into a CAR
In-line sequencing → CAR + 1
Branch, or Subroutine call → CM(AD)
Return from Subroutine → Output of SBR
New machine instruction → MAP
27
Microprogram Sequencer – (3)
28
Microprogram Sequencer – (4)
Condition BR Input Mean Src of Addr MUX1 Ld SBR
Field I1 I0 T S1 S0 L
and Branch
0 0 0 0 0 In-line CAR + 1 0 0 0
Control:
0 0 0 0 1 JMP CM(AD) 0 1 0
S1 = I 1 0 1 0 1 0 In-line CAR + 1 0 0 0
S0 = I1I0 + I1’T 0 1 0 1 1 CALL CM(AD) and 0 1 1
L = I1’I0T SBR ← CAR+1
1 0 1 0 x RET SBR 1 0 0
1 1 1 1 x MAP DR(11-14) 1 1 0
29