Module 3: Sequential Circuit Design · 3.4 Registers & Shift Registers

Shift Register Applications

Shift registers perform critical functions beyond simple serial-to-parallel data conversion.

This article explores five primary applications of shift registers: synchronous delay lines, UART transceivers, ring counters, linear feedback shift registers, and manufacturing scan chains.

Synchronous Delay Lines

A Serial-In, Serial-Out (SISO) register containing $N$ stages delays a digital signal by exactly $N$ clock periods.

In pipelined datapaths, parallel processing branches often possess unequal pipeline depths. For example, if an arithmetic path requires three pipeline cycles while a status path requires five cycles, the shorter path requires two cycles of delay.

A two-stage SISO register delays the shorter path to synchronize data arrival before combining operands. Video processing pipelines use delay lines to align luminance and chrominance color channels.

Universal Asynchronous Receiver-Transmitter (UART)

A UART provides asynchronous serial communication between devices over two signal wires (Transmit TX and Receive RX).

The standard 8N1 communication frame contains ten binary bits:

  1. One active-low start bit (0)
  2. Eight data bits transmitted Least Significant Bit first (LSB-first)
  3. One active-high stop bit (1)

The transmission line remains at logic 1 (idle high) when inactive (Figure 1).

UART frame
Figure 1: UART 8N1 data frame transmitting hexadecimal byte 0x55

  • Transmitter Architecture: Uses a PISO register. The controller loads the 8-bit data byte, appends the start and stop bits, and shifts the bits out serially at the configured baud rate.
  • Receiver Architecture: Uses a SIPO register. The receiver detects the falling edge of the start bit. It delays by half a bit period to sample subsequent bits at their temporal midpoints. The receiver shifts in eight data bits, verifies the stop bit, and asserts a data_valid flag.

Ring Counters

A ring counter connects the serial output $Q[N-1]$ of an $N$-bit shift register directly back to the first stage input $D[0]$ (Figure 2).

Ring counter
Figure 2: Four-bit ring counter configured as a circulating one-hot shift loop

When initialized with a single logic 1 (0001), the active bit circulates through the register by one position on each clock cycle:

$$\text{Sequence: } 4\text{‘b}0001 \to 4\text{‘b}0010 \to 4\text{‘b}0100 \to 4\text{‘b}1000 \to 4\text{‘b}0001$$

The circuit functions as a decoded one-hot sequencer without requiring external output decoding gates.

However, if electrical noise clears the circulating bit to all zeros, the counter stops functioning. Designers must initialize ring counters with valid non-zero reset values.

Linear Feedback Shift Registers (LFSR)

A Linear Feedback Shift Register (LFSR) drives its input with the XOR sum of selected register tap bits.

An $N$-bit LFSR configured with a primitive feedback polynomial generates a maximal-length pseudo-random sequence of $2^N - 1$ unique non-zero states. Figure 3 shows a 4-bit LFSR using polynomial $x^4 + x^3 + 1$.

4-bit LFSR
Figure 3: Four-bit linear feedback shift register using polynomial x^4 + x^3 + 1

The recurrence relation is:

$$D[0] = Q[3] \oplus Q[2], \qquad D[i] = Q[i-1] \quad \text{for } i \in {1, 2, 3}$$

Starting from seed 0001, the register traverses fifteen distinct states before repeating. The all-zeros state is excluded; an LFSR in state 0000 remains trapped in zero permanently.

LFSR applications include:

  • Pseudo-Random Binary Sequences (PRBS): Generates deterministic test patterns (e.g., PRBS-7, PRBS-31) to evaluate high-speed communication transceivers.
  • Built-In Self-Test (BIST): Generates random hardware stimulus vectors on-chip.
  • Cyclic Redundancy Checks (CRC): Computes polynomial division in modulo-2 arithmetic. Ethernet interfaces use 32-bit LFSRs to calculate the IEEE 802.3 CRC-32 checksum.

Manufacturing Scan Chains

Integrated circuits contain millions of internal flip-flops with no direct physical probe access. To verify post-manufacturing silicon integrity, Design-for-Test (DFT) methodologies convert flip-flops into scan chains.

Automated synthesis tools place a 2-to-1 multiplexer before each flip-flop data pin:

  • In mission mode (scan_enable = 0), the flip-flop samples functional system logic.
  • In test mode (scan_enable = 1), flip-flops connect in series to form a global shift register.

Automated test equipment (ATE) shifts test vectors into the scan chain, executes one functional clock cycle, and shifts out the resulting register states for automated defect detection.

Practice Exercises

Problem 1

A 4-bit LFSR uses primitive polynomial $x^4 + x + 1$ with feedback $D[0] = Q[3] \oplus Q[0]$. Trace the first eight state transitions starting from initial seed 4'b0001.

Solution

Calculate each transition step:

  1. Start: 0001 $\implies D[0] = Q[3] \oplus Q[0] = 0 \oplus 1 = 1$. Next: 0011
  2. 0011 $\implies D[0] = 0 \oplus 1 = 1$. Next: 0111
  3. 0111 $\implies D[0] = 0 \oplus 1 = 1$. Next: 1111
  4. 1111 $\implies D[0] = 1 \oplus 1 = 0$. Next: 1110
  5. 1110 $\implies D[0] = 1 \oplus 0 = 1$. Next: 1101
  6. 1101 $\implies D[0] = 1 \oplus 1 = 0$. Next: 1010
  7. 1010 $\implies D[0] = 1 \oplus 0 = 1$. Next: 0101
  8. 0101 $\implies D[0] = 0 \oplus 1 = 1$. Next: 1011

The LFSR traverses distinct pseudo-random states.

Problem 2

A UART link transmits 8N1 frames at a baud rate of 9600 baud. Calculate the temporal duration of one frame and compute the maximum data throughput in bytes per second.

Solution

Calculate frame parameters:

  • Bit duration: $T_{\text{bit}} = 1 / 9600 \approx 104.17,\mu\text{s}$
  • Total frame duration (10 bits):

$$T_{\text{frame}} = 10 \times 104.17,\mu\text{s} \approx 1.042\text{ ms}$$

  • Maximum throughput:

$$\text{Throughput} = \frac{9600\text{ baud}}{10\text{ bits/byte}} = 960\text{ bytes per second}$$

Problem 3

A ring counter provides six-phase sequencing. Determine the required flip-flop count, state progression, and illegal state behavior.

Solution
  • The sequencer requires 6 flip-flops.
  • State progression: 000001 $\to$ 000010 $\to$ 000100 $\to$ 001000 $\to$ 010000 $\to$ 100000 $\to$ 000001.
  • If the register enters the all-zeros state (000000), the counter remains stuck at zero.

The reset net must initialize the register to 000001. Designers can connect a NOR gate across bits $Q[5:1]$ to re-inject logic 1 if the register becomes empty.

The next article examines the Universal Shift Register, which integrates parallel loading and bidirectional shifting.

← Shift Registers The Universal Shift Register →