Documente Academic
Documente Profesional
Documente Cultură
CONTROL
1. Address Sequencing (4.2)
Routine
Subroutine
Subroutine Register
Conditional Branching
Mapping of Instruction with example
Address Sequencing
2. Micro programmed example (4.2)
Micro Instruction Format
3. Design and Implementation of Control Unit (4.3)
Decoding of Micro operations
Micro program Sequencer
1
4.2 Address Sequencing
• Routine
– Group of microinstructions stored in control memory
– Each computer instruction has its own micro
program routine to generate micro operations that
execute the instruction
• Subroutine
-Sequence of micro instructions used by other
routines to accomplish particular task
- Example subroutine to generate effective
address of operand for memory reference
instructions.
• Subroutine Register (SBR)
- Stores return address during subroutine call
2
4.2 Address Sequencing
Conditional Branching (Branch Logic)
• Provides decision making capabilities in CU
• Branching from one routine to another depends on status bit
conditions
• Status bits provide parameter info such as
– Carry-out of adder
– Sign bit of number
– Mode bits of instruction
• Info in status bits can be tested and actions initiated based on
their conditions: 1 or 0
• The status bits together with the field in the micro instruction
that specifies a branch address, control the conditional branch
decisions generated in the branch logic
• Unconditional branch
– An unconditional branch micro instruction can be implemented by
loading the branch address from control memory into the control
3
address register (CAR)
4.2 Address Sequencing
Mapping of instructions with example
• Each computer instruction has its own
micro program routine stored in a given
location of the control memory
• Mapping
– Transformation from instruction code bits to
address in control memory where routine is
located is called mapping.
4
4.2 Address Sequencing
Example of Mapping
– Mapping 4-bit operation code to 7-bit address
OP-codes of Instructions
ADD 0000
AND 0001
LDA 0010 Control
memory
Mapping bits 0 xxxx 00 Address
0 0000 00 ADD Routine
5
4.2 Address Sequencing
Address Sequencing - Selection of address for
control memory
• Address sequencing capabilities required in
control unit
– Incrementing CAR
– Unconditional or conditional branch, depending on
status bit conditions
– Mapping from bits of instruction to address for control
memory
– Facility for subroutine call and return
6
4.2 Address Sequencing
Instruction code
Mapping
logic
Incrementer
select a status
bit
Microoperations
Branch address
Multiplexer Inputs
1. CAR Increment
2. JMP / Call
3. Mapping
4. Subroutine Return
4.2 Microprogram Example
MUX
10 0
Computer AR
Configuration Address Memory
10 0 2048 x 16
PC
MUX
15 0
6 0 6 0 DR
SBR CAR
Microinstruction Format
3 3 3 2 2 7
F1 F2 F3 CD BR AD
9
4.2 Micro Instruction Format
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
10
4.2 Micro Instruction Format
Microinstruction Fields
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
11
4.2 Micro Instruction Format
Microinstruction Fields
PC PC + 1 with F3=101
12
Symbolic Microinstruction
Sample Format Label: Micro-ops CD BR AD
CD one of {U, I, S, Z}
U: Unconditional Branch
I: Indirect address bit
S: Sign of AC
Z: Zero value in AC
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
14
4.3 Design and Implementation of Control Unit
Decoding of micro operation Fields
Decoding of Microinstruction Fields :
16
4.3 Microprogram Sequencer
External
(MAP)
L
I 3 2 1 0
Input Load
I0 S1 MUX1 SBR
logic
T1 S0
1 Incrementer
I MUX2 Test
S
Z Select
Clock CAR
Control memory
Microops CD BR AD
... ...
MUX1 1Inputs
0. CAR (Increment)
1. JMP / Call
2. Mapping
3. Subroutine Return
4. 3 Input Logic for Microprogram
Sequencer
1 L L(load SBR with PC) for
From I MUX2 Test
CPU S T subroutine Call
BR field Input
Z Select I0 logic S0 for next address
of CM I1
S1 selection
CD Field of CM
Input Logic
I1 I0 T Meaning Source of Address S1 S0 L
S1 = I1
S0 = I0I1 + I1’T
L = I 1’ I0T