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.
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]
2079 ยท 5 marks
What do you mean by sequencer? Explain with microprogram sequencer. [5]
Show solved answerHide 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
-
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.
-
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.
-
Control Memory: Stores the microprogram (set of microinstructions). The microinstruction at the address given by CAR is read out.
-
Control Data Register (CDR): Holds the microinstruction fetched from control memory for execution.
Typical Sequencer Operations
The sequencer supports the following address sequencing operations:
| Operation | Description |
|---|---|
| Increment | CAR is incremented by 1 to fetch the next sequential microinstruction |
| Branch / Jump | CAR is loaded with a branch address from the microinstruction |
| Call Subroutine | Current CAR value is saved (pushed to stack) and a new address is loaded |
| Return from Subroutine | Saved address is popped from stack back into CAR |
| Load External Address | An external address (e.g., from mapping logic) is loaded into CAR |
| Push / Pop Stack | Stack 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.
2078 ยท 10 marks
Differentiate between hardwired and microprogrammed control unit. Describe with example of microprogram sequencer used in microprogrammed control unit.[10]
Control Memory
2080 ยท 5 marks
Write short notes on (any two): a. Control ROM b. Common Bus System c. Flynn's Classification [5]
Design of Control Unit
2079 ยท 10 marks
Describe micro-programmed control unit. Explain different types of addressing modes with example.[10]
Show solved answerHide 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:
- Control Memory (CM): Stores micro-instructions (micro-programs). Each location in control memory holds a micro-instruction that generates control signals.
- Control Address Register (CAR): Holds the address of the next micro-instruction to be fetched from control memory.
- Control Data Register (CDR) / Pipeline Register: Holds the micro-instruction fetched from control memory.
- 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
- The CAR holds the address of the current micro-instruction.
- The micro-instruction is fetched from control memory and placed in the CDR.
- The micro-instruction is decoded to produce control signals that drive the processor's data path.
- The sequencer computes the address of the next micro-instruction and loads it into the CAR.
- This process repeats for every machine instruction execution.
Comparison with Hardwired Control Unit
| Feature | Hardwired Control Unit | Micro-programmed Control Unit |
|---|---|---|
| Signal generation | Logic circuits (hardware) | Micro-instructions in memory |
| Speed | Faster | Slower |
| Modification | Difficult (hardware change) | Easy (update micro-program) |
| Cost | Expensive | Less expensive |
| Complexity | Cannot handle complex instructions | Can handle complex instructions |
| Used in | RISC processors | CISC 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
2077 ยท 5 marks
Differentiate between hardwired control unit and microprogrammed control unit. [5]
Show solved answerHide 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
| Basis | Hardwired Control Unit | Microprogrammed Control Unit |
|---|---|---|
| Signal Generation | Control signals are generated using hardware logic circuits | Control signals are generated using micro-instructions stored in control memory |
| Speed | Faster, since signals are produced directly by hardware | Slower, since micro-instructions must be fetched and decoded |
| Modifiability | Difficult to modify; changes require rewiring the hardware | Easy to modify; only the micro-instructions (software level) need to be changed |
| Cost | Expensive, as everything must be realized in terms of logic gates | Less expensive, as only micro-instructions are used |
| Complexity | Cannot handle complex instructions efficiently | Can handle complex instructions easily |
| Usage | Used in RISC (Reduced Instruction Set Computers) | Used in CISC (Complex Instruction Set Computers) |
| Storage | No control memory required | Requires 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.
2075 ยท 5 marks
Differentiate between hardwired control unit and a micro programmed control unit. [5]
2075.1 ยท 6 marks
Differentiate between hardwired control unit and microprogrammed control unit. [6]
Symbolic Microinstructions
2078 ยท 5 marks
Explain the symbolic microinstruction with example. [5]
Make Unit 4 stick
Practice CSC213 with flashcards & quizzes