CONTROL UNIT : The unit which directs the operation of the processor & is a part of the CPU is known as Control Unit. It generates control signals for the operations of a computer. Types of Control Unit : There are two types of control units as follows. Hardwired control unit Micro-programmed control unit Hardwired control unit : The control hardware can be viewed as a state machine that changes from one state to another in every clock cycle, depending on the contents of the instruction register, the condition codes, and the external inputs. The outputs of the state machine are the control signals. The sequence of the operation carried out by this machine is determined by the wiring of the logic elements and hence named “hardwired”. ❖ To interpret the instructions & generate control signals for them, this control unit uses fixed logic circuits. To generate signals, the fixed logic circuits use the contents of the control step counter, Instruction Register (IR) & code flag, and some external input signals such as interrupt signals. ❖ The fixed logic circuit is a combinational circuit made from decoders & encoders. It generates the output based on the state of its input(s). The decoder decodes the instruction loaded in IR (Instruction Register) & generates the signal that serves as an input to the encoder. Also, external input & conditional codes act as an input to the encoder. The encoder then accordingly generates the control signals based on the inputs. After the execution of each instruction, another signal: the end signal is generated which resets the state of control step counter & makes it ready for the next instruction. Advantages of Hardwired Control Unit : Here, we will discuss the advantages of the Hardwired Control Unit as follows. 1. Because of the use of combinational circuits to generate signals, Hardwired Control Unit is fast. 2. It depends on number of gates, how much delay can occur in generation of control signals. 3. It can be optimized to produce the fast mode of operation. 4. Faster than micro- programmed control unit. 5. It does not require control memory. 6. Disadvantages of Hardwired Control Unit : Disadvantages of the hardwired control unit 1. The complexity of the design increases as we require more control signals to be generated (need of more encoders & decoders) 2. Modifications in the control signals are very difficult because it requires rearranging of wires in the hardware circuit. 3. Adding a new feature is difficult & complex. 4. Difficult to test & correct mistakes in the original design. 5. It is Expensive. Microprogrammed Control Unit: ❖ A controller results in the instructions to be implemented by constructing a definite collection of signals at each system clock beat. Each of these output signals generates one micro-operation including register transfer. Thus, the sets of control signals are generated definite micro-operations that can be saved in the memory. ❖ Each bit that forms the microinstruction is linked to one control signal. When the bit is set, the control signal is active. When it is cleared the control signal turns inactive. These microinstructions in a sequence can be saved in the internal ’control’ memory. The control unit of a microprogram-controlled computer is a computer inside a computer. • It can execute any instruction. The CPU should divide it down into a set of sequential operations. This set of operations are called microinstruction. The sequential micro-operations need the control signals to execute. • Control signals saved in the ROM are created to execute the instructions on the data direction. These control signals can control the microoperations concerned with a microinstruction that is to be performed at any time step. • The address of the microinstruction is executed next is generated. Advantages of Microprogrammed Control Unit 1. It can more systematic design of the control unit. 2. It is simpler to debug and change. 3. It can retain the underlying structure of the control function. 4. It can make the design of the control unit much simpler. Hence, it is inexpensive and less error-prone. 5. It can orderly and systematic design process. 6. It is used to control functions implemented in software and not hardware. 7. It is more flexible. 8. It is used to complex function is carried out easily. Disadvantages of Microprogrammed Control Unit 1. Adaptability is obtained at more cost. 2. It is slower than a hardwired control unit.