Control Unit Operation - Computer Architecture & Organisation (CAO) - Computer

Control Unit Operation
Microoperations

A computer executes a program consisting of instructions. Each instruction is carried out as a sequence of shorter sub-cycles such as fetch, indirect, execute and interrupt handling. Each sub-cycle consists of still smaller elementary actions called microoperations. A microoperation is a simple, atomic operation performed by the CPU hardware (for example, transferring the contents of one register to another, incrementing the program counter, or enabling an ALU function). The events of any instruction cycle can be described as an ordered sequence of microoperations.

  • Microoperations are the basic functional actions that move data or perform simple computations inside the processor.
  • They are called microoperations because each step is very simple and does very little by itself.
  • Describing instruction execution as a sequence of microoperations makes the organisation and control of the CPU explicit and easier to design or modify.
Control Unit Operation

Steps Leading to Characterisation of the Control Unit

  • Define the basic elements of the processor (registers, ALU, busses, memory interfaces, flags, clocks).
  • Describe the set of microoperations the processor must perform for its instruction set.
  • Determine the functions the control unit (CU) must perform to sequence and execute those microoperations.

Types of Microoperation

  • Transfer data between internal registers (for example, R1 → R2).
  • Transfer data from a register to an external interface (for example, register → I/O module).
  • Transfer data from an external interface to a register (for example, I/O module → register).
  • Perform arithmetic or logical operations using the ALU with register operands (for example, R1 + R2 → R3).

Examples of Typical Microoperations

  • MAR ← PC - load memory address register from the program counter.
  • MDR ← M[MAR] - read memory at address in MAR into memory data register.
  • IR ← MDR - transfer fetched instruction into instruction register.
  • PC ← PC + 1 - increment program counter.
  • A ← A + B - ALU performs an addition of registers A and B and stores the result in A.

Functions of the Control Unit

  • Sequencing - cause the CPU to step through a prescribed series of microoperations in the correct order for each instruction.
  • Execution control - issue the control signals that make each microoperation actually occur (for example enabling register outputs, selecting ALU operation, asserting read/write lines).

These actions are implemented by generating appropriate binary control signals that enable or disable gates, drivers and functional units inside the CPU and on the system bus.

Functions of the Control Unit

Inputs to the Control Unit

  • Clock - a repetitive timing signal; the CU typically issues one microinstruction (or one set of parallel microinstructions) per clock cycle. The clock pulse width and period influence the allowable propagation delays for signals during a microoperation.
  • Instruction Register (IR) - the opcode field of the current instruction determines which sequence of microinstructions must be performed.
  • Flags - condition bits (for example zero, carry, negative, overflow) that reflect the state of the ALU or previous operations; these inputs allow conditional sequencing.
  • Control bus inputs - external events such as interrupts and acknowledgement signals arrive via the control or system bus and are inputs to the CU.

Control Unit Outputs (Control Signals)

  • Internal control signals (within the CPU) - signals that cause data movement on internal buses, enable register outputs or loads, select ALU functions, and control internal multiplexers.
  • External control signals (via the control or system bus) - signals sent to memory modules and I/O modules (for example, memory read, memory write, I/O read, I/O write, device select).
  • Kinds of control signals - signals that activate ALU operations, signals that activate datapath elements (register load/enable, multiplexers), and signals that are asserted on external interfaces.
  • All control signals are applied as binary inputs to gates and circuits that implement the required data movement and computation.

Hardwired Implementation of the Control Unit

  • In a hardwired control unit, the CU is implemented as a combinational (and sometimes small sequential) logic network that transforms input signals into the set of output control signals.
  • Inputs to the hardwired CU include opcode bits from the IR, the state flags, bits from the control bus (e.g., interrupt requests), and timing signals derived from the clock and a sequence counter.
  • The opcode field typically drives a decoder that produces a unique signal per instruction; that signal, combined with timing and flags, enables the required control signals for each microcycle.
  • The clock provides timed intervals t1, t2, ... within an instruction cycle; a small counter or timing generator supplies these timing inputs to select different control signals at different times.
  • At the end of each instruction cycle the timing counter is re-initialised for the next instruction.
Hardwired Implementation of the Control Unit

Realising the Hardwired CU

  • For each control signal a Boolean expression is derived as a function of the inputs (opcode bits, timing signals, flags, bus inputs).
  • Those Boolean expressions are realised with gates to build the combinational circuitry of the control unit.

Problems with Hardwired Designs

  • Complex sequencing and microoperation logic for rich instruction sets makes the circuitry large and hard to understand.
  • Design and testing become difficult as the number of instructions and control lines grow.
  • Hardware is inflexible: adding or changing instructions requires redesigning the logic.
  • Modifications or fixes are expensive and time consuming in gates and wiring.

Microprogrammed Implementation of the Control Unit

  • Microprogramming is an alternative to hardwired control. It implements the control unit as a small program (firmware) stored in a special memory called the control memory.
  • Each word in control memory is a microinstruction that specifies the control signals to assert during one microcycle and may contain sequencing information for the next microinstruction.
  • Microprogramming is common in complex instruction set (CISC) processors where control complexity is high; it improves flexibility because changing control behaviour can be done by updating microcode rather than rewiring logic.
Microprogrammed Implementation of the Control Unit
  1. The Control Address Register (CAR) holds the address of the next microinstruction to fetch from control memory.
  2. When the CAR is read, the microinstruction word is loaded into the Control Buffer Register (CBR).
  3. For horizontal microinstructions, reading a microinstruction is equivalent to executing it: the bits in the CBR directly drive the control signals in parallel.
  4. The sequencing unit examines the CBR contents and the flags and decides the next action for CAR: it may increment CAR, load a new address from a field in the CBR, or load an address derived from the opcode in the IR.
  5. Typical sequencing decisions are:
    • add 1 to the control address register (CAR ← CAR + 1),
    • load address from the address field of the control buffer register (CAR ← CBR[address field]),
    • load CAR based on the opcode in the IR (CAR ← decoder(opcode)).
  6. An upper decoder can translate the opcode in the IR into a control memory starting address for the microprogram of that instruction; a lower decoder may be used to decode fields in narrower (encoded) microinstructions.

Microinstruction Types

  • Vertical microprogramming - each microinstruction is compact (narrow); it typically contains encoded fields that specify one or a few control actions. Encoded control information must be decoded to produce actual control signals.
  • Horizontal microprogramming - each microinstruction is wide; many control bits are present in the word so that many control signals may be asserted directly and in parallel without further decoding.

Horizontal Microprogramming

  • Uses a wide control memory word; each bit in the word corresponds directly to a control line.
  • Allows a high degree of parallel operations because many control signals can be asserted together.
  • Requires little or no encoding of control information, so execution can be fast and simple.
Horizontal Microprogramming

Vertical Microprogramming

  • Uses narrow control memory words; control signals are encoded. A decoder is required to translate encoded fields into actual control lines.
  • Encodes n control signals into approximately log2 n bits in the microinstruction word, reducing control memory size but also limiting explicit parallelism.
  • Because of encoding, additional decoding hardware is needed to activate the precise control line(s) specified by the microinstruction.
Vertical Microprogramming

Comparison and Design Trade-offs

  • Hardwired control tends to be faster for simple control tasks and can have low latency, but is complex to design and inflexible to change.
  • Microprogrammed control offers greater flexibility, easier modification of the instruction set or control sequences, and simpler design verification; it may have slightly higher microcycle overhead due to microinstruction fetches, depending on implementation.
  • Horizontal microcode gives direct parallel control at the cost of larger control memory, while vertical microcode reduces memory size but needs decoding logic and gives less explicit parallelism.

For most educational and practical processor designs the choice between hardwired and microprogrammed CU depends on target performance, complexity of the instruction set, ease of modification, available silicon area, and design time. Microprogramming is particularly useful where an extensible or complex instruction set is required; hardwired control is chosen when maximum speed and minimal microcycle overhead are paramount.

The document Control Unit Operation is a part of the Computer Science Engineering (CSE) Course Computer Architecture & Organisation (CAO).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)

FAQs on Control Unit Operation

1. What is the purpose of a control unit in a computer system?
Ans. The control unit is responsible for managing and coordinating the activities of the computer's hardware components. It fetches instructions from the memory, decodes them, and then executes them by issuing appropriate signals to the other hardware components.
2. How does a control unit execute instructions in a computer system?
Ans. The control unit executes instructions by following a sequence of steps known as the instruction cycle. It fetches the instruction from the memory, decodes it to determine the operation to be performed, fetches the operands if necessary, and then executes the instruction by issuing appropriate signals to the other hardware components.
3. Can a computer system function without a control unit?
Ans. No, a computer system cannot function without a control unit. The control unit is an essential component that coordinates the activities of other hardware components, such as the CPU, memory, and input/output devices. Without a control unit, the computer would not be able to execute instructions or perform any meaningful tasks.
4. What are the main tasks performed by a control unit?
Ans. The main tasks performed by a control unit include fetching instructions from memory, decoding instructions to determine the operation to be performed, fetching operands if necessary, executing instructions by issuing appropriate signals to other hardware components, and handling any exceptions or interrupts that may occur during the execution of instructions.
5. How does the control unit ensure the correct execution of instructions in a computer system?
Ans. The control unit ensures the correct execution of instructions by carefully following the instruction cycle and coordinating the activities of other hardware components. It fetches instructions from memory, decodes them accurately, fetches the necessary operands, and issues appropriate signals to ensure that the instructions are executed correctly. Additionally, the control unit also handles any exceptions or interrupts that may occur during the execution of instructions to maintain the system's stability and reliability.
Explore Courses for Computer Science Engineering (CSE) exam
Get EduRev Notes directly in your Google search
Related Searches
Free, video lectures, Semester Notes, Exam, Viva Questions, pdf , mock tests for examination, Important questions, shortcuts and tricks, Summary, study material, Control Unit Operation, Sample Paper, ppt, Control Unit Operation, Previous Year Questions with Solutions, Control Unit Operation, Objective type Questions, Extra Questions, MCQs, past year papers, practice quizzes;