Introduction:-

                            The function of  the control unit in a digital computer is to initiate sequences of microoperations. The number of  different types of  microoperations that are available in a given system is finite. The complexity of the digital system is derived from the number of sequences of microoperations that are performed. When the control signals are generated by hardware using  conventional logic design techniques, the control unit is said to  be hardwired. Microprogramming is a second alternative for designing the control unit of a digital computer. The principle of microprogramming is an elegant and systematic  method for controlling the microoperation sequences in a digital  computer.
 
                                                                                                                                              The control function that specifies a microoperation is  a binary variable. When it is in one binary state, the corresponding microoperation is executed.  A control variable in the opposite binary state does  not change the state of the registers in the system.  The active state of a control variable may be either the  1 state or the 0 state, depending on the application. In a bus-organized system, the control signals that  specify microoperations are groups of bits that select  the paths in multiplexers, decoders, and arithmetic  logic units.

 Control word:-

                             The control unit initiates a series of sequential steps of microoperations. During any give time certain micro-operations are to be initiated while others remain idle. The control variables at any given time can be  represented by a string of l's and O's called a control  word. As such, control words can be programmed to  perform various operations on the components of the  system.

Microprogram:-
                                   A control unit whose binary control variables are stored in  memory is called a microprogrammed control unit. Program stored in control memory that generates all the  control signals required to execute the instruction set  correctly. A sequence of microinstructions constitutes a
microprogram. Since alterations of the microprogram are not needed once  the control unit is in operation, the control memory can be  a read-only memory (ROM).

Microinstruction:-

          Contains a control word and a sequencing word
i) Control Word :- Contains all the control information
required for one clock cycle
ii) Sequencing Word :- Contains information needed to
decide the next microinstruction address
Microoperation
A microinstruction contains one or more  microoperations to be completed.

Writable Control Memory (Writable Control Storage: WCS):-

i)  CS whose contents can be modified:
. Microprogram can be changed
. Instruction set can be changed or modified
ii) Computer that employs a microprogrammed control unit  will have two separate memories: main memory and a  control memory.
iii) The user’s program in main memory consists of machine  instructions and data whereas control memory holds a  fixed microprogram that cannot be altered by the user.
iv) Each machine instruction initiates a series of  microinstructions in control memory.

The general configuration of a microprogrammed  control unit is demonstrated in the following block  diagram:




Dynamic Microprogramming:-
. Computer system whose control unit is implemented with a microprogram in
WCS.
. Microprogram can be changed by a systems programmer or a user.
Sequencer:
. The device or program that generates address of next microinstruction to be
executed is called sequencer.
. While the microoperations are being executed, the next address is computed  in the next address generator circuit and then transferred into the control  address register to read the next microinstruction.
.The location of the next microinstruction may be the one next in sequence, or  it may be located somewhere else in the control memory.
. Typical functions of a microprogram sequencer are incrementing the control  address register by one, loading into the control address register an address  from control memory, transferring an external address, or loading an initial  address to start the control operations.

Control Address Register:
CAR contains address of microinstruction.
Control Data Register:
i) CDR contains microinstruction read from memory.
ii) The microinstruction contains a control word that specifies  one or more microoperations. The data register is  sometimes called a pipeline register.
iii) It allows the execution of the microoperations specified by  the control word simultaneously with the generation of  the next microinstruction.
iv) This configuration requires a two-phase clock, with one  clock applied to the address register and the other to the  data register.