Introduction

  • A control unit is a complex circuitry structure within a computer’s processor that directs, dictates, and coordinates the overall operations of the computer to run it smoothly and successfully. 

Definition

  • The Control Unit(CU) is one of the basic/major components of the processor/CPU, which controls and coordinates the various operations with the execution of instructions by initiating the appropriate sequence of micro-operations for each task.

Characteristics/Feature

  • The control unit selects and interprets program instructions and then finally executes.
  • A control unit first must know about the: (a) Basic components of the CPU and (b) the micro-operations this CPU performs, to do any operation successfully.
  • The control unit is like a black box with certain inputs and outputs.
  • CPUs and GPUs(Graphics Processing Units) are devices that use control units.
  • A control unit must know how all the instructions will be executed. All this is achieved with the help of flags, op-codes, a clock, and some control signals to itself.

Function

  • The basic function of the control unit is to guide the various components of the CPU to perform a specific sequence of micro-operations to achieve the execution of an instruction successfully, and finally, complete the job. To achieve the tasks, the control unit generates related control signals, which are responsible for achieving the tasks.
  • In other words, the basic function of the control unit is to control: –
a) Data exchange between CPU and memory or I/O modules
b) Internal operations in the CPU, such as :
      • Moving data between registers (register transfer operations)
      • Making the ALU perform a particular operation on the data
      • Regulating other internal operations
  • The CU controls the execution of instructions by decoding the instruction and generating micro-operations to be performed for executing that instruction. 
  • They are responsible for all the operations to happen in the CPU.
  • The Control Unit (CU) is the unit that manages and coordinates the entire operation of a computer system. It also controls the operation of the other components of a computer system.
  • The Control Unit (CU) acts like the supervisor and monitors whether the operations are done in a proper, systematic fashion or not.
  • The control unit is responsible for overall control and coordination of instruction execution, i.e., it is responsible for defining and controlling the instruction cycle.
  • It issues control signals external to the processor to cause data exchange with memory and I/O modules.
  • It also issues control signals internal to the processor to move data between registers, to cause the ALU to perform a specified function, and to regulate other internal operations.
  • It generates timing signals and initiates the Fetch cycle of instruction execution. When the instruction is fetched, it generates the sequence of micro-operations that need to be executed to execute the instruction.
  • The control unit determines the sequence in which computer programs and instructions are executed.
  • The control unit first fetches the user’s program instructions from the main memory to the processor instruction register, and then it generates a related control signal based on the contents of the instruction register to supervise the execution of these instructions.

Architecture/Structure 

  • A control unit has a set of input values based on which it produces an output control signal, which in turn performs micro-operations or the execution of instructions. These output signals control the execution of a program.
  • A typical model of a control unit is shown below –
    The inputs to the control unit are: –
    • The Master Clock Signal:
      • This signal causes micro-operations to be performed in a square.
      • In a single clock cycle, either a single or a set of simultaneous micro-operations can be performed.
      • The time taken to perform a single micro-operation is also termed the processor cycle time or the clock cycle time in some machines.
    • The Instruction Register:
      • It contains the operation code (opcode) and addressing mode bits of the instruction.
      • It helps in determining the various cycles to be performed and hence determines the related micro-operations, which are needed to be performed.
    • Flags:
      • Flags are used by the control unit for determining the status of the CPU & the outcomes of a previous ALU operation.
      • For example, a zero flag, if set, conveys to the control unit that, for instruction ISZ (skip the next instruction if the zero flag is set), the next instruction is to be skipped. For such a case control unit causes an increment of PC by program instruction length, thus skipping the next instruction.
    • Control Signals from Control Bus:
      • Some of the control signals are provided to the control unit through the control bus.
      • These signals are issued from outside the CPU.
      • Some of these signals are interrupt signals and acknowledgment signals.

The output control signals are:

    • Control signals, which are required within the CPU:
      • These control signals cause two types of micro-operations, viz., for data transfer from one register to another and for performing an arithmetic, logic, and shift operation using the ALU.
      • Control signals to control bus: These control signals transfer data from or to the CPU register to or from memory or the I/O interface. These control signals are issued on the control bus to activate a data path on the data/address bus, etc.
  • A control unit contains a clock portion that provides clock pulses. This clock signal is used for measuring the timing of the micro-operations. In general, the timing signals from the control unit are kept sufficiently long to accommodate the proportional delays of signals within the CPU along various data paths. Thus, the clock to the control unit must provide counted timing signals. 
  • The control signals are applied directly to achieve the particular operation as the binary inputs to the logic gates of the logic circuits. All these inputs are the control signals, which are applied to select a circuit (for example, select or enable input) or a path (for example, multiplexers), or any other operation in the logic circuits.

Control Unit Organisation Techniques

  • There are a variety of techniques that have been used today to organize a control unit, but most of them fall into two major categories: –
    • Hardwired control organization
    • Microprogrammed control organization.

Hardwired Control Unit :

    • In the hardwired organization, the control unit is designed as a combinational circuit, i.e., the control unit is implemented by logic gates, flip-flops, a decoder, and other digital circuits.
    • In this organization, each signal is directly generated by the hardware based on the current state of the system and the opcode of the instruction being executed.
    • Hardwired control units can be optimized for fast operations.
    • In this control unit, the major inputs to the circuit are the instruction register, the clock, and the flags. Here, the control unit uses the opcode of the instruction stored in the IR register to perform different actions for different instructions.
    • The control unit logic has a unique logic input for each opcode. This simplifies the control logic. This control line selection can be performed by a decoder.
    • A decoder will have n binary inputs and 2n binary outputs. Each of these 2n different input patterns will activate a single unique output line.
    • The clock portion of the control unit issues a repetitive sequence of pulses for the SS(Synchronization Signal) duration of micro-operation(s). These timing signals control the sequence of execution of instructions and determine what control signal needs to be applied at what time for instruction execution.
Wilkes Control Unit
    • Wilkes Control Unit is a type of Hardwired Control Unit.
    • This control unit is named after Prof. M. V. Wilkes of the Cambridge University Mathematical Laboratory, who also coined the term microprogramming in 1951.
    • In Wilkes CU, microinstruction has two major components:-
      a) Control field which indicates the control lines that are to be activated and
      b) Address field, which provides the address of the next microinstruction to be executed.
    • Wilkes provided a systematic alternative procedure for designing the control unit of a digital computer.
    • In this CU, during instruction execution, a machine instruction, a sequence of transformations, and the transfer of information from one register in the processor to another take place. These were also called the micro-operations. 
    • The Wilkes control unit replaces the sequential and combinational circuits of a hardwired control unit with a simple control unit in conjunction with a storage unit that stores the sequence of steps of instructions that is a micro-program.
    • The control memory in Wilkes control is organized as a PLA-like matrix made of diodes. This is a partial matrix and consists of two components: the control signals and the address of the next micro-instruction. 

Microprogrammed Control Unit (MCU):

Introduction

      • It is an alternative and advanced method of manufacturing control units.

Definition 

      • A Microprogrammed Control Unit is a type of control unit in which the control signals are generated for instruction execution by using microinstructions stored in a control memory. Each microinstruction specifies a set of control signals that activate specific micro-operations (like register transfers, ALU operations, or memory access).
      • A microprogrammed control unit implements the control logic of a processor by storing a sequence of low-level instructions called microinstructions (or a microprogram/firmware) in a special memory called the control store (or control memory). Thus, a Microprogrammed Control Unit is a memory-based control unit that generates control signals using stored microinstructions. 

Characteristics

      • In MCU, the control signals are not generated directly by hardware wiring, as in a Hardwired control unit rather each microinstruction directly generates the control signals that drive data path elements (register enables, ALU operations, memory read/write, buses, etc.).
      • The MCU reads stored microinstructions sequentially (or by branching) to realize each machine-level instruction.
      • It is flexible, easier to design and update, and supports complex instructions, but is slower than hardwired control units.
      • Each instruction in the CPU is executed by following a sequence of several microinstructions.
      • Microinstructions Format: There are many possible microinstruction formats, but two classic categories are:
        • Horizontal Microinstructions Format:
          • Several bits wide, and each bit directly controls (explicit control) a hardware signal, or gate, or a control signal.
          • It supports parallel control, i.e., multiple micro-operations can be enabled in one microinstruction.
          • Very fast due to little decoding, but requires a large memory.
        • Vertical Microinstructions:
          • It requires decoding to produce control signals.
          • It has more compact memory (smaller control store).
          • It needs extra decode logic, hence slightly slower.
          • Encoded form; fewer bits, decoded into signals.
          • Saves memory but is slower due to decoding.

Components

      • Control Memory/Control Store/Microstore (ROM or RAM): A special memory of the control unit that stores microinstructions. There are several types of Control memory – 
        • ROM/PROM Control Store: It has fixed microcode, fast, immutable (or programmed once).
        • RAM (Writable Control Store): Microcode can be loaded at boot or patched later and is flexible.
        • Flash/EPROM Control Store: It is reprogrammable but slower to rewrite.
        • PLA-based Control Store: It is a programmable logic array implementation for decoding control signals.
      • Control Address Register (CAR)/Microprogram Counter (µPC): It holds the address of the next microinstruction to fetch from the control store.
      • Control Data Register (CDR): It holds the current microinstruction.
      • Microinstruction Register (MIR) / Control Buffer: It holds the microinstruction currently being executed.
      • Sequencer/Next-address logic: It determines or computes the sequence of microinstructions.
      • Microinstruction Decoder/Control Logic: It converts or decodes microinstruction bits or fields and translates them into control signals.
      • Read-only/Read-write control store interface: It is the access bus and timing to fetch microinstructions.

Structure 

      • A microprogrammed control unit consists of:
        (a) One or more micro-operations to be executed and
        (b) The information about the micro-instruction to be executed next.

Basic Working Principle

      • The Instruction Register (IR) holds the current instruction.
      • The Control Address Register (CAR) points to the address of the next microinstruction in control memory.
      • The Control Memory (CM) stores all microinstructions.
      • The Control Data Register (CDR) holds the microinstruction fetched from control memory.
      • The Decoder interprets the microinstruction and generates the required control signals.
      • The process flow of the MCU is as follows –
        • The read signal is generated first to fetch the microinstruction from control memory.
        • Decode it to generate control signals.
        • Execute the related micro-operations.
        • Update the CAR to point to the next microinstruction.

Advantages

      • Flexibility: The control behavior/logic can be changed/modified, or updated as needed by rewriting the microprogram (also useful for implementing new machine instructions or fixing bugs).
      • Simplicity to design: Instead of complex, hardwired logic for each machine instruction, we express control logic as sequences in memory.
      • Support for Complex Instructions: Ideal for CISC (Complex Instruction Set Computer) architectures.

Disadvantages

      • Slower Execution:  Generally slower than optimized hardwired control (extra memory fetch & sequencing).
      • It has high control store cost/area and latency (for wide microinstructions).
      • Potentially larger design complexity for sequencing hardware.
      • More Memory Usage: Requires dedicated control memory.

Applications

      • Most modern CISC processors (like older Intel x86 CPUs) utilize microprogram control units.
      • Useful in systems where instruction sets change frequently.
      • Common in educational CPU designs to demonstrate control logic.

Difference between Hardwired and Microprogrammed Control Unit

Feature Hardwired Control Unit Microprogrammed Control Unit
Speed Faster Slower
Flexibility Difficult to modify Easy to modify
Complex Instructions Hard to implement Easy to implement
Design Complex wiring Simpler, memory-based

Loading


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.