Chapter 3

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.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.

CycleAsserted transfersValue after the edge
1R2out,YinR2_{out},Y_{in}Y←R2Y\leftarrow R2
2R4out,ALUadd,ZinR4_{out},\mathrm{ALUadd},Z_{in}Z←Y+R4Z\leftarrow Y+R4
3Zout,R6inZ_{out},R6_{in}R6←ZR6\leftarrow Z

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 E0,E1,E2E_0,E_1,E_2 respectively load Y, calculate Z, and write the destination. If decoded instruction signals DADDD_{\mathrm{ADD}} and DSUBD_{\mathrm{SUB}} are mutually exclusive, the add command is E1DADDE_1D_{\mathrm{ADD}} and the subtract command is E1DSUBE_1D_{\mathrm{SUB}}; Yin=E0Y_{in}=E_0, Zin=E1Z_{in}=E_1 and destination write enable =E2=E_2. 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 E0E_0.

Consider a synchronous read request in state T0T_0, followed by a ready-wait state T1T_1, and IR loading in T2T_2. Hold MAR stable while waiting. Request is issued in T0T_0; stay in T1T_1 until ready, then visit T2T_2. 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.

Revise offline: the whole Computer Organization and Architecture handbook as one PDF

36 pages · 2.5 MBFree to read online. Sign in to download the PDF.We save the handbook, version and request time in My downloads. Privacy policy

All chapters · Corrections