Hardwired Control Architecture
Hardwired Control Architecture
Instruction Register (Opcode) → Decoder
Clock + Counter → Timing Decoder
→ Combinational Logic Gates → Control Signals
Explanation
- Instruction bits, timing and status feed fixed control logic.
- Its outputs enable the hardware operations needed in that clock step.
Microprogrammed Control Flow
Microprogrammed Control Flow
Next Address Generator (Sequencer)
→ Control Address Register (CAR)
→ Control Memory (ROM)
→ Control Data Register (CDR) → Control Signals
Explanation
- A microinstruction produces control signals from the control store.
- Sequencing logic selects the address of the next microinstruction.
Data Path in General Register Organization
Data Path in General Register Organization
Registers (R₁-R₇) → MUX A & MUX B
→ Arithmetic Logic Unit (ALU)
→ Destination Decoder → Stored in Destination Register
Explanation
- Two source values travel from the register file to the ALU.
- The selected result returns to the destination register.
14-Bit Control Word Structure
14-Bit Control Word Structure
SELA (3 Bits)
Selects source register for Bus A
SELB (3 Bits)
Selects source register for Bus B
SELD (3 Bits)
Selects destination register to save result
OPR (5 Bits)
Selects ALU operation (ADD, SUB, AND, OR)
Explanation
- The control word selects source registers, the ALU operation and the destination.
- Its fields coordinate those choices during one register operation.
Stack Operations: PUSH vs. POP
Stack Operations: PUSH vs. POP
PUSH (Insert Item)
1. SP ← SP + 1
2. M[SP] ← DR
3. If SP = 0 → FULL ← 1
4. EMPTY ← 0
2. M[SP] ← DR
3. If SP = 0 → FULL ← 1
4. EMPTY ← 0
POP (Remove Item)
1. DR ← M[SP]
2. SP ← SP - 1
3. If SP = 0 → EMPTY ← 1
4. FULL ← 0
2. SP ← SP - 1
3. If SP = 0 → EMPTY ← 1
4. FULL ← 0
Explanation
- PUSH places a new value at the top of the stack.
- POP removes the current top, so the most recently pushed value comes out first.
Two ways to add a memory value
Two ways to add a memory value
Load-store instructions
Load the value, then add in registers
Memory operand
An arithmetic instruction may read a memory operand
Explanation
- A load-store machine brings the memory value into a register before arithmetic.
- An instruction set with memory operands may express that work in fewer instructions.
4-Stage Instruction Pipeline
4-Stage Instruction Pipeline
1. FI
Fetch Instruction
Fetch Instruction
➔ 2. DA
Decode & Address
Decode & Address
➔ 3. FO
Fetch Operand
Fetch Operand
➔ 4. EX
Execute & Store
Execute & Store
Explanation
- Different instructions occupy different pipeline stages at the same time.
- Once filled, the pipeline can finish work frequently even though one instruction uses several stages.
The Three Classes of Pipeline Hazards
The Three Classes of Pipeline Hazards
1. Structural Hazards
Hardware conflict: two stages try to access the same physical memory or bus at the same time.
2. Data Hazards
An instruction needs an answer from a previous instruction that has not finished calculating yet.
3. Control Hazards
Branch or jump instructions change the program counter, making fetched instructions useless.
Explanation
- A structural hazard is competition for hardware and a data hazard is a dependency.
- A control hazard arises when the next instruction address is uncertain.
Four instructions across seven clock cycles
Four instructions across seven clock cycles
| Instruction | Cycle 1 | Cycle 2 | Cycle 3 | Cycle 4 | Cycle 5 | Cycle 6 | Cycle 7 |
|---|---|---|---|---|---|---|---|
| I₁ | FI | DA | FO | EX | — | — | — |
| I₂ | — | FI | DA | FO | EX | — | — |
| I₃ | — | — | FI | DA | FO | EX | — |
| I₄ | — | — | — | FI | DA | FO | EX |
Explanation
- Each row follows one instruction through fetch, decode, operand fetch and execution.
- Reading down cycle four shows four different instructions using four different stages.