MICROPROGRAM CONTROL
A control word (CW) is a word whose individual bits represent various control signals Sequence of CWs correspond to the control sequence of machine instruction constitute microroutine Individual CW in the microroutine are referred as microinstruction
The microroutines for all instrution in the instruction in the instruction set of computer are stored in special memory called control store Control unit generate control signals for any instruction by sequentially reading CW of microroutine from control store
μPC – is used to read CW sequentially from control store
μPC is incremented in following situation New instruction-IR, μPC will be loaded with starting address of microroutine Branch instruction is encountered& branch condition is satisfied, μPC is loaded with branch address End microinstruction is encountered , μPC is loaded with address of first CW in microroutine
Sequence of control signals to be generated by the controller can be stored in special ROM also called control memory(CM) Output of CMDR provides desired control signals Control ROM is sequentially accessed by incrementing CMAR
MICROINSTRUCTION Assigning 1 bit to each control signal results in long microinstruction bcoz number of required signal is usually large Usually only few bits are set to 1 in any microinstrution Space is poorly used To avoid this,signals can be grouped such that mutually exclusive signals are placed in same group
MICROPROGRAM SEQUENCING microprogram is is easy to write bcoz software techniques is used But 2 disadvantages are encountered Separate microroutine for each instruction lead to large control store Execution time is longer bcoz it takes more time to carry out branch instruction
ENCODING OF CONTROL SIGNALS
Encoding of control signals Different formats of microinstruction depending on the encoding of control signals. Horizontal/vertical formats Functional encoding Resource encoding Direct versus indirect encoding
Horizontal/Vertical Formats
Vertical organization: Horizontal Format: Minimal encode scheme,in which many resource can be controlled with single microinstruction Large number of control fields Characterized by limited encoding and ability to express high degree of parallelism Vertical organization: Highly encode scheme ,specify small number of control function
limited number of control fields Characterized by high degree of encoding and limited ability to express parallelism
VERTICAL MICROINSTRUCTION FORMAT-CONTROL FIELDS
FUNCTIONAL ENCODING
Functional Encoding The micro operations executed in a data path of a CPU may be categorized under different function names such as Shift function, Add function, Logical functions, Input-Output, etc Multiple control bits associated to control a specified function
RESOURCE ENCODING
Resource encoding The CPU data path consists of a set of interconnected RTL components. Each of these components or a subset of such components viewed as a resource. If control signals associated with such a resource are mutually exclusive, then they can be encoded in a single control field.
Pg-352 2nd para pal chaudhuri book
DIRECT Vs INDIRECT ENCODING
Direct->control field directly generates control signals via decoder Indirect->control field A serves as a field decode logic which further steers.decode first level decode logic of another field(B) Indirect,which have different types of control information from same control field
MICROINSTRUCTION WITH NEXT ADDRESS FIELD
μAR-Microinstruction Address Register Μar which is loaded from next address field Next address bits are via OR gates to μAR,so that address can be modified on basis of the data in IR,external i/p,condition codes Decoding circuit generates starting address of given microroutine in basis if OP code in IR
PREFETCHING MICROINSTRUCTION Drawback of microprogram control leads to slower operating speed bcoz of the time take to fetch microinstruction Faster operation is achieved if nect microinstruction is prefetched while the current one is being executed
EMULATION REFER hamacher book
Micro instruction execution Two basic actions Generating next microinstruction address and fetching micro program instruction from control memory by this address Executing the micro operations controlled by different signals encoded in various control fields of the microinstruction Decoding and applying control signals on the CPU data path Executing the intended micro operations controlled by the signals Storing the output in the destination register specified in the micro operation on the CPU data path
Mono phase and Poly phase operation In a micro operation cycle, a micro program control unit implements the sequence of actions under 4 different phases. If the micro instruction cycle is controlled by a single clock pulse which synchronizes all the control signals ,then the mode is termed as mono phase operation If each of the phases is controlled by a different phase of a clock ,the mode is referred as poly phase operation
Micro-programmed Control Unit -Advantages 1. A micro-programmed control unit is flexible and allows designers to incorporate new and more powerful instructions as VLSI technology increases the available chip area for the CPU 2. allows any design errors discovered during the prototyping stage to be removed
Microprogrammed Control Unit - Disadvantages 1. requires several clock cycles to execute each instruction, due to the access time of the microprogram memory 2. Occupies a large portion (typically 55%) of the CPU chip area