BCS302 · COMPUTER ORGANIZATION AND ARCHITECTURE · Unit 3
Control Unit
Unit Scope & Exam Weightage: Unit 3 covers how the CPU coordinates instruction execution—from instruction formats and register-level micro-operations to Hardwired vs. Microprogrammed Control Units, Pipelining, and RISC/CISC. In AKTU 70-mark exams, 14 to 21 marks consistently come from this unit (typically 1–2 short 2-mark questions in Section A + 1–2 long 7-mark questions in Sections B & C).
Front Page: Importance-Wise Topic Roadmap (2023–26 PYQs)
| Priority | Topic (Exact Syllabus) | PYQs Asked | Marks Weightage | Tag |
|---|---|---|---|---|
| 1 | Hardwired vs. Microprogrammed Control & Microprogram Sequencing | 4 (2023-24, 2024-25, 2025-26) |
7m × 3 + 2m × 1 | Survival Mode Predicted |
| 2 | Pipelining (Stages, Speedup Numericals, Hazards & Parallelism) | 3 (2023-24, 2024-25, 2025-26) |
7m × 3 | High-Yield Numerical |
| 3 | Instruction Cycles & Sub-Cycles (Fetch, Decode, Indirect, Execute, Interrupt) | 2 (2023-24 ×2) |
7m + 2m | Core Concept |
| 4 | Micro-Operations (Register Transfer, Arithmetic, Logic, Shift) | 2 (2024-25, 2025-26) |
7m + 2m | Core Concept |
| 5 | Horizontal vs. Vertical Microprogramming | 1 (2024-25) |
7m | Easy Comparison |
| 6 | Instruction Types & Formats (3/2/1/0-Address) | 1 (2025-26) |
7m | Worked Examples |
| 7 | Reduced Instruction Set Computer (RISC vs. CISC) | 1 (2025-26) |
7m | Easy Comparison |
| 8 | Program Control & Execution of a Complete Instruction | Integrated in #1, #3, #4 | — | Supporting RTL |
2-Hour Last-Night Survival Checklist:
- Control Unit (#1 Priority): Practice the Hardwired Control Unit block diagram, Microprogram Sequencer diagram, and the 8-point Hardwired vs. Microprogrammed table.
- Pipeline Numericals (#2 Priority): Memorize , , Speedup , Efficiency , and the 3 Hazards (Structural, Data, Control).
- Quick 7-Mark Wins: Instruction Cycle 5-phase flowchart, 4 Micro-operation types with RTL, Horizontal vs. Vertical bit-layout SVG, and 3/2/1/0-address format conversion.
1. Instruction Types, Formats & Addressing
Instruction (2 Marks): A binary code stored in memory that directs the CPU to perform a specific operation. It consists of an Opcode (what to do), Operand / Address fields (where the data is), and an optional Mode bit (I) (direct vs. indirect addressing).
1.1 Generic Instruction Bit Layout
| Mode (I) 1 bit |
Opcode (Operation) 4–8 bits |
Address 1 (Operand / Reg) Register or Memory |
Address 2 (Operand / Dest) Optional |
|---|
- Mode bit (): Direct addressing (address field holds operand address); Indirect addressing (address field points to a memory location holding the Effective Address).
- Opcode: -bit opcode supports up to distinct operations.
1.2 Types of Instructions (Functional Classification)
- Data Transfer Instructions: Copy data between registers, memory, and stack without modifying values.
LOAD(Memory → Register/AC),STORE(Register/AC → Memory),MOV(Reg ↔ Reg),XCHG(Swap),IN/OUT(I/O ports),PUSH/POP(Stack).
- Data Manipulation Instructions: Transform data using the ALU.
- Arithmetic:
ADD,SUB,MUL,DIV,INC,DEC,NEG(2's complement),ADDC(add with carry). - Logical & Bit Manipulation:
AND,OR,XOR,NOT,CLR(clear bits),SET(set bits),TEST(bitwise AND setting flags only). - Shift & Rotate:
SHL,SHR(logical),ASHL,ASHR(arithmetic),ROL,ROR(circular),RCL,RCR(rotate through carry).
- Arithmetic:
- Program Control Instructions: Alter sequential execution (
PC) based on conditions or calls.JMP(Unconditional Jump),JZ/JNZ/JC(Conditional Branch),CMP(Compare viaA - Bflags),CALL(Jump to subroutine),RET(Return from subroutine).
- Machine & Interrupt Control:
HLT(Halt CPU),NOP(No Operation),EI/DI(Enable/Disable Interrupts),WAIT.
1.3 Instruction Formats (By Number of Address Fields)
Most CPUs fall into 3-Address, 2-Address, 1-Address (Accumulator), or 0-Address (Stack) organizations. Let's evaluate:
Worked Example: Evaluate using all 4 instruction formats (assuming memory operands ).
| Format | CPU Organization | Assembly Code for | Instructions | Memory/Word Trade-off |
|---|---|---|---|---|
| 3-Address | General-Purpose Registers | ADD R1, A, BADD R2, C, DMUL X, R1, R2 |
3 | Shortest program, longest instruction word (needs 3 address fields). |
| 2-Address | General-Purpose Registers (1st operand is overwritten) | MOV R1, AADD R1, BMOV R2, CADD R2, DMUL R1, R2MOV X, R1 |
6 | Balanced instruction length; used in x86 and many commercial CPUs. |
| 1-Address | Single Accumulator (AC) (implied 2nd operand & destination) |
LOAD AADD BSTORE TLOAD CADD DMUL TSTORE X |
7 | Short instruction word, but requires temporary memory T and extra memory traffic. |
| 0-Address | Stack (TOS = Top of Stack; postfix/RPN order) |
PUSH APUSH BADDPUSH CPUSH DADDMULPOP X |
8 | Arithmetic instructions (ADD, MUL) need zero address bits; only PUSH/POP carry addresses. |
1.4 Quick Addressing Modes Reference (Supports Instruction Formats)
- Immediate: Operand is inside the instruction itself (
MOV R1, #25). Fastest, no extra memory read. - Direct (Absolute): Address field = Effective Address ().
- Indirect: Address field points to memory containing ().
- Register / Register Indirect: Operand is in register , or .
- Indexed / Base-Register: (used for arrays) or (used for relocatable code).
- PC-Relative: (used for short loops and branches).
After-Topic PYQ:
- 2025-26 (Sec B Q2d, 7 Marks): "Explain different types of instructions. Explain various instruction formats with suitable examples."
2. Instruction Cycle, Sub-Cycles & Complete Execution
Instruction Cycle (2 Marks): The complete sequence of steps the CPU performs to fetch and execute a single machine instruction: Fetch → Decode → Indirect (optional) → Execute → Interrupt Check.
2.1 Five Phases of an Instruction Cycle
%%{init: {'theme': 'base', 'look': 'handDrawn', 'themeVariables': {'fontFamily': "'Nunito', sans-serif", 'fontSize': '17px', 'primaryColor': '#EFEAD6', 'primaryBorderColor': '#0F766E', 'lineColor': '#23211C'}}}%%
flowchart TD
F["1. Fetch Sub-Cycle<br/>MAR ← PC ; MBR ← M[MAR] ; PC ← PC + 1"] --> D["2. Decode Sub-Cycle<br/>IR ← MBR ; CU decodes Opcode & Mode (I)"]
D -->|"I = 1 (Indirect)"| IND["3. Indirect Sub-Cycle<br/>MAR ← IR[Addr] ; MAR ← M[MAR] (EA)"]
D -->|"I = 0 (Direct)"| E["4. Execute Sub-Cycle<br/>ALU / Memory Read-Write / Branch"]
IND --> E
E -->|"Interrupt Pending (IEN=1 & R=1)"| INT["5. Interrupt Sub-Cycle<br/>Save Return PC to Stack ; PC ← ISR Addr"]
E -->|"No Interrupt"| F
INT --> F
- Fetch Sub-Cycle ():
- :
MAR ← PC(Place instruction address on address bus). - :
MBR ← M[MAR],PC ← PC + 1(Read instruction from memory and pointPCto next instruction). - :
IR ← MBR(Move instruction into Instruction Register).
- :
- Decode Sub-Cycle ():
- Control Unit decodes
IR[Opcode]and inspects mode bitIand operand fields.
- Control Unit decodes
- Indirect Sub-Cycle (only if ):
MAR ← IR[Addr], thenMBR ← M[MAR], thenMAR ← MBRto obtain the true Effective Address (EA).
- Execute Sub-Cycle:
- Performs the actual operation depending on opcode (e.g., memory read + ALU add, store to memory, or update
PCfor branch).
- Performs the actual operation depending on opcode (e.g., memory read + ALU add, store to memory, or update
- Interrupt Sub-Cycle (at end of Execute):
- CPU checks if Interrupt Enable (
IEN) is set and an interrupt request (R = 1) is pending. - If yes:
MBR ← PC(save return address),MAR ← Save_Addr / SP,M[MAR] ← MBR,PC ← ISR_Address(jump to Interrupt Service Routine),IEN ← 0.
- CPU checks if Interrupt Enable (
2.2 Execution of a Complete Instruction (Single-Bus CPU Organization)
In a Single-Bus CPU, all registers (PC, MAR, MDR, IR, R0..Rn) and the ALU (via temporary registers Y and Z) share one internal data bus. Control signals (R_in, R_out, Read, Write, WMFC = Wait for Memory Function Completed) gate data onto/off the bus.
Complete Control Sequence for ADD (R3), R1 (Add contents of memory location pointed to by R3 to R1, store result in R1):
| Step | Action / Micro-Operation | Active Control Signals |
|---|---|---|
| 1 | MAR ← PC |
PC_out, MAR_in, Read, Select4, Add, Z_in |
| 2 | PC ← PC + 4, wait for memory |
Z_out, PC_in, Y_in, WMFC |
| 3 | IR ← MDR (Instruction loaded) |
MDR_out, IR_in |
| 4 | MAR ← R3 (Address of operand) |
R3_out, MAR_in, Read |
| 5 | Y ← R1, wait for memory |
R1_out, Y_in, WMFC |
| 6 | Z ← Y + MDR (ALU Add) |
MDR_out, SelectY, Add, Z_in |
| 7 | R1 ← Z, End instruction |
Z_out, R1_in, End |
2.3 Program Control & Status Flags (PSW)
Program Control instructions alter PC based on Processor Status Word (PSW) condition flags updated by the ALU:
-
Z(Zero): Set to1if ALU output . -
S/N(Sign/Negative): Copy of MSB of ALU result (1= negative in 2's complement). -
C(Carry): Set to1if carry-out from MSB occurs. -
V(Overflow): Set to1on signed overflow: . -
Subroutine Call (
CALL addr) & Return (RET):CALL:SP ← SP - 1; M[SP] ← PC; PC ← addrRET:PC ← M[SP]; SP ← SP + 1
After-Topic PYQs:
- 2023-24 (Sec C Q5a, 7 Marks): "Explain the different cycles of an instruction execution."
- 2023-24 (Sec A Q1c, 2 Marks): "What are the different phases of an instruction cycle?"
3. Micro-Operations (Register Transfer Level)
Micro-Operation (2 Marks): An elementary, atomic operation executed on data stored in one or more CPU registers during a single clock pulse (e.g., R3 ← R1 + R2). A macro-instruction is decomposed into a sequence of micro-operations.
3.1 Four Categories of Micro-Operations
| Category | Purpose | Key RTL Examples |
|---|---|---|
| 1. Register Transfer | Copy binary data between registers/memory unchanged | MAR ← PC, DR ← M[AR], M[AR] ← DR |
| 2. Arithmetic | Perform numeric operations on signed/unsigned integers | R3 ← R1 + R2, R3 ← R1 + R2' + 1 (Subtract), R1 ← R1 + 1, R1 ← R1 - 1 |
| 3. Logic | Bitwise manipulation treating each bit independently | R1 ← R1 ∧ R2 (AND), R1 ← R1 ∨ R2 (OR), R1 ← R1 ⊕ R2 (XOR), R1 ← R1' (NOT) |
| 4. Shift | Serial bit movement left/right inside a register | shl R1, shr R1, cil R1, cir R1, ashl R1, ashr R1 |
3.2 Important Logic Micro-Operations (4-Bit Worked Examples)
Suppose register A = 1010 and mask register B = 1100:
- Selective-Set (
A ← A ∨ B, OR): Sets bits inAwhereverBhas1.1010 ∨ 1100 = 1110
- Selective-Complement (
A ← A ⊕ B, XOR): Flips bits inAwhereverBhas1.1010 ⊕ 1100 = 0110
- Selective-Clear (
A ← A ∧ B'): Clears bits inAwhereverBhas1.1010 ∧ 0011 = 0010
- Mask (
A ← A ∧ B, AND): Clears bits inAwhereverBhas0(keeps only masked bits).1010 ∧ 1100 = 1000
- Clear (
A ← A ⊕ A): Resets registerAto0000.
3.3 Shift Micro-Operations (With Sign-Bit Rules)
Let 4-bit register R = 1011 (in signed 2's complement, MSB 1 = negative, value -5):
- Logical Shift (
shl/shr): Vacated bit filled with0.shl(1011) = 0110,shr(1011) = 0101(Note: MSB1lost — wrong for negative signed division!).
- Circular / Rotate (
cil/cir): Bit shifted out wraps around to the other end (no bits lost).cil(1011) = 0111,cir(1011) = 1101.
- Arithmetic Shift (
ashl/ashr): Preserves the sign bit for signed multiplication/division by 2.ashr(1011): Sign bit1stays at MSB and shifts right →1101(-3, divides signed number by 2).ashl(1011): Shifts left with0at LSB; overflow flag triggers if the sign bit changes!
After-Topic PYQs:
- 2025-26 (Sec C Q4a, 7 Marks): "What are micro-operations? Explain different types of micro-operations."
- 2024-25 (Sec A Q1e, 2 Marks): "Discuss the micro operations in computer architecture?"
4. Hardwired vs. Microprogrammed Control & Sequencing Survival Mode Predicted
This is the highest-weightage topic in Unit 3 (asked in 2023-24, 2024-25, and 2025-26).
4.1 Hardwired Control Unit
A Hardwired Control Unit generates control signals directly using fixed combinational logic circuits (gates, decoders, encoders, flip-flops). It acts as a hardware finite-state machine driven by the opcode, clock step counter, and status flags.
%%{init: {'theme': 'base', 'look': 'handDrawn', 'themeVariables': {'fontFamily': "'Nunito', sans-serif", 'fontSize': '17px', 'primaryColor': '#EFEAD6', 'primaryBorderColor': '#0F766E', 'lineColor': '#23211C'}}}%%
flowchart TD
IR["IR (Opcode & Mode I)"] --> IDEC["Instruction Decoder<br/>(Lines D0..Dk)"]
SC["Step Counter (SC)"] --> TDEC["Timing Decoder<br/>(Steps T0..Tn)"]
IDEC --> MAT["Combinational Control Matrix<br/>(AND / OR Gate Network)"]
TDEC --> MAT
FLG["Status Flags (Z, C, N, V)<br/>& External Inputs"] --> MAT
MAT --> OUT["Control Signals (C0..Ck)<br/>to CPU Registers, ALU & Bus"]
Components of Hardwired Control Unit (Write All 5 in 7-Mark Answers!)
- Instruction Register (
IR): Stores the fetched instruction; feeds opcode bits to the Instruction Decoder and mode bit to the logic matrix. - Instruction Decoder: An -to- decoder that activates a single instruction line () corresponding to the current opcode.
- Sequence Counter (
SC) & Timing Decoder: A modulo- counter (INRincrements each clock;CLRresets to0at end of instruction) feeding a timing decoder to produce . - Condition / Status Flags (
Z, C, N, V) & External Inputs: Allow conditional branching (e.g.,JZonly loadsPCifZ = 1). - Combinational Control Logic Matrix: Boolean AND/OR gate network combining to assert exact control signals, e.g.:
PC_out = T0MAR_in = T0 + D_LOAD · T3 + D_ADD · T3CLR_SC = D_ADD · T5 + D_JMP · T3
- Advantages: Maximum speed (pure combinational gate delay, no memory lookup); minimal silicon area for small ISAs (RISC).
- Disadvantages: Inflexible (adding/fixing an instruction requires physical hardware redesign); very complex Boolean minimization for large CISC instruction sets.
4.2 Microprogrammed Control Unit & Microprogram Sequencing
Microprogrammed Control Unit (2 Marks): A control unit where control signals are stored as binary control words (microinstructions) inside a special high-speed Control Memory (ROM/WCS). Executing a machine instruction means running a sequence of microinstructions called a microroutine.
Core Terminology
- Control Word: A binary string where bits represent active control signals for one clock cycle.
- Microinstruction: One word in Control Memory containing control bits + next-address/sequencing bits.
- Microroutine: A sequence of microinstructions implementing one machine-level instruction (e.g.,
ADDmicroroutine,FETCHmicroroutine). - Control Address Register (
CAR): Holds the address of the next microinstruction to be read from Control Memory. - Control Data Register (
CDR/MIR): Holds the currently fetched microinstruction while its control signals drive the CPU.
Microprogram Sequencer (How Complex Instructions Execute)
%%{init: {'theme': 'base', 'look': 'handDrawn', 'themeVariables': {'fontFamily': "'Nunito', sans-serif", 'fontSize': '17px', 'primaryColor': '#EFEAD6', 'primaryBorderColor': '#0F766E', 'lineColor': '#23211C'}}}%%
flowchart TD
EXT["IR Opcode<br/>Mapping Logic"] --> MUX["4-to-1 Address<br/>Selector MUX"]
INC["Incrementer<br/>(CAR + 1)"] --> MUX
SBR["Subroutine Reg<br/>(SBR)"] --> MUX
BRA["Branch Addr<br/>(from CMDR)"] --> MUX
MUX --> CAR["Control Address<br/>Register (CAR)"]
CAR --> CM["Control Memory<br/>(ROM / WCS)"]
CM --> CMDR["Control Data Reg<br/>(CMDR / MIR)"]
CMDR -->|"Control Bits"| SIG["Control Signals<br/>to CPU / ALU"]
CMDR -->|"Cond + Branch"| IL["Input Logic &<br/>Status MUX"]
FLAGS["CPU Flags<br/>(Z, C, N, V)"] --> IL
IL -->|"Select S1, S0"| MUX
Step-by-Step Working of Microprogram Sequencing:
- Fetch Microroutine: Starts at
CAR = 0. Sequencer usesCAR + 1to step throughMAR ← PC,MBR ← M[MAR]; PC ← PC + 1,IR ← MBR. - Opcode Mapping: At the end of Fetch, the Mapping Logic converts the
IRopcode (e.g., 4-bit opcode0101→ 7-bit control address0 0101 00) and loads it intoCARvia the MUX. - Microroutine Execution & Sequencing: For each microinstruction read into
CMDR, the Input Logic checks status flags (Z, C, N, V) and the microinstruction's condition bits to set MUX select lines , choosing the nextCARaddress from 4 sources:CAR + 1: Normal sequential step inside the microroutine.- Branch Address (
CMDR[Addr]): Conditional/unconditional jump within the microroutine (loops, e.g., iterativeMUL/DIV). - Subroutine Register (
SBR):CALLsavesCAR + 1intoSBRfor shared routines (like Effective Address calculation);RETrestoresSBRintoCAR. - External Mapping (
IR): Jumps back to the Fetch routine or next instruction's starting address.
4.3 Hardwired vs. Microprogrammed Control (8-Point Exam Table)
| Feature | Hardwired Control Unit | Microprogrammed Control Unit |
|---|---|---|
| Core Mechanism | Combinational logic gates, decoders, flip-flops | Microinstructions stored in Control Memory (ROM) |
| Speed | Fastest (gate propagation delay only) | Slower (Control Memory read cycle delay) |
| Flexibility / Updates | Rigid — requires hardware rewiring | Highly flexible — update microcode in ROM/WCS |
| Design Complexity | Very complex for large ISAs | Systematic, modular, software-like |
| Cost (for complex ISA) | High (many gates & interconnections) | Lower & regular ROM structure |
| Debugging & Testing | Difficult (must probe hardware) | Easy (simulate/patch microprograms) |
| Instruction Set Target | RISC (simple, fixed-length) | CISC (complex, multi-cycle instructions) |
| Chip Area | Smaller for simple ISAs | Requires dedicated Control Memory ROM |
After-Topic PYQs:
- 2025-26 (Sec C Q3b, 7 Marks): "Explain the design and working of a hardwired control unit. Discuss about its advantages and disadvantages."
Survival ModePredicted- 2024-25 (Sec C Q5b, 7 Marks): "Explain the concept of microprogram sequencing and how it enables the execution of complex instructions through a sequence of microinstructions?"
Survival ModePredicted- 2023-24 (Sec C Q5b, 7 Marks): "Differentiate between hardwired and micro programmed control unit. Explain each component of hardwired control unit organization."
Survival ModePredicted- 2023-24 (Sec A Q1d, 2 Marks): "How does control unit of a computer works?"
5. Horizontal vs. Vertical Microprogramming
Microinstructions are organized in Control Memory using two main encoding schemes:
Horizontal Microinstruction Format (Wide Word — No Decoder):
| C1 | C2 | C3 | ... | C48 (Direct 1-Bit Control Signals) | Cond Bits | Next Address |
|---|
Vertical Microinstruction Format (Compact Word — Needs Decoder):
| ALU Op (4 bits → 16 ops) | Reg Select (3 bits → 8 regs) | Branch / Cond (4 bits) |
|---|
- Horizontal Microprogramming: Each control signal gets its own dedicated bit (e.g., 48–100+ bits wide). Multiple independent micro-operations can fire simultaneously in one clock cycle without external decoders.
- Vertical Microprogramming: Mutually exclusive control signals are grouped and encoded into short -bit fields (e.g., 4 bits encode ALU ops), requiring external hardware decoders to expand them back into control lines.
| Feature | Horizontal Microprogramming | Vertical Microprogramming |
|---|---|---|
| Control Word Width | Long / Wide (many bits) | Short / Compact (fewer bits) |
| External Decoders | Not required (direct 1-bit/signal) | Required (-to- decoders) |
| Parallelism | High (many signals active at once) | Low (1 encoded op per field) |
| Execution Speed | Faster (no decoder delay) | Slower (decoder propagation delay) |
| Control Memory Size | Large (wastes bits when signals are 0) |
Small (memory efficient) |
| Ease of Programming | Harder to write manually | Easier (looks like assembly fields) |
Bonus Examiner Point: Mention Nanoprogramming (2-level control memory): compact vertical microinstructions in Control Memory point to wide horizontal nanoinstructions in a small Nano-Memory, saving ROM space while keeping horizontal speed.
After-Topic PYQ:
- 2024-25 (Sec B Q2c, 7 Marks): "Describe the concept of horizontal and vertical microprogramming in control unit design?"
6. Instruction Pipelining, Hazards & Parallel Processing
Instruction Pipelining (2 Marks): An implementation technique where multiple instructions are overlapped in execution—like an assembly line—by dividing the datapath into independent stages separated by inter-stage pipeline registers.
6.1 The 5 Classic Pipeline Stages & Pipeline Registers
- IF (Instruction Fetch): Fetch instruction from I-Cache using
PC; updatePC ← PC + 4. (Writes toIF/IDregister). - ID (Instruction Decode & Register Read): Decode opcode in
IRand read source registers (R1,R2). (Writes toID/EXregister). - EX (Execute / Address Calculation): ALU computes arithmetic/logic result or Effective Address (
Base + Offset). (Writes toEX/MEMregister). - MEM (Memory Access):
LOADreads data from D-Cache;STOREwrites data to D-Cache; other instructions pass through. (Writes toMEM/WBregister). - WB (Write Back): Write ALU result or loaded memory data back into destination register.
6.2 5-Stage Pipeline Space-Time Diagram
| Instruction | T1 | T2 | T3 | T4 | T5 | T6 | T7 |
|---|---|---|---|---|---|---|---|
| Inst 1 | IF | ID | EX | MEM | WB | — | — |
| Inst 2 | — | IF | ID | EX | MEM | WB | — |
| Inst 3 | — | — | IF | ID | EX | MEM | WB |
Pipeline Performance Formulas ( stages, instructions, clock cycle ):
As , ideal maximum speedup and throughput .
6.3 Pipeline Hazards & Mitigation Techniques
- Structural Hazard (Resource Conflict): Two instructions in different stages need the same hardware simultaneously (e.g.,
IFfetching an instruction andMEMreading data from a single shared memory).- Solutions: Separate Instruction Cache (
I-Cache) & Data Cache (D-Cache) (Harvard architecture), dual-port register file, or insert 1 stall cycle.
- Solutions: Separate Instruction Cache (
- Data Hazard (Data Dependency): An instruction needs a register value not yet written back by an earlier in-flight instruction.
- RAW (Read After Write — True Dependency):
I1: ADD R1, R2, R3followed byI2: SUB R4, R1, R5(I2readsR1beforeI1writesR1). - WAR (Write After Read — Anti-Dependency):
I2writes a register beforeI1reads it (occurs in out-of-order execution). - WAW (Write After Write — Output Dependency):
I2writes same destination register beforeI1finishes writing. - Solutions: Operand Forwarding / Bypassing (route
EX/MEMorMEM/WBoutput directly back to ALU input), Pipeline Stalls (NOPbubbles) for Load-Use hazards, and Compiler Instruction Scheduling.
- RAW (Read After Write — True Dependency):
- Control / Branch Hazard: A branch instruction (
JMP,BEQ) changesPC, making already-fetched sequential instructions invalid.- Solutions: Pipeline Flush / Freeze, Delayed Branching (fill delay slot with independent instruction), Static/Dynamic Branch Prediction (1-bit / 2-bit saturating counter + Branch Target Buffer).
6.4 Parallel Processing Overview (Flynn's Classification)
To scale beyond a single pipeline, processors use Parallel Processing:
- SISD (Single Instruction, Single Data): Conventional sequential uniprocessor.
- SIMD (Single Instruction, Multiple Data): Vector/array processors & GPU cores applying one instruction across many data elements simultaneously.
- MISD (Multiple Instruction, Single Data): Theoretical / fault-tolerant redundant pipelines.
- MIMD (Multiple Instruction, Multiple Data): Modern multi-core CPUs and multiprocessors executing independent threads simultaneously.
After-Topic PYQs:
- 2025-26 (Sec C Q3a, 7 Marks): "Explain instruction pipelining. A pipeline has 5 stages and each stage takes 20 ns. (i) Calculate the time required to execute 10 instructions without pipelining. (ii) Calculate the execution time with pipelining. (iii) Find the speedup."
- 2024-25 (Sec C Q3a, 7 Marks): "Provide a detailed overview of processor organization, covering topics such as instruction fetch, decode, execute cycles, pipelining, and parallel processing techniques?"
- 2023-24 (Sec B Q2c, 7 Marks): "What is pipelining? What are the different stages of pipelining? Explain in detail."
7. RISC vs. CISC Architecture
RISC (Reduced Instruction Set Computer): A CPU architecture built around a small, highly optimized set of fixed-length instructions that execute in a single clock cycle using hardwired control and Load/Store memory access.
7.1 Key Features & Advantages of RISC
- Fixed-Length Instructions (typically 32 bits) → fast, uniform decoding (
1cycle). - Load/Store Architecture: Only
LOADandSTOREaccess memory; all ALU operations work purely on registers. - Large Register File & Register Windowing: Overlapping register windows pass parameters between
CALL/RETwithout pushing/popping to slow memory. - Hardwired Control Unit: No Control Memory overhead; enables high clock speeds and deep pipelining.
- Simple Addressing Modes: Usually 3–5 basic modes (Register, Immediate, Base+Offset).
7.2 RISC vs. CISC (10-Point Comparison Table)
| Feature | RISC (Reduced Instruction Set) | CISC (Complex Instruction Set) |
|---|---|---|
| Instruction Set Size | Small (30–100 simple instructions) | Large (200–400+ complex instructions) |
| Instruction Length | Fixed (e.g., 32 bits) | Variable (e.g., 1 to 15 bytes) |
| Control Unit | Hardwired | Microprogrammed |
| Memory Access | Load/Store only | Direct memory-to-memory operations |
| Cycles per Instruction | Mostly 1 cycle (CPI ≈ 1) |
Multi-cycle (CPI > 1) |
| Register Count | Large (32–128+ general registers) | Small (8–16 general registers) |
| Addressing Modes | Few (3–5) | Many (12–24) |
| Pipelining | Very easy & high efficiency | Complex due to variable lengths |
| Code Density | Lower (more instructions per task) | Higher (fewer, denser instructions) |
| Compiler vs. Hardware | Shifts complexity to Compiler | Shifts complexity to Hardware |
| Examples | ARM, MIPS, RISC-V, SPARC | Intel x86, Motorola 68000, VAX |
After-Topic PYQ:
- 2025-26 (Sec B Q2e, 7 Marks): "Explain the concept of RISC architecture. Discuss its features and advantages. Compare RISC with CISC architecture."
Solved Exam-Ready Questions
Solved Q1 (2025-26 Sec C Q3a — 7 Marks | Pipeline Numerical)
Q: Explain instruction pipelining. A pipeline has 5 stages and each stage takes 20 ns. (i) Calculate the time required to execute 10 instructions without pipelining. (ii) Calculate the execution time with pipelining. (iii) Find the speedup.
Solution:
- Instruction Pipelining: Splitting instruction execution into independent stages (
IF,ID,EX,MEM,WB) separated by pipeline registers so multiple instructions overlap simultaneously. - Given: stages, , instructions.
- (i) Execution time without pipelining:
- (ii) Execution time with pipelining:
- (iii) Speedup () & Efficiency ():
Solved Q2 (Non-Uniform Stage Pipeline with Latch Delay — 7 Marks | Practice Numerical)
Q: A 4-stage pipeline has stage delays of 15 ns, 20 ns, 25 ns, 18 ns and an inter-stage latch delay of 2 ns. Find the clock period , execution time for 100 instructions, and speedup over a non-pipelined 78 ns CPU.
Solution:
- Clock period (): Determined by the slowest stage plus latch overhead:
- Pipelined execution time for instructions ():
- Non-pipelined execution time:
- Speedup ():
Solved Q3 (2023-24 Sec C Q5b — 7 Marks | Survival Mode)
Q: Differentiate between hardwired and microprogrammed control unit. Explain each component of hardwired control unit organization.
Answer Structure (Examiner Key Points):
- Comparison Table (8 points: Mechanism, Speed, Flexibility, Complexity, Cost, Debugging, Target ISA, Area — see Section 4.3).
- Hardwired Control Unit Block Diagram (draw Section 4.1 SVG).
- 5 Components Explained:
- Instruction Register (
IR): Supplies opcode & mode bitI. - Instruction Decoder: Converts -bit opcode into instruction lines ().
- Sequence Counter (
SC) & Timing Decoder: Generates clock timing steps . - Status Flags (
Z, C, N, V): Enable conditional execution & branching. - Combinational Control Matrix: AND/OR gate network generating control outputs .
- Instruction Register (
Solved Q4 (2024-25 Sec C Q5b — 7 Marks | Survival Mode)
Q: Explain the concept of microprogram sequencing and how it enables the execution of complex instructions through a sequence of microinstructions?
Answer Structure:
- Concept: Complex instructions (e.g.,
MUL, string/memory ops) are broken into a microroutine of elementary microinstructions stored in Control Memory (ROM). - Sequencer Block Diagram (draw Section 4.2 Mermaid diagram:
MUX→CAR→Control Memory→CMDR+Input Logic+SBR). - 4 Sequencing Mechanisms:
- Increment (
CAR + 1): Sequential step execution. - Branching (Conditional/Unconditional): Loops and flag-based jumps inside complex microroutines.
- Subroutine Call/Return (
SBR): Reuses common sub-sequences (like Effective Address fetch). - Opcode Mapping: Maps
IRopcode to the starting address of the instruction's microroutine.
- Increment (
Solved Q5 (2025-26 Sec B Q2d — 7 Marks | Instruction Formats)
Q: Evaluate using 3-address, 2-address, 1-address, and 0-address instruction formats.
Solution:
- 3-Address:
SUB R1, A, B;MUL R2, D, E;ADD R2, R2, C;DIV Y, R1, R2(4 instructions) - 2-Address:
MOV R1, A;SUB R1, B;MOV R2, D;MUL R2, E;ADD R2, C;DIV R1, R2;MOV Y, R1(7 instructions) - 1-Address (
AC):LOAD D;MUL E;ADD C;STORE T;LOAD A;SUB B;DIV T;STORE Y(8 instructions) - 0-Address (Stack):
PUSH A;PUSH B;SUB;PUSH C;PUSH D;PUSH E;MUL;ADD;DIV;POP Y(10 instructions)
Practice Questions (Self-Test)
- (2 Marks) Define control word, microroutine, and control memory.
- (2 Marks) Given
R = 1011, show the 4-bit outputs forshl R,cir R, andashr R. (Ans:0110,1101,1101) - (2 Marks) List the 3 types of pipeline hazards and one hardware/software fix for each.
- (7 Marks) Explain selective-set, selective-complement, selective-clear, and mask micro-operations with
A = 1101andB = 1010. - (7 Marks) Explain Single-Bus CPU organization and write the step-by-step control sequence for executing
LOAD R1, (R2). - (7 Marks — Numerical) A 6-stage instruction pipeline operates at (). Calculate the speedup and throughput for executing
50instructions compared to a non-pipelined processor taking24 nsper instruction. (Hint: , , .)