Datapath and control
The datapath stores and transforms values. The control unit chooses transfers and their timing. A valid schedule must obey bus ownership, register-edge timing, ALU input availability and memory completion.
3.1 Register transfers and a single bus
Past papers · CS 2014–2026 (23 papers): 1 question, 1 mark
MAR holds a memory address; MDR buffers memory data. On a shared internal bus, assert at most one ordinary source output at a time. Several destination registers may latch the same bus value. A temporary register holds one ALU input while the bus supplies the other; an output register can hold the result for a later transfer.
A shared bus feeds an operand register and one ALU input; the result register drives the bus on a later cycle.
For a datapath with temporary operand register Y and ALU-result register Z, the execution of ADD R6, R2, R4 can be scheduled as follows. This excludes fetch; registers latch at cycle ends.
| Cycle | Asserted transfers | Value after the edge |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 |
A memory read needs address placement, request assertion, waiting until ready, then use of MDR. A write needs both MAR and MDR valid before the write completes. The instruction fetch path ends by loading IR. If PC increment uses the same ALU and bus, schedule those resources explicitly; a dedicated incrementer changes the schedule.
3.2 Register files and multiple buses
Past papers · CS 2014–2026 (23 papers): 1 question, 1 mark
A register file with two read ports and one write port can provide two independent operands and accept one result in a cycle. Separate source selectors feed separate read multiplexers; a write decoder and write enable select the destination. A common control arrangement is two source fields, one destination field, an ALU-function field, and write enable.
3.3 Hardwired control design
Hardwired control is a finite-state machine. State, decoded opcode, condition flags and external ready signals determine outputs and next state. Create a register-transfer sequence, assign states, then derive the control logic. State minimisation and Boolean minimisation methods: see the Digital Logic and Electronics handbook.
For the three-cycle ALU execute path in Section 3.1, one-hot states respectively load Y, calculate Z, and write the destination. If decoded instruction signals and are mutually exclusive, the add command is and the subtract command is ; , and destination write enable . This follows directly from the required transfer table; register selectors come from IR fields. These signals are Boolean, and the decoder is assumed to select a supported instruction before entering .
Consider a synchronous read request in state , followed by a ready-wait state , and IR loading in . Hold MAR stable while waiting. Request is issued in ; stay in until ready, then visit . This assumes the interface retains the outstanding request; interfaces requiring a held request need a different output equation.
3.4 Microprogrammed control design
A control store holds microinstructions. Its address register selects a control word; its data register holds the fetched microinstruction. A sequencer selects the next microaddress: sequential, branch target, opcode dispatch, or micro-subroutine return. A machine instruction usually invokes a sequence of microinstructions; the two words are not synonyms.
Horizontal control exposes separate bits and allows compatible actions to overlap. Encoded control compresses mutually exclusive actions and needs decoding. Grouped encoding still permits one action from each group concurrently. Neither style permits two incompatible drivers on one bus. Hardwired control avoids a control-store lookup; microprogramming makes a complex instruction sequence easier to change when the store is writable. Neither choice alone fixes ISA complexity or execution speed.
Last-minute recall
- One bus has at most one active ordinary data source at a time.
- Independent buses and register-file ports permit independent simultaneous transfers.
- MAR is an address; MDR is data; IR is an instruction.
- A memory-ready wait loop is part of the control sequence.
- Hardwired control is state and output logic, not just an opcode decoder.
- Microaddress bits and microinstruction width measure different things.
- Encoded control fields need a no-action code when all actions may be disabled.