Microprogrammed Control - Microprogram Control Organisation

Microprogrammed Control 

In hardwired control , we saw how all the control signals required inside the CPU can be generated using a state counter and a PLA circuit.

There is an alternative approach by which the control signals required inside the CPU can be generated . This alternative approach is known as microprogrammed control unit.

In microprogrammed control unit , the logic of the control unit is specified by a microprogram.A
microprogram consists of a sequence of instructions in a microprogramming language. These are very instructions that specify microoperations.

A microprogrammed control unit is a relatively simple logic circuit that is capable of (1) sequencing through microinstructions and (2) generating control signals to execute each microinstruction.
      The concept of microprogram is similar to computer program. In computer program the complete instructions of the program is stored in main memory and during execution it fetches the instructions from main memory one after another. The sequence of instruction fetch is controlled by program counter (PC) .
     Microprogram are stored in microprogram memory and the execution is controlled by microprogram counter ( PC ) .Microprogram consists of microinstructions which are nothing but the strings of 0’s and 1’s . In a particular instance ,we read the contents of one location of microprogram memory , which is nothing but a microinstruction . Each output line ( data line )  of microprogram memory corresponds to one control signal. If the  contents of the memory cell is ) , it indicates that the signal is to generated and if the contents of memory cell is 1 , it indicates that generate that control signal at that instant of time.
      First let me define the different terminologies that are related to microprogrammed control unit.

Read More

Control Word (CW) :  Control word is defined as a word whose individual bits represent the various control signal. Therefore each of the control steps in the control sequence of an instruction defines a unique combination of 0s and 1s in the CW.

  • A sequence of control words ( CWs ) corresponding to the control sequence of a machine instruction constitutes the microprogram for that instruction.
  • The individual control words in this microprogram are referred to as microinstructions.
  • The microprograms corresponding to the instruction set of a computer are stored ina aspecial memory which will be referred to as the microprogram memory. The control words related to an instructions are stored in microprogram memory.
  • The control unit can generate the control signals for any instruction by sequencially reading the CWs of  the corresponding microprogram from the microprogram memory.
  • To read the control word sequentially from the microprogram memory a microprogram counter ( PC ) is needed.
  • The basic organization of a microprogrammed control unit is shown in the figure.           
Basic organization of a microprogrammed control
control word

Basic organization of a microprogrammed control
  The “starting address generator “  block is responsible for loading the starting address of the microprogram into the  PC everytime a new instruction is loaded in the IR.
The  PC is then automatically incremented the clock, and it reads the successive microinstruction from memory . Each microinstruction basically provides the required control signal at that time step. The microprogram counter ensures that the control signal will be delivered to the various parts of the CPU in correct sequence.

We have some instructions whose execution depends on the status of condition codes and status flag , as for example , the branch instruction. During branch instruction execution it is required to take the decision between the alternative action.

To handle such type of instructions with microprogrammed control, the design of control unit is based on the concept of  conditional branching  in the microprogram. For that it is required to include some conditional branch microinstructions.

  • In conditional microinstructions, it is required to specify the address of the microprogram memory to which the control must direct. It is known as branch address. Apart from branch address, these microinstructions can specify which of the states flags ,  condition codes , or possibly , bits of the instruction register should be checked as a condition for branching to take place.
  • To support microprogram branching, the organization of control unit should be modified to accommodate the branching decision.
  • To generate the branch address, it is required to know the status of the condition codes and status flag.
  • To generate the starting address, we need the instruction which is present in IR. But for branch address generation we have to check the content of condition codes and status flag.
  • The organization of control unit to enable conditional branching in the microprogram is shown in the figure.

Basic organization of a microprogrammed control
Basic organization of a microprogrammed control

The control bits of the microinstructions word which specify the branch conditions and address are fed to the “Starting and branch address generator “block.

This block performs the function of loading a new address into the  PC when the condition of branch instruction is satisfied.

In a computer program we have seen that execution of every instruction consists of two part – fetch phase and execution phase of the instruction. It is also observed that the fetch phase of all instruction is same.

In microprogrammed controlled control unit, a common microprogram is used to fetch the instruction. This microprogram is stored in a specific location and execution of each instruction start from that memory location.

At the end of fetch microprogram , the starting address generator unit calculate the appropriate starting address of the microprogram for the instruction which is currently present in IR. After the  PC controls the execution of microprogram which generates the appropriate control signal in proper sequence.

During the execution of a microprogram , the  PC is always incremented every time a new microinstruction is fetched from the microprogram memory , except in the following situations :
  1. When an End instruction is encountered, the  PC is loaded with the address of the first CW in the microprogram for the instruction fetch cycle.
  2. When a new instruction is loaded into the IR, the  PC is loaded with the starting address of the microprogram for that instruction.
  3. When a branch microinstruction is encountered , and the branch condition is satisfied , the  PC is loaded with the branch address.  

When the microprogram executes the End microinstruction of an instruction , then it generates the End control signal. This End control signal is used to load the  PC with the starting address of fetch instruction ( In our case it is address 0 of microprogram memory). Now the CPU is ready to fetch the next instruction from main memory.

 From the discussion , it is clear that microprograms are similar to computer program , but it is in one level lower, that’s why it is called microprogram.
 For each instruction of the instruction set of the CPU , we will have a microprogram.
 While executing a computer program , we fetch instruction by instruction from main memory which is controlled  by program counter.(PC) in microprogram control organisation, 

When we fetch an instruction from main memory, to execute that instruction , we execute the microprogram for that instruction. Microprograms are nothing but the collection of microinstrctions. These microinstructions will be fetched from microprogram memory one after another and its sequence is maintained by  PC. Fetching of microinstruction basically provides the required control signal at that time instant.

Post a Comment