control Unit
control Unit
•Control Memoryy
•Addressing sequencing
•Computer configuration
•Microinstruction
Mi i i fformat
•Symbolic microinstructions
•Symbolic microprogram
•Control unit operation
•Design
Design of control unit
Control Unit
Control Memory
Control Unit
Initiate sequences of microoperations
groups of bits that select the paths in multiplexers, decoders, and arithmetic logic units
Hardwired Control :
The control logic is implemented with gates, F/Fs, decoders, and other digital circuits
Microprogrammed
p g Control :
The control information is stored in a control memory, and the control memory is
programmed to initiate the required sequence of microoperations
+ Any required change can be done by updating the microprogram in control memory,
- Slow operation
Control Word
The control variables at any given time can be represented by a string of 1’s and 0’s.
External Control
Next-address Control Control Control word
input generator address memory data
((sequencer)
q ) g
register ((ROM)) g
register
Next-address information
Control Memory
»A memory is part of a control unit :
»Computer Memory (employs a microprogrammed control unit)
Sequencer
»Determine the address sequence that is read from control memory
»Next address of the next microinstruction can be specified several way
depending on the sequencer input.
Mapping Mapping
Subroutine
4 different paths regiser
(SBR)
1) Incrementer Clock
Control address register
(CAR)
2) Branch address from
control memory Incrementer
3) Mapping Logic
4) SBR : Subroutine Register
SBR : Subroutine Register Control memory
stored in SBR
Sequencer (Microprogram Sequencer)
A Microprogram Control Unit that determines
the Microinstruction Address to be executed
in the next clock cycle
- In-line Sequencing
- Branch
- Conditional Branch
- Subroutine
- Loop
- Instruction OP-code mapping
ADDRESS SEQUENCING
Instruction code
Mapping
logic
Subroutine
register
Control address register (SBR)
(CAR)
Incrementer
select a status
bit
Microoperations
Branch address
Increment
MUX
Control memory
...
Status bits
(condition)
Next address
Conditional Branch
If Condition is true, then Branch (address from
the next address field of the current microinstruction)
else Fall Through
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 multiplexer to 1
MAPPING OF INSTRUCTIONS
Di t Mapping
Direct M i Address
OP-codes of Instructions 0000 ADD Routine
0001 AND Routine
ADD 0000
. 0010 LDA Routine
AND 0001 . 0011 STA Routine
LDA 0010 . 0100 BUN Routine
STA 0011
BUN 0100 Control
Storage
Mapping
Bits 10 xxxx 010
Address
10 0000 010 ADD Routine
BUN-Branch Unconditionally
10 0001 010 AND Routine
Machine OP-code
OP d
Instruction 1 0 1 1 Address
Mapping bits 0 x x x x 0 0
Microinstruction
address 0 1 0 1 1 0 0
Mapping
g function implemented by
y ROM or PLA
OP-code
Mapping memory
(ROM or PLA)
Control Memory
Computer Configuration
Once the configuration
g of a computer
p and its microprogrammed
p g control unit is established , the
Designer’s task is to generate the microcode for control memory.
MUX
10 0
AR
Address Memory
10 0 2048 x 16
PC
MUX
15 0
6 0 6 0 DR
SBR CAR
Instruction format
15 14 11 10 0
I p
Opcode Address
Microinstruction Format
3 3 3 2 2 7
F1 F2 F3 CD BR AD
F3 Microoperation Symbol
000 None NOP
001 AC AC DR XOR
010 AC AC’ COM
011 AC shl AC SHL
DRTAC-stands
DRTAC stands for a transfer from DR to AC
100 AC shr AC SHR
101 PC PC + 1 INCPC
110 PC AR ARTPC
111 Reserved
MICROINSTRUCTION FIELD DESCRIPTIONS ‐ CD, BR
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
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.
Sample Format
five fields: label; micro-ops; CD; BR; AD
ORG 4
BRANCH: NOP S JMP OVER
NOP U JMP FETCH
OVER: NOP I CALL INDRCT
ARTPC U JMP FETCH
ORG 8
STORE: NOP I CALL INDRCT
ACTDR U JMP NEXT
WRITE U JMP FETCH
ORG 12
EXCHANGE: NOP I CALL INDRCT
READ U JMP NEXT
ACTDR, DRTAC U JMP NEXT
WRITE U JMP FETCH
ORG 64
FETCH: PCTAR U JMP NEXT
READ, INCPC U JMP NEXT
DRTAR U MAP
INDRCT: READ U JMP NEXT
DRTAR U RET
BINARY MICROPROGRAM
Address Binary Microinstruction
Micro Routine Decimal Binary F1 F2 F3 CD BR AD
ADD 0 0000000 000 000 000 01 01 1000011
1 0000001 000 100 000 00 00 0000010
2 0000010 001 000 000 00 00 1000000
3 0000011 000 000 000 00 00 1000000
BRANCH 4 0000100 000 000 000 10 00 0000110
5 0000101 000 000 000 00 00 1000000
6 0000110 000 000 000 01 01 1000011
7 0000111 000 000 110 00 00 1000000
STORE 8 0001000 000 000 000 01 01 1000011
9 0001001 000 101 000 00 00 0001010
10 0001010 111 000 000 00 00 1000000
11 0001011 000 000 000 00 00 1000000
EXCHANGE 12 0001100 000 000 000 01 01 1000011
13 0001101 001 000 000 00 00 0001110
14 0001110 100 101 000 00 00 0001111
15 0001111 111 000 000 00 00 1000000
microoperation fields
F1 F2 F3
AND
ADD AC
Arithmetic
logic and DR
DRTAC shift unit
PCTAR
DRTAR
From From
PC DR(0-10) Load
AC
Select 0 1
Multiplexers
Load Clock
AR
Implementation of Control Unit
Microprogram
M Control Data
e
m
o IR Status F/Fs
r
y
C Control C
Next Address Storage C
S S D P CPU
Generation A (-program D
Logic s
R memory) R }
MICROPROGRAM SEQUENCER
‐ NEXT MICROINSTRUCTION ADDRESS LOGIC ‐
Branch CALL Address
Branch,
External RETURN form Subroutine
(MAP)
In-Line
S1S0 Address Source
00 CAR + 1,, In-Line 3 2 1 0
S1 MUX1 L
01 SBR RETURN SBR Subroutine
S0 CALL
10 CS(AD), Branch or CALL Address
11 MAP source
selection
Incrementer
Clock CAR
Control Storage
MUX-1 selects an address from one of four sources and routes it into a CAR
CD Field of CS
Input Logic
I0I1T Meaning
g Source of Address S1S0 L
S0 = I0
S1 = I0I1 + I0’T
T
L = I0’I1T
Microprogram sequencer for a control memory
External
(MAP)
L
I0 3 2 1 0
Input Load
L d
I1
Logic S1 MUX1 SBR
T S0
1 Incrementer
I MUX2 Test
S
Z Select
Clock CAR
Control memory
Microops CD BR AD
... ...
MICROINSTRUCTION FORMAT
Information in a Microinstruction
- Control Information
- Sequencing Information
- Constant
Information which is useful when feeding into the system
Field Encoding
g