Micro-operations Control Word Design for a 16-Register Bus CPU

Micro-operations Control Word Design for a 16-Register Bus CPU

Verified Sources
Nov 4, 2026

This section designs a micro-operation control word for a simple bus-based datapath containing:

  • 16 registers connected to a common bus
  • an ALU that supports 32 operations
  • a shifter that supports 8 operations

Key idea: in a single micro-cycle, the bus typically carries one source register value into the ALU/shifter, and the ALU/shifter result is written into one destination register. The control word therefore must include bit-fields to:

  1. select the source register placed on the bus,
  2. select the destination register to be written,
  3. select which ALU or shifter operation to perform.

We denote a micro-operation as something like: Rd←ALU(Rs,Rt)R_d \leftarrow \text{ALU}(R_s, R_t) but in a bus design, RsR_s is selected to drive the bus, while RtR_t is commonly taken from a second internal path/register or from another selected bus time. Since the question asks for the bit fields to specify the micro-operation R4←R5+R6R4 \leftarrow R5 + R6, we will allocate sufficient bits for register selection and ALU operation, plus a one-bit “functional unit select” (ALU vs shifter) to be explicit.

Required selector bit-widths

For a selector with NN choices, the number of bits is: ⌈log⁡2N⌉\lceil \log_2 N \rceil

So:

  • Register selectors for 16 registers: ⌈log⁡2(16)⌉=4\lceil \log_2(16)\rceil = 4 bits
  • ALU operation selectors for 32 ops: ⌈log⁡2(32)⌉=5\lceil \log_2(32)\rceil = 5 bits
  • Shifter operation selectors for 8 ops: ⌈log⁡2(8)⌉=3\lceil \log_2(8)\rceil = 3 bits

We also include:

  • A 1-bit field to choose ALU vs shifter (otherwise the shifter/ALU fields would overlap ambiguously)

Mermaid sketch of the datapath intent:

Keywords: micro-operation control word bus ALU shifter.

Control Word / Register Transfer Microoperations (Bus & Datapath) — Intro

(i) Formulate a control word for micro-operation

We define a control word structured as fields:

  1. Source register select (bus input)
    • 44 bits: selects which of R0…R15R0 \ldots R15 appears on the bus
  2. Destination register select (write register)
    • 44 bits: selects RdR_d to receive the result
  3. Functional unit select
    • 11 bit: 0 = ALU, 1 = Shifter
  4. ALU operation select
    • 55 bits: chooses one of 32 ALU operations (e.g., ADD, SUB, AND, OR, …)
  5. Shifter operation select
    • 33 bits: chooses one of 8 shifter operations (e.g., logical shift left/right, arithmetic shift, rotate, …)

Total control word length

4+4+1+5+3=17 bits4 + 4 + 1 + 5 + 3 = 17 \text{ bits}

We now present the control word format.

Control Word Bit Layout (example convention)

Let the control word be:

FieldBitsMeaning
[16:13][16:13]4Source register: RsR_s
[12:9][12:9]4Destination register: RdR_d
[8][8]1Unit select: U=0U=0 ALU, U=1U=1 Shifter
[7:3][7:3]5ALU op code (valid when U=0U=0)
[2:0][2:0]3Shifter op code (valid when U=1U=1)

So the control word is: C=Rs[3:0]⏟4 Rd[3:0]⏟4 U⏟1 ALUop[4:0]⏟5 Shop[2:0]⏟3C = \underbrace{R_s[3:0]}_{4}\ \underbrace{R_d[3:0]}_{4}\ \underbrace{U}_{1}\ \underbrace{\text{ALUop}[4:0]}_{5}\ \underbrace{\text{Shop}[2:0]}_{3}

Micro-operation meaning

  • The selected source register RsR_s is placed onto the bus.
  • The functional unit selected by UU performs the selected operation.
  • The output is written into destination register RdR_d.

[Pro tip]{type="tip"}: When designing control words, it’s common to include unused fields for the inactive unit (ALU vs shifter). They may be don’t-cares in optimization, but it’s clean to allocate fixed bit-fields as done above.
[/Pro tip]

How to compute the fields for (i)

  1. 1
    Step 1

    For 16 registers, choose ⌈log⁡2(16)⌉=4\lceil\log_2(16)\rceil=4 bits for each of source and destination selectors.

  2. 2
    Step 2

    For 32 ALU operations, choose ⌈log⁡2(32)⌉=5\lceil\log_2(32)\rceil=5 bits for the ALU op field.

  3. 3
    Step 3

    For 8 shifter operations, choose ⌈log⁡2(8)⌉=3\lceil\log_2(8)\rceil=3 bits for the shifter op field.

  4. 4
    Step 4

    Include 1 bit to indicate whether the active datapath operation comes from the ALU or from the shifter.

  5. 5
    Step 5

    Total control word length is 4+4+1+5+3=174+4+1+5+3=17 bits.

(ii) Show the bits of the control word for R4←R5+R6R4 \leftarrow R5 + R6

We must map R4←R5+R6R4 \leftarrow R5 + R6 to control fields.

  • Destination register: Rd=R4R_d = R4
  • Source register (bus input): Rs=R5R_s = R5

Now: the operation is addition, so we choose:

  • Functional unit: ALU, therefore U=0U=0
  • ALU operation code: choose the binary code for ADD among 32 ALU ops.

However, the question does not provide the numeric mapping of “ADD” to a specific 5-bit code. In such problems, either:

  • the ADD opcode is assumed to be 0000000000 (often “first” operation), or
  • the answer expresses the field as “ALUop = (ADD’s 5-bit code)”.

To produce a fully explicit bit pattern, we adopt the standard teaching convention:

  • ALU ADD corresponds to ALUop = 00000 (i.e., ADD is opcode 0)

If your course uses a different opcode mapping, only the ALUop[4:0] bits change; the register select bits remain the same.

Convert register indices to 4-bit binary

  • R5=0101R5 = 0101
  • R4=0100R4 = 0100

Assemble the control word

Using the layout [16:13]=Rs, [12:9]=Rd, [8]=U, [7:3]=ALUop, [2:0]=Shop[16:13]=R_s,\ [12:9]=R_d,\ [8]=U,\ [7:3]=\text{ALUop},\ [2:0]=\text{Shop}:

  • Rs=R5⇒0101R_s=R5 \Rightarrow 0101
  • Rd=R4⇒0100R_d=R4 \Rightarrow 0100
  • U=0U=0 (ALU active)
  • ALUop=00000\text{ALUop}=00000 (ADD assumed)
  • Shop=xxx\text{Shop}=xxx (unused when U=0U=0); for a concrete value we set Shop=000\text{Shop}=000

So: C=0101⏟Rs 0100⏟Rd 0⏟U 00000⏟ALUop 000⏟ShopC = \underbrace{0101}_{R_s}\ \underbrace{0100}_{R_d}\ \underbrace{0}_{U}\ \underbrace{00000}_{\text{ALUop}}\ \underbrace{000}_{\text{Shop}}

Written as a 17-bit string: C=0101 0100 0 00000 000C = 0101\ 0100\ 0\ 00000\ 000

Or concatenated: C=01010100000000000C = 01010100000000000

[Warning]{type="warning"}: If your curriculum assigns a different 5-bit opcode to the ALU’s ADD operation, replace only the ALUop[4:0]\text{ALUop}[4:0] field. The RsR_s and RdR_d fields (01010101 and 01000100) do not change.
[/Warning]

Mermaid: field decoding view

Keywords: ALU operation code opcode binary encoding don’t-care.

Microinstruction assembly workflow

Choose control word fields

1

Allocate bit-widths for Rs, Rd, unit select, ALUop, Shop."

Encode register indices

2

Convert R5 and R4 into 4-bit binary selectors."

Select the active unit

3

Set U=0 for ALU because the operation is addition."

Encode operation

4

Fill ALUop with ADD’s 5-bit opcode (assume 00000 if not specified)."

Fill remaining bits

5

Set Shop to any value (e.g., 000) since it is inactive."

Common exam assumptions and edge cases

Knowledge Check

Question 1 of 4
Q1Single choice

For 16 registers, how many bits are needed to select a register in the control word?