CSC213 · 2079 · 5 marks
What do you mean by sequencer? Explain with microprogram sequencer.
What do you mean by sequencer? Explain with microprogram sequencer. [5]
Quick answer
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.
Sequencer and Microprogram Sequencer
Definition of Sequencer
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.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.