Hardwired vs Micro-programmed Control Unit
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 uses a fixed set of logic gates and circuits to execute instructions. The control signals for each instruction are hardwired into the control unit, meaning it has a dedicated circuit for each possible instruction. Hardwired control units are simple and fast but can be inflexible and difficult to modify.
On the other hand, a micro-programmed control unit uses microcode to execute instructions. 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 stored in memory, rather than being hardwired into the control unit.
The control unit is the brain of the CPU, and it can be implemented in two ways: hardwired or micro-programmed. Understanding the differences between these implementations is essential for those studying computer organization.
Micro-programmed control units are generally slower than hardwired control units because they require an extra step of decoding the microcode to generate control signals. However, 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 signals in the proper sequence. There are two approaches used for generating control signals in the correct sequence: the 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 operations carried out by this machine is determined by the wiring of the logic elements and hence is called “hardwired.”
-
Fixed logic circuits that correspond directly to the Boolean expressions are used to generate the control signals.
-
Hardwired control is faster than micro-programmed control.
-
A controller using this approach can operate at high speed.
-
RISC architecture is based on the hardwired control unit.
Micro-programmed Control Unit:
-
The control signals associated with operations are stored in special memory units inaccessible by the programmer as Control Words.
-
Control signals are generated by a program similar to machine language programs.
-
The micro-programmed control unit is slower in speed because of the time it takes to fetch microinstructions from the control memory.
-
Control Word: A control word is a word whose individual bits represent various control signals.
-
Micro-routine: A sequence of control words corresponding to the control sequence of a machine instruction constitutes the micro-routine for that instruction.
-
Micro-instruction: Individual control words in this micro-routine are referred to as micro-instructions.
-
Micro-program: A sequence of micro-instructions is called a micro-program, which is stored in ROM or RAM called Control Memory (CM).
-
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.
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 a decoded binary format, i.e., 1 bit per control signal. Example: If 53 control signals are present in the processor, then 53 bits are required. More than one control signal can be enabled at a time.
- It supports longer control words.
- It is used in parallel processing applications.
- It allows a higher degree of parallelism. If the degree is n, n control signals are enabled at a time.
- It requires no additional hardware (decoders), making it faster than vertical micro-programmed control.
- It is more flexible than vertical micro-programmed control.
2. Vertical Micro-programmed Control Unit:
The control signals are represented in an encoded binary format. For N control signals, Log₂(N) bits are required.
- It supports shorter control words.
- It supports easy implementation of new control signals; therefore, it is more flexible.
- It allows a low degree of parallelism, i.e., the degree of parallelism is either 0 or 1.
- It requires additional hardware (decoders) to generate control signals, implying it is slower than horizontal micro-programmed control.
- It is less flexible than horizontal but more flexible than a hardwired control unit.
Parameters | Hardwired | Microprogrammed |
---|---|---|
Speed | Speed is fast | Speed is slow |
Cost | More costlier. | Cheaper. |
Flexibility | Not flexible to accommodate new system specification | More flexible to accommodate new system specification |
Ability to Handle Complex Instructions | Difficult to handle complex instruction sets. | Easier to handle complex instruction sets. |
Decoding | Complex decoding and sequencing logic. | Easier decoding and sequencing logic. |
Applications | RISC Microprocessor | CISC Microprocessor |
Instruction set of Size | Small | Large |
Control Memory | Not required | Required |