Open In App

Computer Organization | Hardwired v/s Micro-programmed Control Unit

Introduction :

In computer architecture, the control unit is responsible for directing the flow of data and instructions within the CPU. There are two main approaches to implementing a control unit: hardwired and micro-programmed.



A hardwired control unit is a control unit that uses a fixed set of logic gates and circuits to execute instructions. The control signals for each instruction are hardwired into the control unit, so the control unit has a dedicated circuit for each possible instruction. Hardwired control units are simple and fast, but they can be inflexible and difficult to modify.

On the other hand, a micro-programmed control unit is a control unit that uses a microcode to execute instructions. The microcode is a set of instructions that can be modified or updated, allowing for greater flexibility and ease of modification. The control signals for each instruction are generated by a microprogram that is stored in memory, rather than being hardwired into the control unit.



Micro-programmed control units are slower than hardwired control units because they require an extra step of decoding the microcode to generate control signals, but they are more flexible and easier to modify. They are commonly used in modern CPUs because they allow for easier implementation of complex instruction sets and better support for instruction set extensions.

To execute an instruction, the control unit of the CPU must generate the required control signal in the proper sequence. There are two approaches used for generating the control signals in proper sequence as Hardwired Control unit and the 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”. 

Micro-programmed Control Unit –  

Some Important Terms

  1. Control Word: A control word is a word whose individual bits represent various control signals.
  2. Micro-routine: A sequence of control words corresponding to the control sequence of a machine instruction constitutes the micro-routine for that instruction.
  3. Micro-instruction: Individual control words in this micro-routine are referred to as microinstructions.
  4. Micro-program: A sequence of micro-instructions is called a micro-program, which is stored in a ROM or RAM called a Control Memory (CM).
  5. Control Store: the micro-routines for all instructions in the instruction set of a computer are stored in a special memory called the Control Store.

The differences between hardwired and micro-programmed control units:

  Hardwired Control Unit  Micro-programmed Control Unit
 
Implementation  Fixed set of logic gates and circuits  Microcode stored in memory
 
Flexibility  Less flexible, difficult to modify  More flexible, easier to modify
 
Instruction Set  Supports limited instruction sets  Supports complex instruction sets
 
Complexity of Design  Simple design, easy to implement  Complex design, more difficult to implement
 
Speed  Fast operation  Slower operation due to microcode decoding
 
Debugging and Testing  Difficult to debug and test  Easier to debug and test
 
Size and Cost  Smaller size, lower cost  Larger size, higher cost
 
Maintenance and Upgradability  Difficult to upgrade and maintain  Easier to upgrade and maintain
 

Types of Micro-programmed Control Unit – Based on the type of Control Word stored in the Control Memory (CM), it is classified into two types : 

1. Horizontal Micro-programmed Control Unit : 
The control signals are represented in the decoded binary format that is 1 bit/CS. Example: If 53 Control signals are present in the processor then 53 bits are required. More than 1 control signal can be enabled at a time. 

2. Vertical Micro-programmed Control Unit : 
The control signals are represented in the encoded binary format. For N control signals- Log2(N) bits are required.  

Note: Types of Control Unit in descending order of speed :

Hardwired control unit > Horizontal microprogrammed CU > Vertical microprogrammed CU 

GATE CS Corner Questions 
Practicing the following questions will help you test your knowledge. All questions have been asked in GATE in previous years or in GATE Mock Tests. It is highly recommended that you practice them.  

  1. GATE CS 2004, Question 66
  2. GATE CS 2002, Question 32

 

 

Article Tags :