3 Microoperations And Control Unit Design

Microprocessor and Computer Architecture ยท Unit 3

Microoperations and Control Unit Design

Exam-focused notes for Microoperations and Control Unit Design (Microprocessor and Computer Architecture, BIT151): what the TU syllabus asks and how it has actually been tested, with 14 solved past questions from this unit.

Microoperations and Control Unit Design in short

The control unit is the part of the CPU that tells every other part what to do and when. It can be built from fixed logic gates (hardwired) or from a stored program of control words (microprogrammed). This chapter covers both, using the basic computer model with a 16-bit instruction word.

Microoperations and Control Unit Design: notes

Microoperations definition and types

A microoperation is a simple operation done on data held in registers during one clock pulse. Every machine instruction is carried out as a sequence of microoperations.

The four types are:

  • Register transfer: copy data from one register to another, such as $R1 \leftarrow R2$.
  • Arithmetic: add, subtract, increment, decrement.
  • Logic: AND, OR, XOR, complement on register bits.
  • Shift: move bits left or right.

Meaning of some microoperations in the basic computer:

MicrooperationMeaning
AR โ† PCCopy the program counter into the address register
DR โ† M[AR], PC โ† PC + 1Read the memory word at address AR into DR, and at the same time increment PC
AR โ† DR(0-10), CAR(2-5) โ† DR(11-14), CAR(0,1,6) โ† 0Take the address part of DR into AR. Map the 4-bit opcode into the control address register and clear its other bits

The last line is the mapping step. It sends the control unit to the microprogram of the instruction just fetched.

Micro-instructions and microprograms

A micro-instruction is a control word stored in control memory. It tells the hardware which microoperations to do in one clock period, and which micro-instruction comes next.

A microprogram is a sequence of micro-instructions that carries out one machine instruction. The set of all microprograms is kept in a small fast memory called the control memory, usually a ROM.

A typical 20-bit micro-instruction has six fields.

FieldBitsUse
F13Selects one microoperation from group 1
F23Selects one microoperation from group 2
F33Selects one microoperation from group 3
CD2Condition: 00 always (U), 01 indirect bit (I), 10 sign of AC (S), 11 zero of AC (Z)
BR2Branch type: 00 JMP, 01 CALL, 10 RET, 11 MAP
AD7Address field for a jump or call

Some of the codes used by F1, F2 and F3:

CodeF1F2F3
000NOPNOPNOP
001ADD (AC โ† AC + DR)SUBXOR
010CLRACORCOM
011INCACANDSHL
100DRTACREAD (DR โ† M[AR])SHR
101DRTARACTDRINCPC
110PCTARINCDRARTPC
111WRITEPCTDRnot used

What this unit covers

  • Microoperations definition and types
  • Micro-instructions and microprograms
  • Symbolic and binary microprogram representation
  • FETCH operation microprogram
  • Hardwired control unit design and block diagram
  • Microprogrammed control unit design
  • Control ROM and mapping table

FETCH operation microprogram

2082 ยท 5 marks

Write symbolic microprogram for FETCH operation. [5]

The FETCH cycle (also called the instruction fetch cycle) is the first phase of every instruction execution. It retrieves the instruction from memory at the address pointed to by the Program Counter (PC) and loads it into the Instruction Register (IR). (No specific reference notes were found for ...

Open this answer on its own page โ†’

Microprogrammed control unit design

2082 ยท 5 marks

Write short notes on: (a) Microprogrammed Control Unit (b) Virtual Memory. [5]

Show solved answer

Short Notes

(a) Microprogrammed Control Unit

A Microprogrammed Control Unit is a control unit implementation where the control signals required to execute machine instructions are generated by a program stored in a special high-speed memory called the Control Memory (CM).

Key Concepts

  • Proposed by Maurice Wilkes (1951).
  • Each machine instruction is interpreted by a sequence of microinstructions stored in control memory.
  • A microinstruction specifies the control signals to be activated during one clock cycle.
  • A sequence of microinstructions for one machine instruction is called a microprogram or microcode.

Components

ComponentFunction
Control Memory (CM)Stores microprograms (ROM)
Control Address Register (CAR)Holds address of next microinstruction
Control Data Register (CDR)Holds the current microinstruction being executed
SequencerDetermines the next microinstruction address

Working

  1. Machine instruction is fetched and decoded.
  2. The opcode maps to a starting address in control memory.
  3. Microinstructions are fetched sequentially, generating control signals.
  4. Execution continues until the microprogram for that instruction completes.

Advantages

  • Easy to design and modify (change microcode instead of hardware).
  • Flexible and less error-prone than hardwired control.

Disadvantage

  • Slower than hardwired control due to memory access overhead.

(b) Virtual Memory

Virtual Memory is a memory management technique that allows a computer to use more memory than is physically available (RAM) by using a portion of secondary storage (hard disk) as an extension of main memory.

Key Concepts

  • Programs are given the illusion of a large, contiguous address space called the virtual address space.
  • Only the actively used portions of a program need to reside in physical memory at any time.
  • The rest resides on disk in a swap space or page file.

How It Works

  • The virtual address space is divided into fixed-size blocks called pages.
  • Physical memory is divided into frames of the same size.
  • A Page Table maps virtual page numbers to physical frame numbers.
  • When a referenced page is not in physical memory, a page fault occurs, and the OS loads the required page from disk.

Address Translation

Virtual Address --> [Page Table] --> Physical Address
  (Page No. + Offset)               (Frame No. + Offset)

Benefits

BenefitDescription
Larger address spacePrograms can be larger than physical RAM
MultiprogrammingMore processes can run simultaneously
Memory isolationEach process has its own virtual address space
Simplified programmingProgrammer need not manage physical memory

Disadvantage

  • Thrashing: If too many page faults occur, the system spends more time swapping than executing, severely degrading performance.
Open this answer on its own page โ†’

2080 ยท 5 marks

What do you understand by microprogrammed control computer? Explain main memory and control memory of microprogrammed controlled Computer. [5]

A microprogrammed control computer is a computer in which the control unit is implemented using a special memory called control memory, which stores sequences of microinstructions (called a microprogram) that define how each machine-level instruction is executed. Instead of hardwired logic, contr...

Open this answer on its own page โ†’

Hardwired control unit design and block diagram

2081 ยท 5 marks

What is control unit? Compare between microprogrammed and hardwired control unit. [5]

The Control Unit (CU) is a component of the CPU that directs the operation of the processor. It interprets instructions fetched from memory and generates the necessary control signals to coordinate the activities of the ALU, registers, memory, and input/output devices. It does not process data it...

Open this answer on its own page โ†’

2080 ยท 10 marks

What is control unit of microprocessor? Draw the block diagram of the hardwired control unit and explain the function of each unit in brief.[10]

The Control Unit (CU) is the central component of a microprocessor that directs and coordinates the operations of all other units. It interprets (decodes) the instructions fetched from memory and generates the necessary control signals to execute those instructions. It does not process data itsel...

Open this answer on its own page โ†’

2079 ยท 10 marks

Draw the block diagram of Hardwired control unit and explain their functional units in brief.[10]

A Hardwired Control Unit is a control unit implementation where the control signals are generated by logic circuits (gates, flip-flops, decoders, etc.) that are physically wired together. The control logic is fixed at the time of design and cannot be changed without redesigning the hardware. It i...

Open this answer on its own page โ†’

0 ยท 5 marks

Differentiate between microprogrammed and hardwired control unit. [5]

A hardwired control unit generates control signals using fixed logic circuits (combinational and sequential logic gates). The control logic is physically wired into the hardware and cannot be changed without redesigning the circuit. A microprogrammed control unit generates control signals by read...

Open this answer on its own page โ†’

Symbolic and binary microprogram representation

2081 ยท 5 marks

What is micro program? Write symbolic microprogram for FETCH operation. [5]

Show solved answer

Microprogram and Symbolic Microprogram for FETCH Operation

What is a Microprogram?

A microprogram is a sequence of microinstructions stored in a special memory called control memory (or control store). Each microinstruction specifies one or more micro-operations (elementary hardware operations) to be performed in a single clock cycle.

Key points:

  • Microprogramming is a technique used to implement the control unit of a CPU.
  • The concept was introduced by Maurice Wilkes.
  • Each machine instruction is interpreted by executing a corresponding sequence of microinstructions.
  • Microinstructions are stored in ROM-based control memory.
  • A microprogram is analogous to a program, but operates at the register-transfer (hardware) level.

Microprogrammed Control Unit uses control memory to generate control signals, rather than hardwired logic.


Symbolic Microprogram for FETCH Operation

The FETCH cycle retrieves an instruction from memory and places it in the Instruction Register (IR), then increments the Program Counter (PC).

Registers Used:

RegisterPurpose
PCProgram Counter
MARMemory Address Register
MBR / MDRMemory Buffer / Data Register
IRInstruction Register

Symbolic Microprogram (FETCH Cycle):

Step    Micro-operation                     Comment
------  ----------------------------------  ---------------------------
T0:     MAR โ† PC                           Transfer PC content to MAR
T1:     MBR โ† M[MAR], PC โ† PC + 1         Read memory into MBR;
                                            Increment PC simultaneously
T2:     IR โ† MBR                           Load instruction into IR

Explanation of Each Step:

  1. T0: MAR โ† PC

    • The content of the Program Counter is transferred to the Memory Address Register.
    • This tells the memory which address to read from.
  2. T1: MBR โ† M[MAR], PC โ† PC + 1

    • The instruction stored at the address in MAR is fetched from memory into MBR.
    • Simultaneously, PC is incremented to point to the next instruction.
    • These two micro-operations can occur in parallel (same clock cycle).
  3. T2: IR โ† MBR

    • The fetched instruction is transferred from MBR to the Instruction Register (IR).
    • After this, the DECODE phase begins.

Summary Flow:

PC --> MAR --> Memory Read --> MBR --> IR
                                PC + 1 --> PC

The FETCH microprogram typically requires 3 micro-steps (T0, T1, T2) and forms the first part of the instruction cycle in any CPU.

Open this answer on its own page โ†’

2078 ยท 5 marks

What is micro-program? Write symbolic microprogram for FETCH operation. [5]

Show solved answer

Microprogram and Symbolic Microprogram for FETCH Operation

What is a Microprogram?

A microprogram is a sequence of microinstructions stored in a special memory called the Control Memory (CM) or Control Store, which is used to implement the control unit of a computer.

  • Each microinstruction specifies one or more microoperations to be performed in a single clock cycle.
  • A microprogram corresponds to a machine language instruction (like ADD, LOAD, etc.) and defines how that instruction is executed at the register-transfer level.
  • The technique of using microprograms to implement the control unit is called microprogramming, introduced by Maurice Wilkes.

Key Points:

TermMeaning
MicrooperationA single atomic hardware operation (e.g., MAR โ† PC)
MicroinstructionOne step in the microprogram containing one or more microoperations
MicroprogramA complete sequence of microinstructions for one machine instruction
Control MemoryROM/RAM where microprograms are stored

FETCH Operation (Instruction Fetch Cycle)

The FETCH cycle retrieves an instruction from memory and prepares the CPU to execute it. The steps involved are:

  1. Transfer the content of PC to MAR (Memory Address Register)
  2. Initiate a memory read; increment PC
  3. Transfer the fetched instruction from MDR to IR (Instruction Register)
  4. Decode the instruction and determine the next microprogram address

Symbolic Microprogram for FETCH

Label       Microoperations                     Comments
-------     ----------------------------        -------------------------
FETCH:      MAR โ† PC                            Transfer PC to MAR
            MDR โ† M[MAR], PC โ† PC + 1          Read memory; increment PC
            IR โ† MDR                            Load instruction into IR
            DECODE IR; Go to next routine       Decode opcode; branch

Step-by-step Explanation:

StepMicroinstructionDescription
1MAR โ† PCThe address of the next instruction (held in PC) is copied to MAR so memory can be addressed
2MDR โ† M[MAR]Memory is read; the instruction at the address in MAR is placed in MDR
2PC โ† PC + 1PC is incremented to point to the next instruction (can be done in parallel with memory read)
3IR โ† MDRThe fetched instruction is transferred from MDR to the Instruction Register
4DECODE IRThe opcode in IR is decoded to determine which microprogram routine to execute next

Summary

A microprogram is a set of microinstructions stored in control memory that implements a machine instruction by specifying register-level operations step by step. The FETCH microprogram reads the instruction from memory using PC โ†’ MAR โ†’ MDR โ†’ IR, increments PC, and decodes the opcode to branch to the appropriate execution routine.

Open this answer on its own page โ†’

2080.1 ยท 10 marks

What is micro-program and micro-instruction?Describe symbolic micro-program for instruction FETCH routine of basic computer.[4+6]

Show solved answer

Micro-program and Micro-instruction | FETCH Routine

Note: Reference notes were not available for this topic. The answer below is based on standard Computer Organization and Architecture curriculum as taught in TU BSc CSIT (Morris Mano's Computer Organization approach).


(a) Micro-program and Micro-instruction

Micro-instruction

A micro-instruction is a single word stored in the control memory that specifies one or more micro-operations to be performed by the hardware in one clock cycle.

  • Each micro-instruction contains a set of bits that directly control the data path operations (register transfers, ALU operations, bus signals, etc.)
  • It may also contain a field specifying the address of the next micro-instruction to be fetched.

Format of a Micro-instruction (typical):

F1F2F3CDBRAD
3 bits3 bits3 bits2 bits2 bits7 bits

Where:

  • F1, F2, F3 - Micro-operation fields
  • CD - Condition for branching
  • BR - Branch type
  • AD - Address field (next micro-instruction address)

Micro-program

A micro-program is a sequence (program) of micro-instructions stored in a special high-speed memory called control memory (CM) or control store.

  • It is written by the computer designer (not the user) to implement the instruction set of the machine.
  • The control memory is typically a ROM (Read Only Memory).
  • Each machine language instruction corresponds to a micro-routine (a set of micro-instructions).
  • The process of using micro-programs to implement the control unit is called microprogramming.

Key Points:

FeatureDescription
StorageControl Memory (ROM)
Written byHardware/System Designer
PurposeImplements machine instructions
ExecutionSequential, one per clock cycle

(b) Symbolic Micro-program for FETCH Routine

Background

In a basic computer (Morris Mano model), the instruction cycle begins with the FETCH routine, which:

  1. Reads the instruction from memory at the address given by the Program Counter (PC)
  2. Increments the PC
  3. Decodes the instruction

The control memory uses symbolic notation where each line represents one micro-instruction.


Registers Used

RegisterPurpose
ARAddress Register
PCProgram Counter
DRData Register
IRInstruction Register
CARControl Address Register
SBRSubroutine Branch Register

Symbolic Micro-program for FETCH Routine

Label    |  Micro-operations          |  CD  |  BR  |  AD
---------|----------------------------|------|------|--------
FETCH:   |  AR <- PC                  |  U   |  JMP | NEXT
         |  DR <- M[AR], PC <- PC + 1 |  U   |  JMP | NEXT
         |  IR <- DR(0-10),           |  U   |  MAP | 0000000
         |  AR <- DR(11-15)           |      |      |

Explanation of Each Step

Step 1: AR <- PC

  • The content of the Program Counter is transferred to the Address Register.
  • This sets up the memory address from which the instruction will be fetched.
  • CD = U (Unconditional), BR = JMP (go to next address)

Step 2: DR <- M[AR], PC <- PC + 1

  • Memory is read: the instruction at address AR is loaded into the Data Register (DR).
  • Simultaneously, the PC is incremented to point to the next instruction.
  • These two micro-operations happen in parallel in one clock cycle.

Step 3: IR <- DR(0-10), AR <- DR(11-15)

  • The opcode portion of the instruction (bits 0-10) is loaded into the Instruction Register (IR).
  • The address portion (bits 11-15) is loaded into the Address Register (AR).
  • BR = MAP: The next address is determined by mapping the opcode to the appropriate micro-routine in control memory.
  • This effectively decodes the instruction and branches to the correct execute routine.

Flow Diagram

START
  |
  v
AR <-- PC                        (Point to instruction)
  |
  v
DR <-- M[AR], PC <-- PC+1        (Read instruction, advance PC)
  |
  v
IR <-- DR(opcode), AR <-- DR(addr)  (Decode instruction)
  |
  v
MAP to Execute Routine           (Branch based on opcode)

Summary Table

StepMicro-operationPurpose
1AR <- PCLoad instruction address
2DR <- M[AR]Read instruction from memory
2PC <- PC + 1Advance program counter
3IR <- DR(0-10)Store opcode in IR
3AR <- DR(11-15)Store operand address in AR
4MAPDecode and branch to execute routine

The FETCH routine is common to all instructions and is always executed at the beginning of every instruction cycle before the specific execute routine runs.

Open this answer on its own page โ†’

0 ยท 10 marks

What is micro-operation and micro-instruction? Create a symbolic and binary micro program for FETCH and ADD operation.[10]

--- A micro-operation is the most basic, elementary operation performed by the hardware of a computer during one clock pulse. It is an atomic operation carried out on the data stored in registers. Examples of micro-operations: - Transfer: R1 <- R2 - Increment: R1 <- R1 + 1 - Add: R3 <- R1 + R2 - ...

Open this answer on its own page โ†’

Microoperations definition and types

2079 ยท 5 marks

What is Microoperations? Explain the function of each following microoperations: AR โŸต PC, DR โŸต M[AR], PC โŸต PC+1, AR โŸต DR(0 - 10), CAR(2 - 5) โŸต DR(11 - 14) [5]

A microoperation is an elementary operation performed on the data stored in registers during one clock pulse. It is the most basic or atomic operation that a computer can perform on data stored in its registers. Microoperations are the building blocks of machine instructions and are classified in...

Open this answer on its own page โ†’

Control ROM and mapping table

2079 ยท 5 marks

Explain the use of mapping table. [5]

A mapping table is a data structure used in computer systems (particularly in memory management, file systems, and storage systems) to maintain a correspondence (mapping) between two sets of addresses or identifiers -- typically logical/virtual addresses and physical/real addresses. --- - In virt...

Open this answer on its own page โ†’

2078 ยท 7.5 marks

Write short notes one (among three attempt only two): a.) Control ROM Write short notes on : b.) Magnetic Disk Write short notes on : c.) Flynn's Classification [2.5+2.5+2.5]

Control ROM (Read-Only Memory) is a type of memory used in the control unit of a CPU to store microprograms (sequences of microoperations) that implement the machine instruction set. - It is a part of microprogrammed control unit design. - The control ROM stores microinstructions that define the ...

Open this answer on its own page โ†’