4 Microprogrammed Control

Computer Architecture ยท Unit 4 ยท 4 hrs

Microprogrammed Control

Exam-focused notes for Microprogrammed Control (Computer Architecture, CSC213): what the TU syllabus asks and how it has actually been tested, with 9 solved past questions from this unit.

Microprogrammed Control in short

Where the previous chapter hardwired every control signal directly into logic gates, this chapter builds the alternative: a control unit whose control signals are read out of a small stored program, letting the designer change the machine's behaviour by rewriting memory rather than rewiring circuits.

Microprogrammed Control: notes

Control Word

The complete set of control variables active during one control step, written out as a string of 1's and 0's, is called a control word. Each word stored in control memory is one control word, and reading it out generates every control signal needed for that step of a machine instruction's execution.

Microprogram

A sequence of microinstructions that together carry out a machine-level instruction is called a microprogram. A microinstruction is a single stored word that specifies one or more microoperations to be performed during one control step. Since a microprogram normally does not need to change once the control unit is built, control memory is usually implemented as ROM, whose contents are fixed at manufacture; the word stored at each ROM address specifies exactly one microinstruction.

Control Memory

Control memory is the storage, typically ROM, inside a microprogrammed control unit that holds the complete set of microprogram routines, one per machine instruction, needed to interpret the computer's whole instruction set.

Control Address Register

The control address register (CAR) is a high-speed register that holds the address of the next microinstruction to be read from control memory; it plays the same role for the microprogram that the program counter plays for the main instruction stream, but scoped entirely to control memory.

Sequencer

The sequencer (or microprogram sequencer) is the part of the control unit that determines the address to be loaded next into CAR. It draws this address from one of several sources, the incremented current address, a branch address carried in the microinstruction, an address mapped from the instruction opcode, or a return address held in a subroutine register, and so drives the control unit through the microprogram exactly as a machine instruction's own control flow requires.

What this unit covers

  • Control Word
  • Microprogram
  • Control Memory
  • Control Address Register
  • Sequencer
  • Address Sequencing
  • Conditional Branch
  • Mapping of Instructions
  • Subroutines
  • Microinstruction Format
  • Symbolic Microinstructions
  • Design of Control Unit

Sequencer

2080 ยท 5 marks

Explain block diagram of microprogram sequencer in brief. [5]

A microprogram sequencer is a part of the control unit of the CPU that generates the addresses used to step through the microprogram stored in the control memory (control store). Its primary purpose is to present an address to the control memory so that a microinstruction may be read and executed...

Open this answer on its own page โ†’

2079 ยท 5 marks

What do you mean by sequencer? Explain with microprogram sequencer. [5]

Show solved answer

Sequencer and Microprogram Sequencer

Definition of Sequencer

A sequencer is a part of the control unit of the CPU. It generates the addresses used to step through the microprogram of a control store (control memory). In other words, it determines the sequence in which microinstructions are fetched and executed from the control memory.


Microprogram Sequencer

The purpose of a microprogram sequencer is to present an address to the control memory so that a microinstruction may be read and executed.

Block Diagram

         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚         MULTIPLEXER (MUX)            โ”‚
         โ”‚  Source 0 | Source 1 | Source 2 | Source 3 โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚  Selected Address
                            โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚  Control Addressโ”‚
                  โ”‚  Register (CAR) โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚  Address
                           โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚  Control Memory โ”‚
                  โ”‚ (Microprogram   โ”‚
                  โ”‚    Store)       โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚  Microinstruction
                           โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚  Control Data   โ”‚
                  โ”‚  Register (CDR) โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Working of Microprogram Sequencer

  1. Multiplexer (MUX): The multiplexer selects an address from 4 sources and routes it into the Control Address Register (CAR). The selection depends on the sequencer control inputs.

  2. Control Address Register (CAR): The output from CAR provides the address for the control memory. It holds the address of the next microinstruction to be executed.

  3. Control Memory: Stores the microprogram (set of microinstructions). The microinstruction at the address given by CAR is read out.

  4. Control Data Register (CDR): Holds the microinstruction fetched from control memory for execution.


Typical Sequencer Operations

The sequencer supports the following address sequencing operations:

OperationDescription
IncrementCAR is incremented by 1 to fetch the next sequential microinstruction
Branch / JumpCAR is loaded with a branch address from the microinstruction
Call SubroutineCurrent CAR value is saved (pushed to stack) and a new address is loaded
Return from SubroutineSaved address is popped from stack back into CAR
Load External AddressAn external address (e.g., from mapping logic) is loaded into CAR
Push / Pop StackStack operations for nested subroutine calls

With three inputs, the sequencer can provide up to eight address sequencing operations. Some commercial sequencers have three or four inputs plus a T (test/condition) input, providing a wider range of operations.


Address Mapping

When a machine instruction is fetched, its opcode bits are mapped to a starting address in the control memory. For example:

  • A 0 is placed in the most significant bit of the address.
  • The four opcode bits are transferred directly.
  • The two least significant bits are cleared (set to 00).

This provides each computer instruction a microprogram routine with a capacity of four microinstructions. If more microinstructions are needed, additional memory locations can be used.


Summary

The microprogram sequencer acts as the brain of the control unit by continuously generating the correct sequence of addresses to step through microinstructions stored in control memory, enabling the CPU to execute each machine instruction correctly through its corresponding microprogram routine.

Open this answer on its own page โ†’

2078 ยท 10 marks

Differentiate between hardwired and microprogrammed control unit. Describe with example of microprogram sequencer used in microprogrammed control unit.[10]

--- A control unit is the component of the CPU that directs the operation of the processor by generating control signals. There are two approaches to designing a control unit: Feature Hardwired Control Unit Microprogrammed Control Unit --------- Signal Generation Generates control signals using l...

Open this answer on its own page โ†’

Control Memory

2080 ยท 5 marks

Write short notes on (any two): a. Control ROM b. Common Bus System c. Flynn's Classification [5]

--- A common bus system is used in a basic computer to transfer information efficiently among registers and memory, reducing hardware complexity compared to direct point-to-point connections between all registers. - The basic computer has eight registers, a memory unit, and a control unit. - An e...

Open this answer on its own page โ†’

Design of Control Unit

2079 ยท 10 marks

Describe micro-programmed control unit. Explain different types of addressing modes with example.[10]

Show solved answer

Micro-programmed Control Unit and Addressing Modes


PART 1: Micro-programmed Control Unit (5 marks)

Definition

A control unit whose binary control variables are stored in memory is called a micro-programmed control unit.

Instead of generating control signals through hardwired logic circuits, a micro-programmed control unit stores sequences of micro-instructions in a special memory called control memory (CM). Each micro-instruction specifies the control signals to be activated during a particular clock cycle.


Basic Components

The basic components of a micro-programmed control unit are:

  1. Control Memory (CM): Stores micro-instructions (micro-programs). Each location in control memory holds a micro-instruction that generates control signals.
  2. Control Address Register (CAR): Holds the address of the next micro-instruction to be fetched from control memory.
  3. Control Data Register (CDR) / Pipeline Register: Holds the micro-instruction fetched from control memory.
  4. Micro-programmed Sequencer: Generates the next address of the micro-instruction to be executed. It determines the specific address source to be loaded into the CAR.

Block Diagram

        +------------------+
        |  Control Memory  |  <-- stores micro-instructions
        +------------------+
               |
               v
     +---------------------+
     | Control Data Reg    |  <-- holds current micro-instruction
     +---------------------+
          |           |
          v           v
    Control       Next Address
    Signals       Information
          |           |
          v           v
     [Processor]  [Sequencer / Next Address Logic]
                       |
                       v
              +------------------+
              | Control Address  |
              |   Register (CAR) |
              +------------------+
                       |
                       +-----> Control Memory (next fetch)

Working Principle

  1. The CAR holds the address of the current micro-instruction.
  2. The micro-instruction is fetched from control memory and placed in the CDR.
  3. The micro-instruction is decoded to produce control signals that drive the processor's data path.
  4. The sequencer computes the address of the next micro-instruction and loads it into the CAR.
  5. This process repeats for every machine instruction execution.

Comparison with Hardwired Control Unit

FeatureHardwired Control UnitMicro-programmed Control Unit
Signal generationLogic circuits (hardware)Micro-instructions in memory
SpeedFasterSlower
ModificationDifficult (hardware change)Easy (update micro-program)
CostExpensiveLess expensive
ComplexityCannot handle complex instructionsCan handle complex instructions
Used inRISC processorsCISC processors

PART 2: Addressing Modes (5 marks)

Definition

An addressing mode specifies how the operand (or its address) is determined from the instruction. Different addressing modes provide flexibility in accessing data.

In the basic computer, bit 15 (I-bit) of the instruction word acts as the addressing mode indicator:

  • I = 0 โ†’ Direct Addressing
  • I = 1 โ†’ Indirect Addressing

The following are the major types of addressing modes:


1. Implied (Implicit) Addressing Mode

  • The operand is implicitly specified by the instruction itself.
  • No address field is needed.
  • The operand is always in a specific register (usually the Accumulator).

Example:

CMA   (Complement Accumulator)

The operand is the accumulator register -- no address is specified in the instruction.


2. Immediate Addressing Mode

  • The operand is part of the instruction itself (given directly in the instruction).
  • No memory access is needed to fetch the operand.
  • Fast but limited in range.

Example:

ADD #5    ; Add the value 5 directly to the accumulator

Here, 5 is the operand, not an address.


3. Direct (Absolute) Addressing Mode

  • The address field of the instruction directly gives the effective address of the operand in memory.
  • One memory access is needed to fetch the operand.
  • In the basic computer: I = 0

Example:

LDA 500   ; Load the value stored at memory address 500 into AC

Effective Address (EA) = 500

Instruction:  | Opcode | I=0 | Address = 500 |
Memory[500] = Operand

4. Indirect Addressing Mode

  • The address field of the instruction gives the address of a memory location that contains the effective address of the operand.
  • Requires two memory accesses: one to get the effective address, one to get the operand.
  • In the basic computer: I = 1

Example:

LDA [500]  ; Memory[500] holds the actual address, say 800
           ; Operand is at Memory[800]

EA = Memory[500] = 800

Instruction:  | Opcode | I=1 | Address = 500 |
Memory[500] = 800  (effective address)
Memory[800] = Operand

5. Register Addressing Mode

  • The operand is stored in a CPU register.
  • The instruction specifies the register name/number.
  • Very fast -- no memory access needed.

Example:

MOV R1, R2   ; Move contents of R2 into R1

EA = R2 (a register, not a memory location)


6. Register Indirect Addressing Mode

  • The instruction specifies a register that holds the effective address of the operand in memory.
  • One memory access needed.

Example:

LDA (R1)   ; R1 contains address 600; operand is at Memory[600]

EA = Memory[R1]


7. Relative Addressing Mode

  • The effective address is computed by adding the **contents of the Program Counter
Open this answer on its own page โ†’

2077 ยท 5 marks

Differentiate between hardwired control unit and microprogrammed control unit. [5]

Show solved answer

Differences Between Hardwired Control Unit and Microprogrammed Control Unit

Definitions

Hardwired Control Unit: A control unit in which control signals are generated by hardware using conventional logic design techniques. It generates a specific sequence of control signals directly through logic circuits.

Microprogrammed Control Unit: A control unit whose binary control variables (control signals) are stored in a special memory called control memory. Control signals are generated with the help of micro-instructions stored in that memory.


Comparison Table

BasisHardwired Control UnitMicroprogrammed Control Unit
Signal GenerationControl signals are generated using hardware logic circuitsControl signals are generated using micro-instructions stored in control memory
SpeedFaster, since signals are produced directly by hardwareSlower, since micro-instructions must be fetched and decoded
ModifiabilityDifficult to modify; changes require rewiring the hardwareEasy to modify; only the micro-instructions (software level) need to be changed
CostExpensive, as everything must be realized in terms of logic gatesLess expensive, as only micro-instructions are used
ComplexityCannot handle complex instructions efficientlyCan handle complex instructions easily
UsageUsed in RISC (Reduced Instruction Set Computers)Used in CISC (Complex Instruction Set Computers)
StorageNo control memory requiredRequires a dedicated control memory to store the microprogram

Summary

In short, a hardwired control unit trades flexibility for speed and simplicity, while a microprogrammed control unit trades speed for flexibility and the ability to handle complex instruction sets. Modern RISC processors prefer hardwired design, whereas traditional CISC processors (such as Intel x86) rely on microprogramming.

Open this answer on its own page โ†’

2075 ยท 5 marks

Differentiate between hardwired control unit and a micro programmed control unit. [5]

Hardwired Control Unit: When the control signals are generated by hardware using conventional logic design techniques, the control unit is said to be hardwired. It generates a specific sequence of control signals directly through logic circuits. Microprogrammed Control Unit: A control unit whose ...

Open this answer on its own page โ†’

2075.1 ยท 6 marks

Differentiate between hardwired control unit and microprogrammed control unit. [6]

Hardwired Control Unit: A control unit in which control signals are generated by hardware using conventional logic design techniques. It generates a specific sequence of control signals directly through logic circuits. Microprogrammed Control Unit: A control unit whose binary control variables (c...

Open this answer on its own page โ†’

Symbolic Microinstructions

2078 ยท 5 marks

Explain the symbolic microinstruction with example. [5]

Each line of an assembly language microprogram defines a symbolic microinstruction. A symbolic microinstruction uses symbolic (human-readable) notation to represent the microoperations, control, and branching information that the control unit must execute at the microprogram level. --- Each symbo...

Open this answer on its own page โ†’