DexterLab

🎂 🎉 🎈 🤖 💡 📈 🧱 ⭐ 🥂DexterLab turns one year old 🎂 🎉 🎈 🤖 💡 📈 🧱 ⭐ 🥂🔥 New release: DexterLab Parser AXI‑Lite Documentation Suite (2026 Edition)🔥 AXI‑Full Edition updated — unified command interface + full docs🔥 Roadmap updated: AHB‑Full/Lite + AXI‑Full→AHB‑Full bridge in development📘 Unified command architecture — new documentation planned📘 Timing diagrams and bus models expanding with AXI‑Lite & AHB support📘 Theory ↔ Design Library integration continues across all backends

LFSR / PRBS – Mathematical Background

LFSRs and PRBS generators are based on polynomial arithmetic over the Galois Field GF(2). Although their hardware implementation uses shift registers and XOR gates, the underlying theory is algebraic and closely related to CRCs. This page summarizes the essential mathematical concepts behind maximal‑length sequences, primitive polynomials, and the equivalence between Fibonacci and Galois forms.

1. Polynomials over GF(2)

An LFSR state is interpreted as a polynomial whose coefficients belong to GF(2). For example, the bit string:

1011001

represents the polynomial:

x^6+x^4+x^3+1

Arithmetic rules in GF(2):

  • addition = XOR
  • subtraction = XOR
  • multiplication = AND + XOR
  • no carries or borrows

This makes LFSRs extremely efficient in hardware.

2. Feedback Polynomial

The behavior of an LFSR is defined by its feedback polynomial:

P(x)=x^N+a_kx^k+\dots +a_1x+1

where each coefficient a_i is either 0 or 1.

The polynomial determines:

  • the taps in the LFSR
  • the sequence length
  • whether the sequence is maximal
  • the statistical properties of the output

3. Primitive Polynomials and Maximal-Length Sequences

A polynomial is primitive over GF(2) if it generates a maximal-length sequence:

2^N-1

This sequence cycles through all non‑zero states of the register. The all‑zero state is excluded because it would lock the LFSR permanently.

Common primitive polynomials:

  • PRBS7: x^7+x^6+1
  • PRBS15: x^{15}+x^{14}+1
  • PRBS23: x^{23}+x^{18}+1
  • PRBS31: x^{31}+x^{28}+1

4. Fibonacci and Galois Equivalence

Fibonacci and Galois LFSRs implement the same polynomial but distribute the XOR operations differently.

  • Fibonacci form applies feedback only at the input.
  • Galois form distributes feedback across multiple taps.

Mathematically, both forms implement the same linear recurrence:

sn+N=aN−1sn+N−1⊕︎⋯⊕︎a0sns_{n+N}=a_{N-1}s_{n+N-1}\oplus \dots \oplus a_0s_n

The difference is purely architectural, not mathematical.

5. Autocorrelation and Spectral Properties

Maximal-length sequences (m‑sequences) have excellent statistical properties:

  • uniform distribution of 0s and 1s
  • two-level autocorrelation
  • flat power spectrum except for a DC notch

These properties make PRBS sequences ideal for:

  • stressing communication links
  • spread-spectrum systems
  • radar and correlators
  • BIST and pseudo-random testing

6. Relationship to CRCs

LFSRs and CRCs share the same mathematical foundation:

  • both use polynomials over GF(2)
  • both rely on feedback defined by the polynomial
  • both can be unrolled to parallel form
  • both avoid the all-zero state

The main difference is purpose:

  • CRCs compute remainders
  • LFSRs generate sequences

7. Related Pages