Академический Документы
Профессиональный Документы
Культура Документы
Overview
The control unit initiates the sequences of microoperations. Every system has a finite number of microinstruction types. Complexity of the digital system is derived from the no. of sequences of microoperations that are performed. The control function which specifies a microoperation is a binary variable. n a bus organised system! the control signals that specify microoperations are groups of bits that select the paths in multiplexers! decoders and "#$ c%ts.
Overview
The control variables at any given time can be represented by a string of &s and 's called a control word. Control words can be programmed to perform various operations on system components. " control unit whose binary control variables are stored in memory is called a Microprogrammed Control (nit.
Terminology
Microprogram
Program stored in 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
Terminology
Control Memory (CM)
Storage in the microprogrammed control unit to store the microprogram ROM
ynamic Microprogramming
Computer system whose control unit is implemented with a microprogram in Writable CM Microprogram can be changed by a systems programmer or a user
Microprogram e!"encer
The )ext "ddress *enerator is also called the Microprogram sequencer. +etermines the address sequence to be read from control memory Many ways of specifying addresses depending on sequencer inputs. ,unctions of sequencer include
ncrementing control register by one $oad an address from control memory into C"Transfer an external address $oad an initial address to start the control operations.
Control Memory
The control memory holds a fixed microprogram. The microprogram consists of microinstructions that specify various control signals for execution of register microoperations. Each machine instruction in main memory initiates a series of microinstructions in control memory. These microinstructions generate the microoperations to
,etch the instruction from main memory Evaluate the effective address Execute the operation specified by the instruction -eturn control to fetch phase to repeat the cycle for next instruction.
An example Microinstruction
MDR out
MARin
Micro instruction 1 2 3 4 5 6 7
WMFC 0 1 0 0 1 0 0
Select
PCout
Read
R1out
R3out 0 0 0 1 0 0 0
PCin
Add
IRin
0 1 0 0 0 0 0
1 0 0 0 0 0 0
1 0 0 1 0 0 0
1 0 0 1 0 0 0
0 0 1 0 0 1 0
0 0 1 0 0 0 0
0 1 0 0 1 0 0
1 0 0 0 0 0 0
1 0 0 0 0 1 0
1 0 0 0 0 1 0
Zout
0 1 0 0 0 0 1
0 0 0 0 1 0 0
R1in
0 0 0 0 0 0 1
End 0 0 0 0 0 0 1
Yin
Zin
"$ro"tines
Microinstructions are stored in control memory in groups! each group specifying a routine. .ubroutines are 3rograms used by other routines to accomplish a particular tas%. " subroutine can be called from any point within the main body of the microprogram. .ame subroutine can be called from many microprograms. 2elps in reducing si6e of microprograms. )eed to store the return address during the subroutine call. ncremented o0p from C"- goes to a .ubroutine -egister .7and execution branches to beginning of subroutine. .7- becomes source of return address.
Instr"ction %ormat
15 14 11 10 0
5pcode
"ddress
+escription "C "C 8 M 9 E" : f ;"C<'= then ;3C E" = M 9 E" : "C "C M 9 E" :! M 9 E" : "C
Address e!"encing
When computer is switched on !A" is loaded with an initial address pointing to #irst microinstruction that acti$ates the #etch routine% &etch routine is se'uenced by incrementing the !A" through the rest o# microinstructions% At end o# #etch routine the instruction is in ("% )he address o# operand needs to be calculated% *its in machine instruction speci#y $arious addressing modes% Mode bits decide the the conditions which chose the branch microinstruction which is used to calculate e##ecti$e address%
Address e!"encing
At end o# address calculation routine the address o# operand is in MA"% Microinstructions to execute the instruction #etched #rom memory need to be generated% Microoperation steps generated in process registers depend on opcode% +ach instruction has its own microprogram routine stored in a gi$en location o# control memory%
)rans#ormation #rom the instruction code bits to an address in control memory where the routine is located is called mapping process%
Address e!"encing
A mapping procedure is a rule that trans#orms the instruction code into a control memory address% ,nce the re'uired routine is reached the microinstruction that execute the instruction may be se'uenced by incrementing the !A"% Microprograms that use subroutines re'uire an external register #or storing the return address% At end o# instruction execution control returns to #etch routine by executing an unconditional branch microinstruction to #irst address o# #etch routine%
Address e!"encing
Address se'uencing capabilities re'uired in control memory are
Incrementing of the control address register #CA$% &nconditional and conditional branches A ma ing rocess from the bits of the machine instr to an address for C' A facility for subroutine call and return
&RANC'ING (
PECIAL &IT
The status conditions are special bits in the system that provide parameter information such as the carry4out of an adder! the sign bit of a number! the mode bits of an instruction! and input or output status conditions. nformation in these bits can be tested and actions initiated based on their condition? whether their value is & or '. The status bits! together with the field in the microinstruction that specifies a branch address! control the conditional branch decisions generated in the branch logic.
&RANC'ING LOGIC
The simplest way is to test the specified condition and branch to the indicated address if the condition is met@ otherwise! the address register is incremented. This can be implemented with a multiplexer.
.uppose that there are eight status bit conditions in the system. Three bits in the microinstruction are used to specify any one of eight status bit conditions. These three bits provide the selection variables for the multiplexer. f the selected status bit is in the & state! the output of the multiplexer is &@ otherwise! it is '. " & output in the multiplexer generates a control signal to transfer the branch address from the microinstruction into the control address register. " ' output in the multiplexer causes the address register to be incremented.
)NCONDITIONAL &RANC'ING
"n unconditional branch microinstruction can be implemented by loading the branch address from control memory into the control address register. This can be accomplished by fixing the value of one status bit at the input of the multiplexer! so it is always equal to &. " reference to this bit by the status bit select lines from control memory causes the branch address to be loaded into the control address register unconditionally.
MAPPING
" special type of branch exists when a microinstruction specifies a branch to the first word in control memory where a microprogram routine for an instruction is located. The status bits for this type of branch are the bits in the operation code part of the instruction.
7 bits that can specify upto 128 distinct words in the control memory
)&RO)TINE
" subroutine can be called from any point within the main body of the microprogram. Microprograms that use subroutines must have a provision for storing the return address during a subroutine call and restoring the address during a subroutine return. This may be accomplished by placing the incremented output from the control address register into a subroutine register and branching to the beginning of the subroutine. The subroutine register can then become the source for transferring the address for the return to the main routine. The best way to structure a register file that stores addresses for subroutines is to organi6e the registers in a last4in! first4out ;$ ,5= stac%.
Two Memories
Main memory Control Memory 4 registers associated to processor unit PC ! ccumulator C "! 2 registers associated to C#
M%&
C !
(
, S/R
, CAR
'.
$ubroutine !egister $%! Transfer of info in registers in processor done through mu& '$# performs microop with data from C and "! and places result in C
Memory recei(es address from ! and "ata written to or read from memory goes to "!
Instr"ction %ormat
15 14 11 10 0
5pcode
"ddress
+escription "C "C 8 M 9 E" : f ;"C<'= then ;3C E" = M 9 E" : "C "C M 9 E" :! M 9 E" : "C
Microinstr"ction
MICROINSTRUCTION ORMAT
A ,& A ,B A ,A B C+ B 7C "+
1! "! # $ Microo%er&tion field ' s%ecify microo%er&tions C( $ Condition for )r&nchin* ' select st&t+s )it conditions ,R $ ,r&nch field ' s%ecify the ty%e of )r&nch to )e +sed A( $ Address field ' cont&in & )r&nch &ddress
Condition %ield
/ &its
C+ D '' always finds condition as T-(E. 1hen used in conjunction with 7-;7ranch= field it provides an unconditional branch operation. ndirect bit is available from bit &E of +- after an instruction is read from memory. .ign bit of "C provides next status bit. Fero value F is a binary variable whose value is equal to & if all bits in "C are aero
C (( (' '( '' Condition Always = ' R('.) AC('.) AC = ( Symbol % I S > Comments %nconditional branch Indirect address bit Sign bit of AC >ero <alue in AC
0unction CAR 2 A if condition = ' CAR 2 CAR 3 ' if condition = ( CAR 2 A @ S/R 2 CAR 3 ' if condition = ' CAR 2 CAR 3 ' if condition = ( CAR 2 S/R (Return from subroutine) CAR()4.) 2 R(''4'*)@ CAR((@'@,) 2 (
Microprogram e!"encer
7asic components of microprogrammed control unit
Control memory C%t that selects the next address G microprogram sequencer
M. presents an address to the control memory so that a microinstruction may be read and executed. " typical sequencer has a subroutine register stac% about H4I levels deep so that a no. of subroutines can be active simultaneously.
$+ and $1 select one of the src addresses for C ! ' enables the load ,-p in $%!