Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
System Bus
Registers
5. Microprogrammed Control
ALU
Address Bus
Control Bus
Data Bus
IR
PC
Control
Unit
Internal
CPU Bus
Instruction Execution
Let’s Have a Look into the CPU (cont’d)
• The CPU executes a sequence of instructions.
• The execution of an instruction is organized as an
instruction cycle: it is performed as a succession of
several steps;
The question that has to be answered:
Execute
To perform this control, that’s instruction
the task of the Control Unit
Status&Cond.
or several control signals have to be issued; they allow
the corresponding data transfer and/or computation to
Flags
PCout
Control be performed.
unit
MARin
Examples:
MAR IRin
System bus
Clock
MBRin a) signals for transferring content of register R0 to R1:
IR R0out, R1in
MBR
IRout b) signals for adding content of Y to that of R0 (result in Z):
R0out, Add, Zin
MBRout R0in
instruction:
ADD R1,R3 R1 ← R1 + R3 instruction:
BR target unconditional branch (with
control steps and control signals: relative addressing - see lect. 5)
PC←PC+1
fetch ins.
1 PCout, MARin, Read, Clear Y, Carry-in, Add, Zin control steps and control signals:
2 Zout, PCin
PC←PC+1
fetch ins.
Status&Cond.
microoperations to be executed.
Flags
Control Control signals
unit on system bus
• The control unit is driven by the processor clock.
Signals from
The signals to be generated at a certain moment system bus
depend on:
- the actual step to be executed;
- the condition and status flags of the processor; Clock
- the actual instruction executed;
- external signals received on the system bus
(e.g. interrupt signals).
Hardwired Control
Hardwired Control (cont’d)
• In this case, the control unit is a combinatorial
circuit; it gets a set of inputs (from IR, flags, clock,
system bus) and transforms them into a set of
control signals. Generation of signal Zin:
- first step of all instructions (fetch instruction)
IR - step 5 of ADD with register addressing
- step 5 of BR
Instruction - step 6 of ADD with register-indirect addressing
decoder - -------------------
I1 I2 I3 In
Zin = T1 + T5 ⋅ (ADDreg + BR) + T6 ⋅ ADDreg_ind + . . .
Status&Cond.
Flags
T1
Generation of signal End:
and decoder
Reset Step counter
- step 6 of BR
Tn - -------------------
Control signals
Control signals
Hardwired Control (cont’d)
Status&Cond.
Flags
Control
unit
• Hardwired control provides highest speed.
Clock
• RISCs are implemented with hardwired control.
IR
ALU
MBR
MAR
System bus
Control signals
The control unit is implemented just like another Signals from
very simple CPU, inside the CPU, executing system bus
microroutines stored in the control store.
Control store
Addr-fetch
---------------------
--------------------- Fetch A_fetch PCout, MARin, Read, Clear Y, Carry-in, Add, Zin
end-fetch instruction
+1 Zout, PCin
Addr-interr. +2 MBRout, IRin
---------------------
--------------------- Interrupt
+3 end-fetch this produces the jump to A_CB
branch addr-fetch routine
--------------
Addr-instr0
--------------------- A_CB branch to A_CB+2 if N set
--------------------- Execute
instr. code 0 +1 end
end
Addr-instr1 +2 PCout, Yin
---------------------
Execute +3 (displacement-field)IRout, Add, Zin
---------------------
end instr. code 1 +4 Zout, PCin
+5 end
Addr-instrn
---------------------
Execute
---------------------
instr. code n
end • The microroutines contain, beside CWs, also
branches which have to be interpreted by the
microprogrammed controller.
• The sequencer is controlling the right execution
• The control store contains the microprogram sequence of microinstructions. The sequencer is a
(sometimes called firmware). small control unit of the control unit.
Datorarkitektur I Fö 11- 19
Summary