2079 2

CSC213 ยท 2079 ยท 10 marks

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

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

Computer ArchitectureChapter 4: Microprogrammed ControlDesign of Control Unit

Quick answer

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.

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.


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

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.