1. Registers

Definition – Register

A register is a collection of binary storage elements (flip-flops). In theory it is a sequential circuit with a state table; in practice we view it as storing a vector of bits used for data storage, movement and simple processing.

Example – 2-bit register (two D flip-flops)

Inputs , state , outputs .

Next for 011011Output
000001101100
010001101101
100001101110
110001101111
  • States: 4; input combinations: 4; output combinations: 4
  • Output function: (the state itself) → Moore
  • Next-state function:
  • For an n-bit register: states, input combinations → a state table with entries.

⚠️ For n = 32 that is entries — the state-table method is useless for real registers.


2. Register Design Models

Because grows so fast, registers are designed by:

  1. Adding predefined combinational blocks to flip-flops (e.g., flip-flops + an incrementer = up-counter).
  2. Designing one 1-bit cell with a state table (only 2 states) and replicating it n times.

Output is usually the state variable.


3. Register Storage (Load Control)

Expectation: a register should hold its data for many clocks and load only on command.
Reality: a D flip-flop loads on every clock edge.

Solutions:

  1. Clock gating — block the clock when not loading.
  2. Load-controlled feedback — a mux feeds the output back when not loading.
  3. Use S–R / J–K flip-flops — input (0,0) means hold.

Control signal Load: Load = 1 → load data inputs; Load = 0 → store (hold).

Registers with Clock Gating

For a positive-edge flip-flop:

When Load = 0, the gated clock is stuck at 1 → no rising edges → hold.

⚠️ Clock skew: the OR gate delays the gated clock relative to the main clock (and to other gated clocks), which can break timing. Avoid clock gating unless it is carefully designed.

Registers with Load-Controlled Feedback

Run the clock continuously; put a 2-to-1 MUX in front of each D input:

flowchart LR
  IN[In_i] -->|1| MUX{{2-to-1 MUX}}
  Q -->|0| MUX
  LOAD[Load] --> MUX
  MUX --> D[D flip-flop]
  CLK[Clock] --> D
  D --> Q[A_i / Y_i]
LoadD inputResult
0 (own output)Hold
1Load new value

More hardware than clock gating, but free of timing problems.


4. Register Transfer Operations

Definition – Register Transfer

Movement and processing of data stored in registers. Three components:

  • a set of registers,
  • operations on them,
  • control of those operations.

Elementary operations (load, count, shift, add, bitwise OR…) are called microoperations.

Register notation

NotationMeaningExample
Letters + digitsA registerR2, PC, IR
Parentheses ( )Bit or range of bitsR1(1), PC(7:0), PC(L)
Arrow ←Data transferR1 ← R2
CommaParallel (simultaneous) operationsR1 ← R2, R3 ← R4
Brackets [ ]Memory addressR0 ← M[AR], R3 ← M[PC]

A 16-bit PC splits into PC(H) = bits 15:8 and PC(L) = bits 7:0.

Definition – Conditional Transfer

drives the Load input of R2. The transfer happens at the clock edge where ; at all other edges R2 holds.


5. Microoperations

Types

GroupPurpose
TransferMove data between registers
Arithmetic+, −, ×, / on register data
LogicBitwise ∨ (OR), ∧ (AND), ⊕ (XOR), ¯ (NOT)
ShiftShift data within registers

Examples

MicrooperationMeaning
R1 ← R1 + R2Add R1 and R2, result in R1
PC ← R1 × R6Multiply R1 by R6, result in PC
R1 ← R1 ⊕ R2Bitwise XOR
PC ← 1’s complement of R2 into PC
: R1 ← R1 ∨ R3If OR , bitwise OR R1 with R3

⚠️ Two meanings of ”+”: in a control expression () it means logical OR; in a microoperation (R1 + R3) it means arithmetic addition. Bitwise OR in a microoperation is written ∨.

Control expressions

Written left of a colon; the operation occurs only when the expression = 1.


  • enables the operation.
  • X = 0 → add; X = 1 → add the 2’s complement of R2 = subtract.

Arithmetic microoperations

SymbolicDescription
R0 ← R1 + R2Addition
R0 ← 1’s complement
R0 ← + 12’s complement
R0 ← R2 + + 1R2 − R1 (via 2’s complement)
R1 ← R1 + 1Increment
R1 ← R1 − 1Decrement

Logic microoperations

SymbolicDescriptionTypical use
R0 ← Bitwise NOT
R0 ← R1 ∨ R2Bitwise ORSet bits
R0 ← R1 ∧ R2Bitwise ANDClear bits (mask)
R0 ← R1 ⊕ R2Bitwise XORComplement selected bits

Example – R1 = 10101010, R2 = 11110000

OperationR0
R0 ← 01010101
R0 ← R1 ∨ R211111010
R0 ← R1 ∧ R210100000
R0 ← R1 ⊕ R201011010

Notice: where R2 = 1 (upper nibble), OR sets, AND keeps, XOR inverts; where R2 = 0 (lower nibble), OR keeps, AND clears, XOR keeps.

Shift microoperations

SymbolicDescription
R1 ← sl R2Shift left
R1 ← sr R2Shift right

Example – R2 = 11001001

OperationR1
R1 ← sl R210010010
R1 ← sr R201100100

These shifts zero-fill. Other variants: rotates, arithmetic shifts, or a separate flip-flop supplying/catching the shifted bit.


6. Register Transfer Structures

StructureDescription
Multiplexer-basedEach register has its own MUX selecting its sources
Bus-based (MUX)One shared MUX drives a bus feeding several registers
Three-state busSources drive a shared bus through 3-state buffers
OtherMultiple MUXes/buses and combinations

Example – Multiplexer-based transfer into R0

flowchart LR
  R1[R1] -->|1| M{{2-to-1 MUX<br/>S = K1}}
  R2[R2] -->|0| M
  M --> R0[R0]
  K1[K1] --> OR((OR))
  K2[K2] --> OR
  OR -->|Load| R0
  • Load = ; select S = .
  • has priority: if both are 1, R1 is loaded.

⚠️ The MUX select gives priority — that’s why the second transfer’s condition is , not just .


7. Shift Registers

Definition – Shift Register

Moves data laterally toward the MSB or LSB. Simplest form: D flip-flops in a chain, each Q feeding the next D.

  • In = serial input (shift-right input)
  • Out = serial output
  • (A, B, C, Out) = parallel output
flowchart LR
  IN[In] --> A[D FF A] --> B[D FF B] --> C[D FF C] --> O[D FF Out]
  CP[Clock CP] -.-> A & B & C & O

Example – Serial shifting (In = 0,1,1,0,1,1,1)

ClockInABCOut
T00????
T110???
T2110??
T30110?
T410110
T511011
T611101

Each clock, every bit moves one place right; the first input bit reaches Out after 4 clocks.

Parallel-load shift register

A 2-to-1 MUX before each stage:

  • SHIFT = 0 → load parallel data
  • SHIFT = 1 → shift right on each clock (IN enters A)

Extend with more bits for an n-bit parallel-load shift register.

Shift registers with additional functions

A 4-input MUX per stage gives four functions (one possible select encoding):

Function
00Hold
01Shift right
10Shift left
11Parallel load

Further extensions: shifting more than one position, or by a variable shift amount (barrel shifter).

⚠️ Shifting left multiplies an unsigned binary number by 2; shifting right divides by 2 (dropping the remainder).