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.
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]
Microprogrammed control unit design
2082 ยท 5 marks
Write short notes on: (a) Microprogrammed Control Unit (b) Virtual Memory. [5]
Show solved answerHide 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
| Component | Function |
|---|---|
| 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 |
| Sequencer | Determines the next microinstruction address |
Working
- Machine instruction is fetched and decoded.
- The opcode maps to a starting address in control memory.
- Microinstructions are fetched sequentially, generating control signals.
- 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
| Benefit | Description |
|---|---|
| Larger address space | Programs can be larger than physical RAM |
| Multiprogramming | More processes can run simultaneously |
| Memory isolation | Each process has its own virtual address space |
| Simplified programming | Programmer need not manage physical memory |
Disadvantage
- Thrashing: If too many page faults occur, the system spends more time swapping than executing, severely degrading performance.
2080 ยท 5 marks
What do you understand by microprogrammed control computer? Explain main memory and control memory of microprogrammed controlled Computer. [5]
Hardwired control unit design and block diagram
2081 ยท 5 marks
What is control unit? Compare between microprogrammed and hardwired control unit. [5]
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]
2079 ยท 10 marks
Draw the block diagram of Hardwired control unit and explain their functional units in brief.[10]
0 ยท 5 marks
Differentiate between microprogrammed and hardwired control unit. [5]
Symbolic and binary microprogram representation
2081 ยท 5 marks
What is micro program? Write symbolic microprogram for FETCH operation. [5]
Show solved answerHide 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:
| Register | Purpose |
|---|---|
| PC | Program Counter |
| MAR | Memory Address Register |
| MBR / MDR | Memory Buffer / Data Register |
| IR | Instruction 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:
-
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.
-
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).
-
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.
2078 ยท 5 marks
What is micro-program? Write symbolic microprogram for FETCH operation. [5]
Show solved answerHide 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:
| Term | Meaning |
|---|---|
| Microoperation | A single atomic hardware operation (e.g., MAR โ PC) |
| Microinstruction | One step in the microprogram containing one or more microoperations |
| Microprogram | A complete sequence of microinstructions for one machine instruction |
| Control Memory | ROM/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:
- Transfer the content of PC to MAR (Memory Address Register)
- Initiate a memory read; increment PC
- Transfer the fetched instruction from MDR to IR (Instruction Register)
- 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:
| Step | Microinstruction | Description |
|---|---|---|
| 1 | MAR โ PC | The address of the next instruction (held in PC) is copied to MAR so memory can be addressed |
| 2 | MDR โ M[MAR] | Memory is read; the instruction at the address in MAR is placed in MDR |
| 2 | PC โ PC + 1 | PC is incremented to point to the next instruction (can be done in parallel with memory read) |
| 3 | IR โ MDR | The fetched instruction is transferred from MDR to the Instruction Register |
| 4 | DECODE IR | The 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.
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 answerHide 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):
| F1 | F2 | F3 | CD | BR | AD |
|---|---|---|---|---|---|
| 3 bits | 3 bits | 3 bits | 2 bits | 2 bits | 7 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:
| Feature | Description |
|---|---|
| Storage | Control Memory (ROM) |
| Written by | Hardware/System Designer |
| Purpose | Implements machine instructions |
| Execution | Sequential, 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:
- Reads the instruction from memory at the address given by the Program Counter (PC)
- Increments the PC
- Decodes the instruction
The control memory uses symbolic notation where each line represents one micro-instruction.
Registers Used
| Register | Purpose |
|---|---|
| AR | Address Register |
| PC | Program Counter |
| DR | Data Register |
| IR | Instruction Register |
| CAR | Control Address Register |
| SBR | Subroutine 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
| Step | Micro-operation | Purpose |
|---|---|---|
| 1 | AR <- PC | Load instruction address |
| 2 | DR <- M[AR] | Read instruction from memory |
| 2 | PC <- PC + 1 | Advance program counter |
| 3 | IR <- DR(0-10) | Store opcode in IR |
| 3 | AR <- DR(11-15) | Store operand address in AR |
| 4 | MAP | Decode 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.
0 ยท 10 marks
What is micro-operation and micro-instruction? Create a symbolic and binary micro program for FETCH and ADD operation.[10]
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]
Control ROM and mapping table
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]
Make Unit 3 stick
Practice BIT151 with flashcards & quizzes