Skip to main content

Command Palette

Search for a command to run...

Datapath and Control

Updated
β€’34 min read

The Basic Processing Unit is the brain of every computer. It fetches instructions from memory, decodes them, and executes the operations they specify. Whether you're running a simple addition or a complex algorithm, every operation flows through this fundamental unit.


Fundamental Concepts

Before diving into the datapath, let's establish the foundational concepts.

The Instruction Cycle

Every instruction goes through a predictable cycle:

PhaseDescription
FETCHProcessor fetches instruction from memory using the Program Counter (PC)
DECODEControl unit examines the opcode and determines the operation
EXECUTEProcessor performs the actual operation (arithmetic, logic, transfer)
WRITE BACKResults are written to registers or memory

Key Processor Registers

The processor uses several special-purpose registers:

RegisterFull NamePurposeVisibility
PCProgram CounterHolds address of the next instructionProgrammer visible
IRInstruction RegisterHolds the currently executing instructionProgrammer visible
MARMemory Address RegisterHolds address for memory accessInternal
MDRMemory Data RegisterBuffers data to/from memoryInternal
YTemporary RegisterHolds one ALU input operandInternal (transparent)
ZTemporary RegisterHolds ALU output resultInternal (transparent)
TEMPTemporary RegisterGeneral temporary storageInternal (transparent)

πŸ’‘ Note: Registers marked as "transparent" are invisible to the programmer β€” you don't need to worry about them when writing assembly code, but they're crucial for the processor's internal operation.

Register Transfers

The basic operation inside a processor is the register transfer β€” moving data from one register to another, often through the ALU. We express these transfers using a notation called Register Transfer Language (RTL).

Examples:

  • R1 ← [R2] means "copy the contents of R2 into R1"

  • R3 ← [R1] + [R2] means "add contents of R1 and R2, store result in R3"

  • PC ← [PC] + 4 means "increment PC by 4"


Single-Bus Datapath Organization

The simplest processor organization uses a single internal bus to connect all components. While slower than multi-bus designs, it's easier to understand and requires less hardware.

Single-Bus Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           SINGLE-BUS DATAPATH                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                            β”‚
β”‚                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                             β”‚
β”‚                        β”‚   Control Signals   β”‚                             β”‚
β”‚                        β”‚   from Control Unit β”‚                             β”‚
β”‚                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                             β”‚
β”‚                                   β”‚                                        β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚    β”‚                              β–Ό                                 β”‚      β”‚
β”‚    β”‚  ◄═══════════════════ INTERNAL BUS ═══════════════════════════►│      β”‚
β”‚    β”‚         β–²          β–²         β–²         β–²         β–²             β”‚      β”‚
β”‚    β”‚         β”‚          β”‚         β”‚         β”‚         β”‚             β”‚      β”‚
β”‚    β”‚    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”΄β”€β”€β”€β” β”Œβ”€β”€β”€β”΄β”€β”€β”€β” β”Œβ”€β”€β”€β”΄β”€β”€β”€β” β”Œβ”€β”€β”€β”΄β”€β”€β”€β”         β”‚      β”‚
β”‚    β”‚    β”‚   PC    β”‚ β”‚  IR   β”‚ β”‚  MAR  β”‚ β”‚  MDR  β”‚ β”‚R0-Rn-1β”‚         β”‚      β”‚
β”‚    β”‚    β”‚         β”‚ β”‚       β”‚ β”‚       β”‚ β”‚       β”‚ β”‚       β”‚         β”‚      β”‚
β”‚    β”‚    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜         β”‚      β”‚
β”‚    β”‚         β”‚                    β”‚         β”‚         β”‚             β”‚      β”‚
β”‚    β”‚         β”‚                    β–Ό         β–Ό         β”‚             β”‚      β”‚
β”‚    β”‚         β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚             β”‚      β”‚
β”‚    β”‚         β”‚              β”‚   Memory Bus      β”‚     β”‚             β”‚      β”‚
β”‚    β”‚         β”‚              β”‚   Interface       β”‚     β”‚             β”‚      β”‚
β”‚    β”‚         β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚             β”‚      β”‚
β”‚    β”‚         β”‚                        β”‚               β”‚             β”‚      β”‚
β”‚    β”‚         β”‚                        β–Ό               β”‚             β”‚      β”‚
β”‚    β”‚         β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚             β”‚      β”‚
β”‚    β”‚         β”‚              β”‚   Main Memory     β”‚     β”‚             β”‚      β”‚
β”‚    β”‚         β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚             β”‚      β”‚
β”‚    β”‚         β”‚                                        β”‚             β”‚      β”‚
β”‚    β”‚         β”‚          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚      β”‚
β”‚    β”‚         β”‚          β”‚                                           β”‚      β”‚
β”‚    β”‚         β”‚          β–Ό                                           β”‚      β”‚
β”‚    β”‚         β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                      β”‚      β”‚
β”‚    β”‚         β”‚     β”‚    Y    │◄── Temporary Register                β”‚      β”‚
β”‚    β”‚         β”‚     β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜    (Holds one ALU input)             β”‚      β”‚
β”‚    β”‚         β”‚          β”‚                                           β”‚      β”‚
β”‚    β”‚         β”‚          β–Ό                                           β”‚      β”‚
β”‚    β”‚         β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚      β”‚
β”‚    β”‚         β”‚   β”‚             β”‚      β”‚ Constant β”‚                  β”‚      β”‚
β”‚    β”‚         └──►│     MUX     │◄─────│    4     β”‚                  β”‚      β”‚
β”‚    β”‚             β”‚   (Select)  β”‚      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚      β”‚
β”‚    β”‚             β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                                    β”‚      β”‚
β”‚    β”‚                    β”‚                                           β”‚      β”‚
β”‚    β”‚                    β–Ό                                           β”‚      β”‚
β”‚    β”‚             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                    β”‚      β”‚
β”‚    β”‚             β”‚             β”‚                                    β”‚      β”‚
β”‚    β”‚             β”‚     ALU     │◄── Add, Sub, AND, OR, etc.         β”‚      β”‚
β”‚    β”‚             β”‚             β”‚                                    β”‚      β”‚
β”‚    β”‚             β”‚   Input A   │◄── From MUX (Y, Constant 4, etc.)  β”‚      β”‚
β”‚    β”‚             β”‚             β”‚                                    β”‚      β”‚
β”‚    β”‚             β”‚   Input B   │◄── ALWAYS from BUS                 β”‚      β”‚
β”‚    β”‚             β”‚             β”‚                                    β”‚      β”‚
β”‚    β”‚             β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                                    β”‚      β”‚
β”‚    β”‚                    β”‚                                           β”‚      β”‚
β”‚    β”‚                    β–Ό                                           β”‚      β”‚
β”‚    β”‚             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                    β”‚      β”‚
β”‚    β”‚             β”‚      Z      │◄── ALU Output Register             β”‚      β”‚
β”‚    β”‚             β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                                    β”‚      β”‚
β”‚    β”‚                    β”‚                                           β”‚      β”‚
β”‚    β”‚                    β–Ό                                           β”‚      β”‚
β”‚    β”‚  ◄═══════════════════════════════════════════════════════════► β”‚      β”‚
β”‚    β”‚                       INTERNAL BUS                             β”‚      β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚                                                                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Component Description

Internal Bus: A single shared pathway that connects all registers. Only ONE register can place data on the bus at any given time. The bus feeds directly into ALU Input B.

ALU (Arithmetic Logic Unit): Performs all arithmetic and logical operations. It has TWO inputs:

  • Input A: Comes from the multiplexer (can be Y register, constant 4, or other sources)

  • Input B: ALWAYS comes directly from the bus

This is crucial! Since the bus can only carry one value at a time, and the ALU needs two operands:

  • The first operand is saved in register Y

  • The second operand comes through the bus to Input B

  • Y feeds into the MUX, which routes to Input A

  • The ALU can then perform the operation: [Input A] op [Input B]

Multiplexer (MUX): Selects one of multiple inputs to feed into ALU Input A:

  • Select4: Choose constant 4 (for incrementing PC: 4 + PC from bus)

  • SelectY: Choose contents of register Y (for operations like R4 + R5)

Register Y: A temporary register that holds one operand. Since the bus can only carry one value at a time, we need Y to "remember" the first operand while we fetch the second through the bus.

Register Z: Holds the output of the ALU until it can be transferred to its destination via the bus.

Control Signals

The control unit generates signals that orchestrate data movement:

SignalMeaning
PCoutPlace PC contents on the bus
PCinLoad bus contents into PC
MARinLoad bus contents into MAR
MDRoutPlace MDR contents on the bus
MDRinLoad bus contents into MDR
IRinLoad bus contents into IR
YinLoad bus contents into Y
ZinLoad ALU result into Z
ZoutPlace Z contents on the bus
R1out, R2out, ...Place register contents on the bus
R1in, R2in, ...Load bus contents into register
ReadInitiate memory read operation
WriteInitiate memory write operation
Select4Select constant 4 for MUX
SelectYSelect Y register for MUX
AddALU performs addition
SubALU performs subtraction
WMFCWait for Memory Function Complete
EndSignals end of instruction execution

How PC + 4 Works in Single-Bus

This is a common point of confusion. Here's exactly what happens:

Step 1 Signals: PCout, MARin, Read, Select4, Add, Zin

  1. PCout β†’ PC value (e.g., 100) goes onto the bus

  2. MARin β†’ MAR captures the PC value from the bus (for instruction fetch)

  3. Simultaneously:

    • Select4 β†’ MUX routes constant 4 to ALU Input A

    • The bus carries PC to ALU Input B (Input B is always from bus!)

    • Add β†’ ALU computes: 4 + PC = 4 + 100 = 104

    • Zin β†’ Result (104) is stored in register Z

So we use the same bus value (PC) for two purposes in one clock cycle: sending to MAR for fetch, and feeding into the ALU for incrementing.


Single-Bus: Complete Instruction Examples

Let's trace through complete instructions to see how all components work together.

1. ADD R4, R5, R6 (Single-Bus)

Instruction: Add the contents of R4 and R5, store result in R6

RTL: R6 ← [R4] + [R5]

StepControl SignalsExplanationRTL
1PCout, MARin, Read, Select4, Add, ZinFetch begins: PC goes to MAR to fetch instruction. Simultaneously, constant 4 (Input A) and PC from bus (Input B) are added in ALU, result goes to Z.MAR ← [PC], Z ← [PC]+4
2Zout, PCin, Yin, WMFCUpdate PC and save it: Z (which contains PC+4) goes onto bus. PC is updated to point to next instruction. Crucially, we ALSO save this PC+4 value in Y just in case the instruction we're fetching is a branchβ€”we'll need this incremented PC value. Wait for memory.PC ← [Z], Y ← [Z]
3MDRout, IRinLoad instruction: Memory has delivered the instruction to MDR. Move it to IR for decoding.IR ← [MDR]
4R4out, YinSave first operand: R4 goes onto bus and is saved in Y. We need Y to hold R4 because the bus can only carry one value at a time, and we'll need R4 when we add it to R5.Y ← [R4]
5R5out, SelectY, Add, ZinPerform addition: R5 goes onto bus (to Input B). Y containing R4 is selected by MUX (to Input A). ALU adds them: R4 + R5. Result goes to Z.Z ← [Y] + [R5]
6Zout, R6in, EndStore result: Z goes onto bus, R6 captures it. Instruction complete.R6 ← [Z]

Key Points:

  • Step 2 stores PC+4 in Y even though this is an ADD instruction. This is standard practiceβ€”if it were a branch, we'd need that value.

  • Step 4-5 shows why Y is essential: we must save R4 in Y before bringing R5 to the bus, because the ALU needs both simultaneously.


2. Branch OFFSET (Unconditional) (Single-Bus)

Instruction: Branch to address PC + offset

RTL: PC ← [PC] + offset

StepControl SignalsExplanationRTL
1PCout, MARin, Read, Select4, Add, ZinFetch begins: Same as all instructionsβ€”PC to MAR for fetch, calculate PC+4 in ALU and store in Z.MAR ← [PC], Z ← [PC]+4
2Zout, PCin, Yin, WMFCUpdate and save PC: PC is updated to PC+4 (next sequential instruction). We save PC+4 in Y because we'll need it to calculate the branch target. Wait for memory.PC ← [Z], Y ← [Z]
3MDRout, IRinLoad branch instruction: Instruction delivered from memory to IR. Now we know it's a branch.IR ← [MDR]
4Offset-field-of-IRout, SelectY, Add, ZinCalculate branch target: The offset field from the instruction goes onto the bus (to Input B). Y containing PC+4 is selected (to Input A). ALU calculates: (PC+4) + offset. This is why we saved PC+4 in step 2! Result goes to Z.Z ← [Y] + [offset]
5Zout, PCin, EndJump to target: The calculated target address goes from Z onto bus and into PC. Next instruction will be fetched from this new address.PC ← [Z]

Key Points:

  • The branch target is calculated as (PC+4) + offset, which is why saving PC+4 in Y during step 2 is crucial.

  • This is a PC-relative branchβ€”the offset is relative to the already-incremented PC.


3. Load R1, 20(R2) (Single-Bus)

Instruction: Load from memory address [R2]+20 into R1

RTL: R1 ← [[R2] + 20]

StepControl SignalsExplanationRTL
1PCout, MARin, Read, Select4, Add, ZinFetch begins: Standard fetchβ€”PC to MAR, calculate PC+4.MAR ← [PC], Z ← [PC]+4
2Zout, PCin, Yin, WMFCUpdate PC: Update PC to point to next instruction, save in Y (in case we need it). Wait for memory to deliver instruction.PC ← [Z], Y ← [Z]
3MDRout, IRinLoad instruction: Instruction from memory moves to IR. Now we know it's a Load with offset addressing.IR ← [MDR]
4R2out, YinSave base address: R2 (base address) goes onto bus and is saved in Y. We need to save R2 because we'll add the offset to it in the next step.Y ← [R2]
5Offset-field-of-IRout, SelectY, Add, ZinCalculate effective address: The offset (20) from the instruction goes onto bus (to Input B). Y containing R2 is selected (to Input A). ALU calculates: R2 + 20. This is the memory address we want to read from. Result goes to Z.Z ← [Y] + 20
6Zout, MARin, ReadInitiate memory read: The effective address from Z goes to MAR. Start reading from memory at address [R2]+20.MAR ← [Z]
7WMFCWait for memory: Memory read takes timeβ€”wait for the data to arrive in MDR.-
8MDRout, R1in, EndLoad data into R1: Data from memory is now in MDR. Move it to R1. Instruction complete.R1 ← [MDR]

Key Points:

  • Steps 4-5 calculate the effective address using Y register to hold the base address.

  • Step 6-7 perform the actual memory readβ€”this is the second memory access (first was instruction fetch).

  • Total: 8 steps for a load instruction.


4. Store R1, 20(R2) (Single-Bus)

Instruction: Store R1 to memory address [R2]+20

RTL: [[R2] + 20] ← [R1]

StepControl SignalsExplanationRTL
1PCout, MARin, Read, Select4, Add, ZinFetch begins: Standard fetch sequenceβ€”PC to MAR for instruction fetch, calculate PC+4.MAR ← [PC], Z ← [PC]+4
2Zout, PCin, Yin, WMFCUpdate PC: Update PC to next instruction, save in Y. Wait for memory to deliver instruction.PC ← [Z], Y ← [Z]
3MDRout, IRinLoad instruction: Instruction delivered to IR. Now we know it's a Store with offset.IR ← [MDR]
4R2out, YinSave base address: R2 (base address) goes to Y. We need it to calculate the effective address.Y ← [R2]
5Offset-field-of-IRout, SelectY, Add, ZinCalculate effective address: Offset (20) on bus (to Input B), Y containing R2 to Input A. ALU calculates: R2 + 20. This is where we'll store the data. Result to Z.Z ← [Y] + 20
6Zout, MARinSend address to MAR: Effective address from Z goes to MAR. This is the memory location where we'll write.MAR ← [Z]
7R1out, MDRin, WriteInitiate memory write: R1 (the data to store) goes onto bus and into MDR. Start the memory write operation.MDR ← [R1]
8WMFC, EndWait for write to complete: Memory write takes time. Wait until it's done. Instruction complete.-

Key Points:

  • Very similar to Load, but we're writing instead of reading.

  • Step 7 moves the data from R1 into MDR and starts the write.

  • The effective address calculation (steps 4-6) is identical to Load.


Three-Bus Datapath Organization

The single-bus design is simple but slow β€” we can only do one transfer per clock cycle. A three-bus organization allows multiple simultaneous transfers, dramatically improving performance.

Three-Bus Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         THREE-BUS DATAPATH                                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                              β”‚
β”‚                                                                              β”‚
β”‚     ══════════════════════ BUS A (Source A) ═══════════════════════          β”‚
β”‚            β”‚                                                β”‚                β”‚
β”‚            β”‚                                                β”‚                β”‚
β”‚       β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”          β”‚
β”‚       β”‚                                                           β”‚          β”‚
β”‚       β”‚              REGISTER FILE (R0 - Rn-1)                    β”‚          β”‚
β”‚       β”‚                                                           β”‚          β”‚
β”‚       β”‚          Read Port A              Read Port B             β”‚          β”‚
β”‚       β”‚              β”‚                         β”‚                  β”‚          β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚                      β”‚                         β”‚                             β”‚
β”‚                      β”‚                         β”‚                             β”‚
β”‚     ══════════════════▼═══════════ BUS A ═══════▼══════════════              β”‚
β”‚                      β”‚                         β”‚                             β”‚
β”‚                      β”‚                         β”‚                             β”‚
β”‚                      β”‚     ══════════════════════▼══════════ BUS B           β”‚
β”‚                      β”‚     β”‚                    β”‚                            β”‚
β”‚                      β”‚     β”‚                    β”‚                            β”‚
β”‚                      β–Ό     β–Ό                    β”‚                            β”‚
β”‚                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚                            β”‚
β”‚                 β”‚                 β”‚             β”‚                            β”‚
β”‚                 β”‚      A L U      β”‚             β”‚                            β”‚
β”‚                 β”‚                 β”‚             β”‚                            β”‚
β”‚                 β”‚   Input A  β—„β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                            β”‚
β”‚                 β”‚            (from Bus A)                                    β”‚
β”‚                 β”‚                 β”‚                                          β”‚
β”‚                 β”‚   Input B  ◄────┼──────────────┐                           β”‚
β”‚                 β”‚            (from Bus B)        β”‚                           β”‚
β”‚                 β”‚                 β”‚              β”‚                           β”‚
β”‚                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚                           β”‚
β”‚                          β”‚                       β”‚                           β”‚
β”‚                          β”‚  ALU Result           β”‚                           β”‚
β”‚                          β”‚                       β”‚                           β”‚
β”‚     ═════════════════════▼═══════════════════════▼═══════ BUS C (Result) ══  β”‚
β”‚                          β”‚                       β”‚                           β”‚
β”‚                          β”‚                       β”‚                           β”‚
β”‚       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚       β”‚                  β”‚                       β”‚                  β”‚        β”‚
β”‚       β”‚        Write Port (from Bus C)           β”‚                  β”‚        β”‚
β”‚       β”‚                  β”‚                       β”‚                  β”‚        β”‚
β”‚       β”‚              REGISTER FILE               β”‚                  β”‚        β”‚
β”‚       β”‚                                          β”‚                  β”‚        β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                                                  β”‚                           β”‚
β”‚                                                  β”‚                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚                     SPECIAL REGISTERS & MEMORY                      β”‚     β”‚
β”‚  β”‚                                                                     β”‚     β”‚
β”‚  β”‚    β”Œβ”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                     β”‚     β”‚
β”‚  β”‚    β”‚ PC │◄────────│Incrementer│◄────── Bus C or Bus B               β”‚     β”‚
β”‚  β”‚    β””β”€β”€β”¬β”€β”˜         β”‚   (+4)    β”‚                                     β”‚     β”‚
β”‚  β”‚       β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                     β”‚     β”‚
β”‚  β”‚       β”‚ Address                                                     β”‚     β”‚
β”‚  β”‚       β”‚                                                             β”‚     β”‚
β”‚  β”‚    β”Œβ”€β”€β–Όβ”€β”    β”Œβ”€β”€β”€β”€β”                                                 β”‚     β”‚
β”‚  β”‚    β”‚MAR β”‚    β”‚ IR │◄───────── Bus B (R=B signal)                    β”‚     β”‚
β”‚  β”‚    β””β”€β”€β”¬β”€β”˜    β””β”€β”€β”€β”€β”˜                                                 β”‚     β”‚
β”‚  β”‚       β”‚                                                             β”‚     β”‚
β”‚  β”‚       β”‚ Memory Address                                              β”‚     β”‚
β”‚  β”‚       β”‚                                                             β”‚     β”‚
β”‚  β”‚       β–Ό                                                             β”‚     β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                    β”‚     β”‚
β”‚  β”‚  β”‚   MEMORY    β”‚                                                    β”‚     β”‚
β”‚  β”‚  β”‚             β”‚                                                    β”‚     β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                                                    β”‚     β”‚
β”‚  β”‚         β”‚                                                           β”‚     β”‚
β”‚  β”‚         β”‚ Memory Data                                               β”‚     β”‚
β”‚  β”‚         β”‚                                                           β”‚     β”‚
β”‚  β”‚    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”                                                      β”‚     β”‚
β”‚  β”‚    β”‚   MDR   │───────────► Bus B (MDRoutB signal)                   β”‚     β”‚
β”‚  β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                                      β”‚     β”‚
β”‚  β”‚                                                                     β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚                                                                              β”‚
β”‚                                                                              β”‚
β”‚  DATA FLOW SUMMARY:                                                          β”‚
β”‚  β€’ Bus A: Carries data from register file (Read Port A) to ALU Input A       β”‚
β”‚  β€’ Bus B: Carries data from register file (Read Port B) to ALU Input B       β”‚
│           Also used for special transfers (MDR→IR, PC→MAR, etc.)             │
β”‚  β€’ Bus C: Carries ALU results and other data to register file (Write Port)   β”‚
β”‚           Also feeds PC incrementer and can load special registers           β”‚
β”‚                                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Three-Bus Architecture: Detailed Explanation

The three-bus organization dramatically improves performance by allowing simultaneous data transfers on three separate buses:

Bus A (Source Bus A)

  • Purpose: Carries the first source operand from the register file to ALU Input A

  • Connected to: Register file Read Port A β†’ ALU Input A

  • Example: In R6 ← R4 + R5, Bus A carries R4 to ALU Input A

Bus B (Source Bus B)

  • Purpose: Carries the second source operand from the register file to ALU Input B

  • Also used for: Special register transfers (MDRβ†’IR, values to MAR, etc.)

  • Connected to:

    • Register file Read Port B β†’ ALU Input B

    • MDR β†’ Bus B (when MDRoutB is active)

    • Bus B β†’ IR, MAR (when R=B signal is active)

  • Example: In R6 ← R4 + R5, Bus B carries R5 to ALU Input B simultaneously with Bus A carrying R4

Bus C (Result/Destination Bus)

  • Purpose: Carries results back to the register file

  • Connected to:

    • ALU Output β†’ Bus C β†’ Register file Write Port

    • Bus C β†’ PC (for branches and updates)

    • Bus C β†’ PC Incrementer (for calculating PC+4)

  • Example: In R6 ← R4 + R5, Bus C carries the sum directly to R6

Key Components

Register File with Multiple Ports:

  • Read Port A: Simultaneously reads one register onto Bus A

  • Read Port B: Simultaneously reads another register onto Bus B

  • Write Port: Writes data from Bus C into a destination register

  • All three operations can happen in the same clock cycle!

PC Incrementer:

  • Dedicated hardware that adds 4 to PC

  • Can operate in parallel with ALU operations

  • Connected to Bus C or receives PC value directly

Special Register Transfers:

  • R=B signal: "Register equals Bus B" β€” loads a register from Bus B

  • MDRoutB: Places MDR contents on Bus B

  • Used for transfers like: MDRβ†’IR, PCβ†’MAR, etc.

Why Three Buses Are Faster

Single-Bus Limitation:

Step 1: R4 β†’ Bus β†’ Y        (save first operand)
Step 2: R5 β†’ Bus β†’ ALU      (bring second operand, Y feeds to ALU)
Step 3: ALU result β†’ Bus β†’ R6
Total: 3 steps minimum for any ALU operation

Three-Bus Advantage:

Step 1: R4 β†’ Bus A β†’ ALU Input A  }
        R5 β†’ Bus B β†’ ALU Input B  } ALL SIMULTANEOUS!
        ALU result β†’ Bus C β†’ R6   }
Total: 1 step for same operation!

Control Signals in Three-Bus

SignalMeaning
R4outAPlace R4 on Bus A
R5outBPlace R5 on Bus B
R6inLoad R6 from Bus C
R=BLoad destination register from Bus B (not Bus C)
MDRoutBPlace MDR contents on Bus B
Add, Sub, etc.ALU operation (result automatically goes to Bus C)
IncPCIncrement PC using dedicated incrementer
Read, WriteMemory operations
WMFCWait for Memory Function Complete

Advantages of Three-Bus Design

FeatureSingle-BusThree-Bus
Transfers per cycle1Up to 3
ALU operandsSequential (need Y register)Simultaneous (both at once)
Need for Y registerYes (essential)No (not needed for ALU ops)
Hardware complexityLowHigher
SpeedSlowerMuch Faster
Register file ports1 read, 1 write2 read, 1 write
PC incrementThrough ALUDedicated incrementer

Three-Bus: Complete Instruction Examples

Now let's see how the same instructions execute much faster on three-bus architecture.

1. ADD R4, R5, R6 (Three-Bus)

Instruction: Add the contents of R4 and R5, store result in R6

RTL: R6 ← [R4] + [R5]

StepControl SignalsExplanationRTL
1PCout, MARin, Read, IncPCFetch and increment: PC value goes to MAR to fetch instruction. The dedicated PC incrementer calculates PC+4 simultaneously and updates PC. No ALU needed!MAR ← [PC], PC ← [PC]+4
2WMFCWait for memory: Wait for instruction to be delivered from memory to MDR.-
3MDRoutB, R=B, IRinLoad instruction: MDR places instruction on Bus B, and IR loads it. The R=B signal indicates we're loading from Bus B (not Bus C).IR ← [MDR]
4R4outA, R5outB, Add, R6inExecute in ONE step! R4 goes on Bus A to ALU Input A. R5 goes on Bus B to ALU Input B. ALU adds them. Result goes on Bus C directly into R6. All simultaneous!R6 ← [R4] + [R5]

Key Points:

  • 4 steps total vs 6 steps in single-bus (33% faster!)

  • Step 4 is the magic: Both operands travel simultaneously to the ALU, and the result goes directly to destination

  • No Y register neededβ€”we don't have to save and retrieve operands

  • PC incrementer works in parallel, so incrementing PC doesn't consume an ALU cycle

Comparison:

  • Single-bus ADD: 6 steps (need to save R4 in Y, then fetch R5, then add, then store)

  • Three-bus ADD: 4 steps (fetch, wait, decode, execute all in one)


2. Branch OFFSET (Unconditional) (Three-Bus)

Instruction: Branch to address PC + offset

RTL: PC ← [PC] + offset

StepControl SignalsExplanationRTL
1PCout, MARin, Read, IncPCFetch and increment: PC to MAR for instruction fetch. PC incrementer calculates PC+4 and updates PC immediately.MAR ← [PC], PC ← [PC]+4
2WMFCWait for memory: Wait for branch instruction to be delivered to MDR.-
3MDRoutB, R=B, IRinLoad instruction: Instruction from MDR goes on Bus B to IR. Now we know it's a branch.IR ← [MDR]
4PCoutA, Offset-field-of-IRout-B, Add, PCinCalculate and load target: Current PC (already incremented to PC+4) goes on Bus A. Offset from instruction goes on Bus B. ALU adds: (PC+4) + offset. Result goes on Bus C directly into PC. Done in one step!PC ← [PC] + [offset]

Key Points:

  • 4 steps total vs 5 steps in single-bus

  • Step 4 calculates branch target in one cycleβ€”PC and offset go to ALU simultaneously

  • No need to save PC+4 in Y register like we did in single-bus

  • The incremented PC is still available when we need to add the offset


3. Load R1, 20(R2) (Three-Bus)

Instruction: Load from memory address [R2]+20 into R1

RTL: R1 ← [[R2] + 20]

StepControl SignalsExplanationRTL
1PCout, MARin, Read, IncPCFetch and increment: PC to MAR for instruction fetch. PC increments to PC+4 using dedicated incrementer.MAR ← [PC], PC ← [PC]+4
2WMFCWait for instruction: Wait for memory to deliver instruction to MDR.-
3MDRoutB, R=B, IRinLoad instruction: Instruction from MDR on Bus B goes to IR. Now we know it's a Load with offset.IR ← [MDR]
4R2outA, Offset-field-of-IRout-B, Add, MARinCalculate effective address: R2 (base address) goes on Bus A. Offset (20) goes on Bus B. ALU calculates: R2 + 20. Result goes on Bus C to MAR. All in one step!MAR ← [R2] + 20
5Read, WMFCRead from memory: Start memory read from the effective address. Wait for data to arrive in MDR.-
6MDRoutB, R=B, R1inLoad data: Data from MDR goes on Bus B to R1. Instruction complete.R1 ← [MDR]

Key Points:

  • 6 steps total vs 8 steps in single-bus (25% faster!)

  • Step 4 calculates effective address in one cycleβ€”base and offset added simultaneously

  • No need to save R2 in Y register first

  • The address calculation and transfer to MAR happen in the same cycle


4. Store R1, 20(R2) (Three-Bus)

Instruction: Store R1 to memory address [R2]+20

RTL: [[R2] + 20] ← [R1]

StepControl SignalsExplanationRTL
1PCout, MARin, Read, IncPCFetch and increment: PC to MAR for instruction fetch. PC increments to PC+4.MAR ← [PC], PC ← [PC]+4
2WMFCWait for instruction: Wait for memory to deliver instruction to MDR.-
3MDRoutB, R=B, IRinLoad instruction: Instruction from MDR goes to IR via Bus B. Now we know it's a Store.IR ← [MDR]
4R2outA, Offset-field-of-IRout-B, Add, MARinCalculate effective address: R2 on Bus A, offset (20) on Bus B. ALU calculates: R2 + 20. Result to MAR via Bus C. All simultaneous!MAR ← [R2] + 20
5R1outB, R=B, MDRin, WriteWrite to memory: R1 goes on Bus B (using R=B signal) to MDR. Start memory write operation.MDR ← [R1]
6WMFCWait for write: Wait for memory write to complete. Instruction done.-

Key Points:

  • 6 steps total vs 8 steps in single-bus (25% faster!)

  • Step 4 calculates effective address in one cycle, just like Load

  • Step 5 moves R1 to MDR and starts writeβ€”note we use R=B because we're transferring on Bus B, not Bus C

  • Address calculation is identical to Load; only the data transfer direction differs


Execution Time Comparison: Single-Bus vs Three-Bus

InstructionSingle-Bus StepsThree-Bus StepsSpeedup
ADD R4, R5, R66433% faster
Branch OFFSET5420% faster
Load R1, 20(R2)8625% faster
Store R1, 20(R2)8625% faster

Why the difference?

  • Three-bus eliminates the need to save/retrieve operands in Y register

  • Multiple simultaneous transfers reduce sequential dependencies

  • Dedicated PC incrementer eliminates ALU usage for PC+4

  • More parallelism = fewer clock cycles per instruction


Hardwired Control Unit

The hardwired control unit generates control signals using dedicated logic circuits. It's fast but inflexible.

Block Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        HARDWIRED CONTROL UNIT                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                            β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                             β”‚
β”‚    β”‚  CLK    │──────────────────────────────────┐                          β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                  β”‚                          β”‚
β”‚                                                 β–Ό                          β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚    β”‚  Reset  │───────►│         CONTROL STEP                β”‚              β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚           COUNTER                   β”‚              β”‚
β”‚                       β”‚                                     β”‚              β”‚
β”‚                       β”‚  Counts: T1, T2, T3, ... Tn         β”‚              β”‚
β”‚                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚                                      β”‚                                     β”‚
β”‚                                      β–Ό                                     β”‚
β”‚                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚                       β”‚         STEP DECODER                β”‚              β”‚
β”‚                       β”‚                                     β”‚              β”‚
β”‚                       β”‚    Outputs: T1  T2  T3 ... Tn       β”‚              β”‚
β”‚                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚                                      β”‚                                     β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚         β”‚                            β”‚                            β”‚        β”‚
β”‚         β”‚                            β–Ό                            β”‚        β”‚
β”‚         β”‚            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚        β”‚
β”‚         β”‚            β”‚                               β”‚            β”‚        β”‚
β”‚    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”       β”‚          ENCODER              β”‚       β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”   β”‚
β”‚    β”‚   IR    │──────►│                               │◄──────│Conditionβ”‚   β”‚
β”‚    β”‚(Opcode) β”‚       β”‚    Combinational Logic        β”‚       β”‚ Codes   β”‚   β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚    (AND, OR, NOT gates)       β”‚       β”‚ (N,Z,C) β”‚   β”‚
β”‚                      β”‚                               β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚                               β”‚       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚    β”‚Instruction      β”‚                               │◄──────│External β”‚   β”‚
β”‚    β”‚ Decoder │──────►│                               β”‚       β”‚ Inputs  β”‚   β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                      β”‚                                     β”‚
β”‚                                      β–Ό                                     β”‚
β”‚                      ════════════════════════════════════                  β”‚
β”‚                              CONTROL SIGNALS                               β”‚
β”‚                      ════════════════════════════════════                  β”‚
β”‚                           β”‚    β”‚    β”‚    β”‚    β”‚    β”‚                       β”‚
β”‚                           β–Ό    β–Ό    β–Ό    β–Ό    β–Ό    β–Ό                       β”‚
β”‚                         PCin PCout MARin Read Zin  ...                     β”‚
β”‚                                                                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

How It Works

  1. Control Step Counter: Counts clock cycles (T1, T2, T3...) during instruction execution

  2. Step Decoder: Converts counter value to one-hot encoding (only one Ti active)

  3. Instruction Decoder: Decodes opcode to identify the instruction type

  4. Encoder: Combinational logic that generates appropriate control signals

Generating the Zin Signal

The Zin signal (load ALU result into Z) is needed at different times for different instructions:

  • Step T1 for all instructions (during fetch, for PC+4)

  • Step T6 for ADD instruction (for storing sum)

  • Step T4 for Branch instruction (for branch target)

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚                             β”‚
        T1 ────────►│                             β”‚
                    β”‚                             β”‚
        T6 ─────┬──►│         OR Gate             │────► Zin
                β”‚   β”‚                             β”‚
        ADD ────┴──►│           β”Œβ”€β”€β”              β”‚
                    β”‚     ──────│& │──────        β”‚
        T4 ─────┬──►│           β””β”€β”€β”˜              β”‚
                β”‚   β”‚                             β”‚
        BR ─────┴──►│                             β”‚
                    β”‚                             β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Logic Expression: Zin = T1 + (T6 Β· ADD) + (T4 Β· BR) + ...

Generating the End Signal

The End signal terminates instruction execution. Different instructions end at different steps:

Logic Expression: End = (T7 Β· ADD) + (T5 Β· BR) + (T5 Β· N + T4 Β· NΜ„) Β· BRN + ...

For Branch<0 (BRN):

  • End at T5 if N=1 (branch taken)

  • End at T4 if N=0 (branch not taken)

Advantages and Disadvantages

βœ… Advantages:

  • Very fast operation (minimal delay through gates)

  • No memory access needed for control signals

  • Efficient for simple instruction sets (RISC)

  • Natural fit for pipelining

❌ Disadvantages:

  • Complex design for large instruction sets

  • Difficult to modify once manufactured

  • Higher design and debugging time

  • Inflexible β€” adding instructions requires complete redesign

  • Circuit complexity grows rapidly with instruction set size


Microprogrammed Control Unit

The microprogrammed control unit uses a small program (microprogram) stored in a special memory to generate control signals. Each instruction is implemented by a sequence of microinstructions.

Key Terminology

TermDefinition
Control WordA word whose bits represent individual control signals
MicroinstructionA single control word in the microprogram
MicroroutineSequence of microinstructions for one machine instruction
MicroprogramCollection of all microroutines stored in control memory
Control Store (CS)ROM/RAM that holds the microprogram
ΞΌPCMicro Program Counter β€” points to current microinstruction

Block Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      MICROPROGRAMMED CONTROL UNIT                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                             β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                              β”‚
β”‚    β”‚   IR    β”‚                                                              β”‚
β”‚    β”‚(Opcode) β”‚                                                              β”‚
β”‚    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜                                                              β”‚
β”‚         β”‚                                                                   β”‚
β”‚         β–Ό                                                                   β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                      β”‚
β”‚    β”‚    STARTING ADDRESS             β”‚                                      β”‚
β”‚    β”‚       GENERATOR                 β”‚                                      β”‚
β”‚    β”‚                                 β”‚                                      β”‚
β”‚    β”‚  Maps opcode to starting        β”‚                                      β”‚
β”‚    β”‚  address of microroutine        β”‚                                      β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                      β”‚
β”‚                 β”‚                                                           β”‚
β”‚                 β”‚  Starting Address                                         β”‚
β”‚                 β–Ό                                                           β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚    β”‚                                 β”‚         β”‚                   β”‚        β”‚
β”‚    β”‚           ΞΌPC                   │◄────────│    +1             β”‚        β”‚
β”‚    β”‚   (Micro Program Counter)       β”‚         β”‚  (Incrementer)    β”‚        β”‚
β”‚    β”‚                                 β”‚         β”‚                   β”‚        β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β”‚                 β”‚                                       β–²                   β”‚
β”‚                 β”‚  Address                              β”‚                   β”‚
β”‚                 β–Ό                                       β”‚                   β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚    β”‚                                                                 β”‚      β”‚
β”‚    β”‚                    CONTROL STORE (CS)                           β”‚      β”‚
β”‚    β”‚                                                                 β”‚      β”‚
β”‚    β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚      β”‚
β”‚    β”‚   β”‚ Address β”‚        Microinstruction                       β”‚   β”‚      β”‚
β”‚    β”‚   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚      β”‚
β”‚    β”‚   β”‚   000   β”‚  PCout, MARin, Read, Select4, Add, Zin        β”‚   β”‚      β”‚
β”‚    β”‚   β”‚   001   β”‚  Zout, PCin, Yin, WMFC                        β”‚   β”‚      β”‚
β”‚    β”‚   β”‚   002   β”‚  MDRout, IRin                                 β”‚   β”‚      β”‚
β”‚    β”‚   β”‚   003   β”‚  (Branch to microroutine based on opcode)     β”‚   β”‚      β”‚
β”‚    β”‚   β”‚   ...   β”‚  ...                                          β”‚   β”‚      β”‚
β”‚    β”‚   β”‚   025   β”‚  ADD microroutine starts here                 β”‚   β”‚      β”‚
β”‚    β”‚   β”‚   ...   β”‚  ...                                          β”‚   β”‚      β”‚
β”‚    β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚      β”‚
β”‚    β”‚                                                                 β”‚      β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚                                 β”‚                                           β”‚
β”‚                                 β”‚  Microinstruction                         β”‚
β”‚                                 β–Ό                                           β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚    β”‚                                                                 β”‚      β”‚
β”‚    β”‚                         DECODER                                 β”‚      β”‚
β”‚    β”‚            (if using encoded microinstructions)                 β”‚      β”‚
β”‚    β”‚                                                                 β”‚      β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚                                 β”‚                                           β”‚
β”‚                                 β–Ό                                           β”‚
β”‚                 ════════════════════════════════════                        β”‚
β”‚                         CONTROL SIGNALS                                     β”‚
β”‚                 ════════════════════════════════════                        β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Microinstruction Format

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       MICROINSTRUCTION FORMAT                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                            β”‚
β”‚  HORIZONTAL FORMAT (Wide):                                                 β”‚
β”‚  β”Œβ”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”¬β”€β”€β”             β”‚
β”‚  β”‚PCβ”‚PCβ”‚MAβ”‚MDβ”‚MDβ”‚IRβ”‚Y β”‚Z β”‚Z β”‚R1β”‚R1β”‚Seβ”‚Seβ”‚Adβ”‚Suβ”‚Reβ”‚Wrβ”‚WMβ”‚Enβ”‚  β”‚             β”‚
β”‚  β”‚ouβ”‚inβ”‚Riβ”‚Roβ”‚Riβ”‚inβ”‚inβ”‚inβ”‚ouβ”‚ouβ”‚inβ”‚l4β”‚lYβ”‚d β”‚b β”‚adβ”‚itβ”‚FCβ”‚d β”‚  β”‚             β”‚
β”‚  β”‚t β”‚  β”‚n β”‚utβ”‚n β”‚  β”‚  β”‚  β”‚t β”‚t β”‚  β”‚  β”‚  β”‚  β”‚  β”‚  β”‚e β”‚  β”‚  β”‚  β”‚             β”‚
β”‚  β”œβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€             β”‚
β”‚  β”‚ 1β”‚ 0β”‚ 1β”‚ 0β”‚ 0β”‚ 0β”‚ 0β”‚ 1β”‚ 0β”‚ 0β”‚ 0β”‚ 1β”‚ 0β”‚ 1β”‚ 0β”‚ 1β”‚ 0β”‚ 0β”‚ 0β”‚  β”‚             β”‚
β”‚  β””β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”΄β”€β”€β”˜             β”‚
β”‚                                                                            β”‚
β”‚  Each bit directly controls one signal - simple but WIDE                   β”‚
β”‚                                                                            β”‚
β”‚  ──────────────────────────────────────────────────────────────────────    β”‚
β”‚                                                                            β”‚
β”‚  VERTICAL FORMAT (Narrow):                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
β”‚  β”‚   F1       β”‚     F2     β”‚     F3     β”‚  Next Address  β”‚                 β”‚
β”‚  β”‚ (4 bits)   β”‚  (3 bits)  β”‚  (3 bits)  β”‚   (8 bits)     β”‚                 β”‚
β”‚  β”‚            β”‚            β”‚            β”‚                β”‚                 β”‚
β”‚  β”‚ Encoded    β”‚  Encoded   β”‚  ALU       β”‚  Branch        β”‚                 β”‚
β”‚  β”‚ Source     β”‚  Dest      β”‚  Function  β”‚  Target        β”‚                 β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚
β”‚                                                                            β”‚
β”‚  Requires decoder but uses less memory                                     β”‚
β”‚                                                                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Horizontal vs Vertical Microprogramming

AspectHorizontalVertical
WidthWide (many bits)Narrow (fewer bits)
EncodingNone (direct)Encoded fields
DecoderNot neededRequired
SpeedFasterSlower
Control Store SizeLargerSmaller
ParallelismHighLimited
FlexibilityLessMore

Microprogram Sequencing

The ΞΌPC typically increments automatically, but sometimes we need to branch:

When ΞΌPC changes:

  1. Normal: Increment by 1

  2. End of instruction: Load starting address of next instruction's microroutine

  3. Microbranch: Load branch target address

  4. Conditional microbranch: Load target only if condition is true

Example Microroutine for Add (R3), R1

AddressMicroinstructionComment
000PCout, MARin, Read, Select4, Add, ZinCommon fetch - step 1
001Zout, PCin, Yin, WMFCCommon fetch - step 2
002MDRout, IRin, BRANCHCommon fetch - step 3, then branch
.........
025R3out, MARin, ReadADD microroutine begins
026R1out, Yin, WMFCSave R1, wait for memory
027MDRout, SelectY, Add, ZinPerform addition
028Zout, R1in, EndStore result, end

Advantages and Disadvantages

βœ… Advantages:

  • Highly flexible and easy to modify

  • Can fix bugs by changing microcode

  • Simplifies design of complex instruction sets (CISC)

  • Can add new instructions without hardware changes

  • Easier debugging and testing

  • Supports complex addressing modes naturally

❌ Disadvantages:

  • Slower than hardwired (memory access overhead)

  • Requires control store memory

  • More complex to optimize for speed

  • Doesn't lend well to pipelining

  • Extra level of indirection adds delay


Hardwired vs Microprogrammed Comparison

Side-by-Side Comparison

CharacteristicHardwiredMicroprogrammed
ImplementationFixed logic circuitsStored microprogram
Speed⚑ Faster🐒 Slower
Flexibility❌ Inflexibleβœ… Highly flexible
ModificationRequires redesignChange microcode
ComplexityIncreases with instruction setManages complexity well
CostLower for simple ISALower for complex ISA
Design TimeLongerShorter
Bug FixesNew chip requiredMicrocode update
Typical UseRISC processorsCISC processors
Pipeliningβœ… Natural fit❌ Difficult

Visual Comparison

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    CONTROL UNIT COMPARISON                                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                             β”‚
β”‚   HARDWIRED                              MICROPROGRAMMED                    β”‚
β”‚                                                                             β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚   β”‚                   β”‚                  β”‚                   β”‚              β”‚
β”‚   β”‚  β”Œβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β” β”‚                  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚              β”‚
β”‚   β”‚  β”‚ AND β”‚  β”‚ OR  β”‚ β”‚                  β”‚   β”‚  Control  β”‚   β”‚              β”‚
β”‚   β”‚  β””β”€β”€β”¬β”€β”€β”˜  β””β”€β”€β”¬β”€β”€β”˜ β”‚                  β”‚   β”‚   Store   β”‚   β”‚              β”‚
β”‚   β”‚     β”‚        β”‚    β”‚                  β”‚   β”‚   (ROM)   β”‚   β”‚              β”‚
β”‚   β”‚  β”Œβ”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β” β”‚                  β”‚   β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜   β”‚              β”‚
β”‚   β”‚  β”‚     NOT      β”‚ β”‚                  β”‚         β”‚         β”‚              β”‚
β”‚   β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚                  β”‚   β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”   β”‚              β”‚
β”‚   β”‚         β”‚         β”‚                  β”‚   β”‚   ΞΌPC     β”‚   β”‚              β”‚
β”‚   β”‚  Fixed Logic      β”‚                  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚              β”‚
β”‚   β”‚  Circuits         β”‚                  β”‚                   β”‚              β”‚
β”‚   β”‚                   β”‚                  β”‚   Stored Program  β”‚              β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚             β”‚                                      β”‚                        β”‚
β”‚             β–Ό                                      β–Ό                        β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚   β”‚ Control Signals β”‚                    β”‚ Control Signals β”‚                β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β”‚
β”‚                                                                             β”‚
β”‚   Speed: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘                  Speed: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘              β”‚
β”‚   Flexibility: β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘               Flexibility: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘           β”‚
β”‚   Complexity handling: β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘          Complexity handling: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘    β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

When to Use Which?


Summary and Key Takeaways

The Big Picture

Key Concepts to Remember

  1. Datapath Components: The processor contains registers (PC, IR, MAR, MDR, general-purpose), ALU, and buses that connect them.

  2. Control Signals: Every data movement and operation is controlled by signals like PCout, MARin, Read, Add, etc.

  3. Single-Bus Architecture:

    • Only one data transfer per clock cycle

    • ALU Input A: From MUX (can select Y, constant 4, etc.)

    • ALU Input B: ALWAYS from the bus

    • Y register essential for saving first operand

    • Z register holds ALU result

    • PC+4 calculation: constant 4 (Input A) + PC from bus (Input B)

  4. Three-Bus Advantage:

    • Bus A and Bus B carry operands simultaneously to ALU

    • Bus C carries results back to registers

    • Dramatically reduces execution time (25-33% faster)

    • No Y register needed for basic ALU operations

    • Dedicated PC incrementer works in parallel

  5. Hardwired Control: Uses combinational logic to generate control signals. Fast but inflexible β€” suited for RISC.

  6. Microprogrammed Control: Uses a stored microprogram. Slower but flexible β€” suited for CISC.

  7. WMFC (Wait for Memory Function Complete): Synchronizes processor with slower memory operations.

  8. Y Register Purpose: In single-bus, Y holds the first operand while the second operand comes through the bus, allowing the ALU to have both inputs simultaneously.

Practice Problems

Try working through these to test your understanding:

  1. Write the control sequence for Sub R1, R2 (subtract R2 from R1, store in R1) using single-bus organization.

  2. How many clock cycles does Add (R3), R1 take on single-bus vs three-bus?

  3. Design the logic circuit to generate the Read signal for fetch and memory-reference instructions.

  4. Explain why microprogrammed control makes it easier to implement complex addressing modes.

  5. If a processor has 32 control signals, how wide would a horizontal microinstruction be? How could vertical encoding reduce this?

  6. In single-bus, why can't we do R6 ← R4 + R5 in one step? Trace through what would go wrong.

  7. For three-bus architecture, explain how the register file supports reading two registers simultaneously.

  8. Calculate the speedup if a program has 40% ALU instructions, 30% loads, 20% stores, and 10% branches when moving from single-bus to three-bus.


More from this blog

Jyotiprakash's Blog

251 posts

I'm Jyotiprakash, a software dev and professor at KIIT, with expertise in system programming.