Skip to content
CS-404 · Computer Org. & Architecture/Quick Revision Short Notes

Computer Org. & Architecture (CS-404) - Unit 2 Short Notes

How unit 2 is examined

This unit covers instructions and their types, the fetch-execute cycle, and the two ways of building a control unit (hardwired and microprogrammed); the marks sit in hardwired vs microprogrammed, the instruction cycle, instruction types and control memory.

Basic Concept of Instruction

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. <mark>An instruction is a binary-coded command that tells the CPU which operation to perform (the opcode) and on which data (the operands).</mark>

Key points.

  1. An instruction has an opcode field, which names the operation, and one or more operand fields, which give registers, memory addresses or immediate values.
  2. A program is a sequence of instructions stored in memory and executed one after another under control of the program counter.
  3. Each instruction is broken into micro-operations, the elementary register-transfer steps that the control unit sequences.
  4. The set of all instructions a CPU understands is its instruction set, and it fixes what the programmer can ask the machine to do.

Instruction Types

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>

Definition. <mark>Computer instructions are classified by the kind of operation they perform into data transfer, arithmetic, logical, shift and rotate, program control, and input-output instructions.</mark>

Key points.

  1. Data transfer instructions move data between registers, memory and I/O without changing it, for example MOV R1,R2, LOAD R1,X, STORE X, PUSH, POP.
  2. Arithmetic instructions perform calculations on numbers, for example ADD, SUB, MUL, DIV, INC, DEC, NEG.
  3. Logical and bit-manipulation instructions work bit by bit, for example AND, OR, XOR, NOT, CLEAR, COMPLEMENT.
  4. Shift and rotate instructions move the bits of a word left or right, for example SHL, SHR, ROL, ROR, and are used for fast multiply or divide by 2.
  5. Program control (branch) instructions change the sequence of execution by loading the PC with a new address, for example JMP, JZ, CALL, RET, CMP.
  6. Input-output instructions transfer data between the CPU and peripherals, for example IN port, OUT port.
  7. By number of address fields, instructions are also zero-address (stack: ADD), one-address (accumulator: ADD X), two-address (ADD R1,R2) and three-address (ADD R1,R2,R3).

Answer frame. Open with the definition and the classification basis (operation performed); draw a table Class | Purpose | Example instruction; develop points 1-6 in that order with one example each; add point 7 as the format view; close with one line that the instruction set is the interface between hardware and programmer.

Asked: [7 marks] (May 2019) Give a suitable classification for computer instructions and give an example for each class. Asked: [14 marks] (Dec 2024) Write a short note on any two of: a) Instruction types, b) PCI Bus, c) Read Only Memory, d) Inter-processor communication and synchronization (write a) plus one more; PCI, ROM and IPC belong to Units 4 and 5).

Micro Instruction Formats

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. <mark>A microinstruction is one word in control memory whose bits specify the control signals to be issued in one clock period and how to find the next microinstruction; a set of microinstructions is a microprogram.</mark>

Diagram.

F1 F2 F3 CD BR AD
micro-operation field 1 micro-operation field 2 micro-operation field 3 condition select branch type next address

Key points.

  1. The micro-operation fields (F1, F2, F3) encode the control signals, such as register load, ALU function or memory read, to be activated in this step.
  2. The condition field (CD) selects the status bit (zero, carry, sign) that is tested for a branch.
  3. The branch field (BR) tells the sequencer how to get the next address: next in sequence, jump, call subroutine or return.
  4. The address field (AD) holds the branch target address in control memory.
  5. In horizontal format each control signal has its own bit, so the word is wide and fast but memory is large; in vertical format the signals are encoded into few bits and need decoders, so the word is short and memory is small but decoding makes it slower.

Asked: [8 marks] (Jun 2022) What is the format of Micro Instruction in Computer Architecture explain?

Fetch and Execution cycle

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>

Definition. <mark>The instruction cycle is the repeated sequence of fetching an instruction from memory, decoding it, fetching its operands, executing it and storing the result, which the CPU performs for every instruction.</mark>

Diagram.

<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u2-01" viewBox="0 0 492.8 252" width="492.8" height="252" role="img" aria-label="Instruction cycle. Fet = fetch instruction, Dec = decode, Ind = fetch operand (indirect address if needed), Exe = execute, Sto = store result, Int = check for interrupt then next instruction"><style>#dsfig-u2-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u2-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u2-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u2-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u2-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u2-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u2-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u2-01 .t{fill:#16181D;font-weight:500}#dsfig-u2-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u2-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u2-01 .dot{fill:#16181D}#dsfig-u2-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u2-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u2-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u2-01 .ah{fill:#454C5A}#dsfig-u2-01 .ah.hi{fill:#2340B8}#dsfig-u2-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u2-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u2-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u2-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u2-01 .e{stroke:#B1B7C3}html.dark #dsfig-u2-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u2-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u2-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u2-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u2-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u2-01 .t{fill:#E6E8ED}html.dark #dsfig-u2-01 .t.inv{fill:#0F1115}html.dark #dsfig-u2-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u2-01 .dot{fill:#E6E8ED}html.dark #dsfig-u2-01 .ann{fill:#8FA3FF}html.dark #dsfig-u2-01 .lbl{fill:#858D9C}html.dark #dsfig-u2-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u2-01 .ah{fill:#B1B7C3}html.dark #dsfig-u2-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u2-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u2-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u2-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah7" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh7" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M59,40 L122.2,40" marker-end="url(#ah7)"/><path class="e" d="M162.2,40 L225.4,40" marker-end="url(#ah7)"/><path class="e" d="M265.4,40 L328.6,40" marker-end="url(#ah7)"/><path class="e" d="M368.6,40 L431.8,40" marker-end="url(#ah7)"/><path class="e" d="M438.2,52.2 L262.5,198.6" marker-end="url(#ah7)"/><path class="e" d="M231.8,199.8 L56.1,53.4" marker-end="url(#ah7)"/><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">Fet</text><circle class="n" cx="143.2" cy="40" r="18"/><text class="t" x="143.2" y="40" dy=".35em" text-anchor="middle">Dec</text><circle class="n" cx="246.4" cy="40" r="18"/><text class="t" x="246.4" y="40" dy=".35em" text-anchor="middle">Ind</text><circle class="n" cx="349.6" cy="40" r="18"/><text class="t" x="349.6" y="40" dy=".35em" text-anchor="middle">Exe</text><circle class="n" cx="452.8" cy="40" r="18"/><text class="t" x="452.8" y="40" dy=".35em" text-anchor="middle">Sto</text><circle class="n" cx="246.4" cy="212" r="18"/><text class="t" x="246.4" y="212" dy=".35em" text-anchor="middle">Int</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Instruction cycle. Fet = fetch instruction, Dec = decode, Ind = fetch operand (indirect address if needed), Exe = execute, Sto = store result, Int = check for interrupt then next instruction</figcaption></figure>

Steps (fetch, in register transfers).

Step 1: T0: MAR <- PC                  (address of instruction goes to memory)
Step 2: T1: MDR <- M[MAR], PC <- PC+1  (memory read; PC points to next instruction)
Step 3: T2: IR <- MDR                  (instruction loaded into IR)
Step 4: T3: decode opcode in IR, control unit selects the operation
Step 5: T4...: fetch operands (MAR <- address, MDR <- M[MAR]); if indirect, read once more
Step 6: Tn: execute (ALU or transfer) and store the result in register or memory

Key points.

  1. The program counter (PC) always holds the address of the next instruction, and it is incremented during fetch so that execution continues in sequence.
  2. The memory address register (MAR) carries the address on the address bus, and the memory data register (MDR) receives the word over the data bus.
  3. The instruction register (IR) holds the fetched instruction while the control unit decodes it, so the opcode is not lost when the buses are reused.
  4. Decode means the control unit reads the opcode and works out which micro-operations and which addressing mode are needed.
  5. Operand fetch may need one more memory access when the address is indirect; register and immediate operands need none.
  6. Execution is done by the ALU or by a register transfer, and the result is written to a register or to memory (write-back).
  7. After each instruction the control unit checks for a pending interrupt; if there is none, the cycle repeats from fetch, and a branch simply loads a new value into the PC.
  8. The control unit generates every control signal, timed by the clock, that opens the right register to the bus at each step.

Answer frame. Open by defining an instruction (opcode plus operands) and the instruction cycle; draw the cycle diagram above with the interrupt check; then write the register-transfer steps T0-T3 for fetch, followed by points 4-7 for decode and execute; close with one line that the cycle repeats until the program halts.

Asked: [7 marks] (Jun 2020, Dec 2024) Explain the concepts of instruction and describe instruction cycle with neat diagram. Asked: [7 marks] (Dec 2024, Jun 2025) Discuss the sequence of steps involved in fetching an instruction from memory and executing it.

Hardwired control unit

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>

Definition. <mark>A hardwired control unit generates control signals with fixed combinational logic (gates, decoders, encoders and counters), so its behaviour is set by the wiring and can be changed only by redesigning the circuit.</mark>

Diagram.

<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u2-02" viewBox="0 0 467 252" width="467" height="252" role="img" aria-label="Hardwired control unit. IR = instruction register, Dec = instruction decoder, Enc = control signal encoder (combinational gates), CS = control signals out, Clk = clock, Ctr = step counter with timing decoder, Flg = flags and condition inputs"><style>#dsfig-u2-02 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u2-02 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u2-02 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u2-02 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u2-02 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u2-02 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u2-02 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u2-02 .t{fill:#16181D;font-weight:500}#dsfig-u2-02 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u2-02 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u2-02 .dot{fill:#16181D}#dsfig-u2-02 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u2-02 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u2-02 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u2-02 .ah{fill:#454C5A}#dsfig-u2-02 .ah.hi{fill:#2340B8}#dsfig-u2-02 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u2-02 .wl .t{font-size:12px;font-weight:700}#dsfig-u2-02 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u2-02 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u2-02 .e{stroke:#B1B7C3}html.dark #dsfig-u2-02 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u2-02 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u2-02 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u2-02 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u2-02 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u2-02 .t{fill:#E6E8ED}html.dark #dsfig-u2-02 .t.inv{fill:#0F1115}html.dark #dsfig-u2-02 .kd{stroke:#E6E8ED}html.dark #dsfig-u2-02 .dot{fill:#E6E8ED}html.dark #dsfig-u2-02 .ann{fill:#8FA3FF}html.dark #dsfig-u2-02 .lbl{fill:#858D9C}html.dark #dsfig-u2-02 .ptr{fill:#8FA3FF}html.dark #dsfig-u2-02 .ah{fill:#B1B7C3}html.dark #dsfig-u2-02 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u2-02 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u2-02 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u2-02 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah8" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh8" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M59,40 L148,40" marker-end="url(#ah8)"/><path class="e" d="M188,40 L277,40" marker-end="url(#ah8)"/><path class="e" d="M317,40 L406,40" marker-end="url(#ah8)"/><path class="e" d="M59,212 L148,212" marker-end="url(#ah8)"/><path class="e" d="M180.4,196.8 L285.4,56.8" marker-end="url(#ah8)"/><path class="e" d="M298,193 L298,61" marker-end="url(#ah8)"/><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">IR</text><circle class="n" cx="169" cy="40" r="18"/><text class="t" x="169" y="40" dy=".35em" text-anchor="middle">Dec</text><circle class="n" cx="298" cy="40" r="18"/><text class="t" x="298" y="40" dy=".35em" text-anchor="middle">Enc</text><circle class="n" cx="427" cy="40" r="18"/><text class="t" x="427" y="40" dy=".35em" text-anchor="middle">CS</text><circle class="n" cx="40" cy="212" r="18"/><text class="t" x="40" y="212" dy=".35em" text-anchor="middle">Clk</text><circle class="n" cx="169" cy="212" r="18"/><text class="t" x="169" y="212" dy=".35em" text-anchor="middle">Ctr</text><circle class="n" cx="298" cy="212" r="18"/><text class="t" x="298" y="212" dy=".35em" text-anchor="middle">Flg</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Hardwired control unit. IR = instruction register, Dec = instruction decoder, Enc = control signal encoder (combinational gates), CS = control signals out, Clk = clock, Ctr = step counter with timing decoder, Flg = flags and condition inputs</figcaption></figure>

Key points.

  1. The instruction register (IR) holds the current instruction, and its opcode bits are the input of the decoder.
  2. The instruction decoder converts the opcode into one active line per instruction, such as ADD or LOAD.
  3. The clock drives a step counter and timing decoder, which produce timing signals T1, T2, T3 to say which step of the instruction is running.
  4. The control signal encoder (control logic gates) combines the instruction lines, timing signals and flag inputs with AND-OR logic to produce each control signal.
  5. Each control signal is a Boolean function, for example $\text{PCout} = T_1 + T_4\cdot \text{BRANCH}$, so signals appear exactly at the right step of the right instruction.
  6. It is fast because signals pass only through gate delays, but the design is complex and any change to the instruction set needs redesign of the logic.
  7. It is used in RISC processors and fast, simple machines.

Comparison.

Basis Hardwired Microprogrammed
Method Fixed logic gates, decoders, counters Microprogram stored in control memory
Speed Faster, only gate delay Slower, control memory access each step
Flexibility Rigid, hard to change Easy to modify by changing the microprogram
Cost Costly and complex for large instruction sets Cheaper for complex instruction sets
Design Complex, irregular, error-prone Systematic and simple
Structure Combinational logic plus timing Control memory plus sequencer
Used in RISC, simple fast CPUs CISC, complex CPUs

Answer frame. Open by defining both control units in one line each; draw the hardwired block diagram and explain IR, decoder, timing counter, encoder and how signals are generated (points 1-5); then give the comparison table row by row; close with the trade-off: speed for hardwired, flexibility for microprogrammed.

Asked: [7 marks] (May 2019, Jun 2024) Differentiate hardwired and microprogrammed control units. Asked: [7 marks] (Jun 2024, Jun 2026) Differentiate between Hardwired control unit and Micro-programmed control unit. Asked: [7 marks] (Jun 2026) What is the Difference between hardwired and micro programmed control unit. Explain each component of hardwired control unit organization.

Micro-programmed Control unit

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. <mark>A microprogrammed control unit stores the control signals of every instruction as a microprogram in a control memory and generates them by reading microinstructions one after another.</mark>

Key points.

  1. Each machine instruction is executed by a small routine of microinstructions, found by mapping the opcode to a starting address in control memory.
  2. A control address register (CAR) holds the address of the current microinstruction, and a sequencer decides the next address.
  3. Changing or adding an instruction only means rewriting the microprogram, so the design is flexible and regular.
  4. It is slower than hardwired control because each step needs a control memory read, and it suits CISC machines.

microprogram sequencer

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. <mark>A microprogram sequencer is the circuit that generates the address of the next microinstruction in control memory, choosing between the next address in sequence, a branch, a subroutine call or return, and a mapped address from the opcode.</mark>

Diagram.

<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u2-03" viewBox="0 0 467 252" width="467" height="252" role="img" aria-label="Microprogram sequencer. Mux = multiplexer for next address, CAR = control address register, CM = control memory, CBR = control buffer register, Map = opcode mapping logic, Inc = increment CAR, Out = control signals"><style>#dsfig-u2-03 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u2-03 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u2-03 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u2-03 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u2-03 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u2-03 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u2-03 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u2-03 .t{fill:#16181D;font-weight:500}#dsfig-u2-03 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u2-03 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u2-03 .dot{fill:#16181D}#dsfig-u2-03 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u2-03 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u2-03 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u2-03 .ah{fill:#454C5A}#dsfig-u2-03 .ah.hi{fill:#2340B8}#dsfig-u2-03 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u2-03 .wl .t{font-size:12px;font-weight:700}#dsfig-u2-03 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u2-03 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u2-03 .e{stroke:#B1B7C3}html.dark #dsfig-u2-03 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u2-03 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u2-03 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u2-03 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u2-03 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u2-03 .t{fill:#E6E8ED}html.dark #dsfig-u2-03 .t.inv{fill:#0F1115}html.dark #dsfig-u2-03 .kd{stroke:#E6E8ED}html.dark #dsfig-u2-03 .dot{fill:#E6E8ED}html.dark #dsfig-u2-03 .ann{fill:#8FA3FF}html.dark #dsfig-u2-03 .lbl{fill:#858D9C}html.dark #dsfig-u2-03 .ptr{fill:#8FA3FF}html.dark #dsfig-u2-03 .ah{fill:#B1B7C3}html.dark #dsfig-u2-03 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u2-03 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u2-03 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u2-03 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah9" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh9" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M59,40 L148,40" marker-end="url(#ah9)"/><path class="e" d="M188,40 L277,40" marker-end="url(#ah9)"/><path class="e" d="M317,40 L406,40" marker-end="url(#ah9)"/><path class="e" d="M169,59 L169,191" marker-end="url(#ah9)"/><path class="e" d="M157.6,196.8 L52.6,56.8" marker-end="url(#ah9)"/><path class="e" d="M40,193 L40,61" marker-end="url(#ah9)"/><path class="e" d="M408,40 L61,40" marker-end="url(#ah9)"/><path class="e" d="M427,59 L427,191" marker-end="url(#ah9)"/><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">Mux</text><circle class="n" cx="169" cy="40" r="18"/><text class="t" x="169" y="40" dy=".35em" text-anchor="middle">CAR</text><circle class="n" cx="298" cy="40" r="18"/><text class="t" x="298" y="40" dy=".35em" text-anchor="middle">CM</text><circle class="n" cx="427" cy="40" r="18"/><text class="t" x="427" y="40" dy=".35em" text-anchor="middle">CBR</text><circle class="n" cx="40" cy="212" r="18"/><text class="t" x="40" y="212" dy=".35em" text-anchor="middle">Map</text><circle class="n" cx="169" cy="212" r="18"/><text class="t" x="169" y="212" dy=".35em" text-anchor="middle">Inc</text><circle class="n" cx="427" cy="212" r="18"/><text class="t" x="427" y="212" dy=".35em" text-anchor="middle">Out</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Microprogram sequencer. Mux = multiplexer for next address, CAR = control address register, CM = control memory, CBR = control buffer register, Map = opcode mapping logic, Inc = increment CAR, Out = control signals</figcaption></figure>

Key points.

  1. The sequencer sits between the instruction register and control memory, and its job is only to supply the correct address of the next microinstruction.
  2. The multiplexer selects one of the sources: CAR plus 1, the branch address in the microinstruction, the mapped address from the opcode, or the return address from the subroutine register.
  3. Status bits and the branch field decide the selection, so conditional branches are possible inside a microprogram.
  4. Working: CAR addresses control memory, the word is read into the control buffer register, its control fields go out as signals, and its next-address bits and branch field drive the multiplexer for the following address.

Asked: [7 marks] (Nov 2023) Micro-program sequencer

Control Memory

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. <mark>Control memory is the read-only memory inside the control unit that stores the microprograms; each word is a microinstruction, and the control unit reads and interprets these words to generate control signals.</mark>

Key points.

  1. A microinstruction is one control memory word specifying the micro-operations for one clock period, and a routine of them forms the microprogram for one machine instruction.
  2. Control memory is usually ROM (or writable control store), because the microprogram is fixed and must not be lost when power is off.
  3. Microinstructions of one routine are stored in consecutive addresses so that the CAR can simply increment, and branch or subroutine fields handle jumps.
  4. The arrangement may be horizontal, with one bit per control signal, giving a wide word and high parallelism, or vertical, with encoded fields, giving a short word and needing decoders.
  5. Interpretation: the opcode is mapped to the routine's start address and loaded into the CAR; the addressed word is read into the control buffer register; its fields are decoded into control signals which run the micro-operations.
  6. Next-address logic then chooses CAR plus 1, a branch address, or a return address, and the process repeats until the routine ends and control returns to the instruction fetch routine.

Answer frame. Open by defining microinstruction and control memory; draw control memory with CAR, decoder and control buffer register (same block as the sequencer figure); develop points 3-4 for arrangement and 5-6 for interpretation; close that the fetch routine is always the first microprogram executed.

Asked: [7 marks] (Dec 2024, Jun 2026) Describe how micro instructions are arranged in control memory and how they are interpreted?

Sequencing and Execution of Micro Instruction

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. <mark>Microinstruction sequencing is the process of generating the address of each successive microinstruction, and execution is the issuing of its control signals to perform its micro-operations.</mark>

Key points.

  1. A micro-operation is the elementary action, such as register transfer or ALU operation, that a microinstruction triggers.
  2. The sequencer starts every instruction by loading the mapped opcode address into the CAR; the fetch routine's address is loaded first.
  3. Next-address generation gives sequential execution (CAR plus 1), unconditional branch, conditional branch on a status bit, subroutine call and return.
  4. Execution steps: read the microinstruction from control memory, place it in the control buffer register, decode its fields into control signals, perform the micro-operations, then form the next address.
  5. At the end of the routine, an end-of-routine branch loads the address of the instruction fetch routine.

Asked: [7 marks] (Jun 2020) Explain sequencing and execution of micro instruction.

Last-minute revision

  • Instruction = opcode + operand(s); the CPU classes are data transfer, arithmetic, logical, shift, program control, I/O.
  • Instruction cycle = fetch, decode, operand fetch, execute, store, with an interrupt check.
  • Fetch: MAR <- PC; MDR <- M[MAR], PC <- PC+1; IR <- MDR.
  • Hardwired control = decoder + step counter + encoder gates; fast, rigid, used in RISC.
  • Microprogrammed control = control memory + sequencer; slower, flexible, used in CISC.
  • Microinstruction = control field + condition + branch + address field.
  • Horizontal format: wide word, one bit per signal, fast; vertical: encoded, short, slower.
  • CAR holds the address of the current microinstruction; control buffer register holds the word read.
  • Sequencer chooses next address: CAR+1, branch, mapped opcode address, or return.
  • Control memory is ROM (or writable control store) and stores the microprograms.

Memory hooks

  • Fetch order P-M-I: PC to MAR, Memory read, IR load.
  • Hardwired = Hard, Hasty, Hard to change; microprogrammed = Memory, Modifiable, Mildly slow.
  • Sequencer chooses among N-B-M-R: Next, Branch, Map, Return.
  • Horizontal = wide and quick; Vertical = tall (encoded) and thrifty.
  • Instruction classes D-A-L-S-C-I: Data, Arithmetic, Logic, Shift, Control, I/O.

Coverage checklist

  • Basic Concept of Instruction: definition of opcode and operand (also covered inside Q4).
  • Instruction Types: Q9 (May 2019), Q1 (Dec 2024).
  • Micro Instruction Formats: Q2 (Jun 2022).
  • Fetch and Execution cycle: Q4 (Jun 2020, Dec 2024), Q5 (Dec 2024, Jun 2025).
  • Hardwired control unit: Q6 (May 2019, Jun 2024), Q7 (Jun 2024, Jun 2026), Q8 (Jun 2026).
  • Micro-programmed Control unit: definition and comparison (Q6, Q7, Q8).
  • microprogram sequencer: Q11 (Nov 2023).
  • Control Memory: Q3 (Dec 2024, Jun 2026).
  • Sequencing and Execution of Micro Instruction: Q10 (Jun 2020).
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in