DexterLab

🚨 New downloadable modules coming soon📘 Electrical Signaling & PHY Interfaces — new overview📘 Electrical I/O Standards — new overview📘 Integration between Theory and Design Library in progress

CRC — Overview, Families & Architecture

Overview

Cyclic Redundancy Checks (CRCs) are polynomial-based error‑detection codes used in communication systems, networking, storage, and embedded applications. They detect burst errors, bit flips, and protocol‑level corruption with extremely low hardware cost.
CRCs operate over GF(2) and are implemented using linear feedback shift registers (LFSRs), XOR networks, and parallel datapath expansions.

1. Fundamentals of CRC Computation

CRC computation is equivalent to dividing the input bitstream by a generator polynomial over GF(2). All operations use XOR (addition/subtraction) and AND (multiplication), with no carries or borrows.

A CRC is fully defined by:

  • generator polynomial
  • initial value
  • final XOR value
  • input reflection (RefIn)
  • output reflection (RefOut)
  • bit ordering (LSB‑first or MSB‑first)

Two CRCs with the same width may behave differently if any of these parameters differ.

2. CRC Families

CRCs are grouped by width and protocol usage.

CRC‑8

Used in sensors, 1‑Wire, ATM, low‑bandwidth protocols.

CRC‑16

Used in telecom, USB, HDLC, industrial protocols.

CRC‑32

Used in Ethernet, storage, compression, multimedia.

CRC‑64

Used in high‑reliability storage and archival systems.

3. Common CRC Variants (Representative Table)

NameWidthPolynomial (hex)InitXOR OutRefInRefOutTypical Use
CRC‑8 ATM80x070x000x00NoNoATM, telecom
CRC‑8 Maxim80x310x000x00YesYes1‑Wire devices
CRC‑16 IBM160x80050x00000x0000YesYesLegacy protocols
CRC‑16 CCITT160x10210xFFFF0x0000NoNoTelecom, HDLC
CRC‑16 USB160x80050xFFFF0xFFFFYesYesUSB packets
CRC‑32 Ethernet320x04C11DB70xFFFFFFFF0xFFFFFFFFYesYesEthernet MAC
CRC‑32 Castagnoli320x1EDC6F410xFFFFFFFF0xFFFFFFFFYesYesStorage, iSCSI
CRC‑32 MPEG‑2320x04C11DB70xFFFFFFFF0x00000000NoNoMPEG‑2 TS
CRC‑64 ECMA640x42F0E1EBA9EA36930x00000000000000000x0000000000000000NoNoStorage, archives

CRCs with the same width may differ in reflection rules, initial value, final XOR, or bit ordering.

4. Architectural Model

Polynomial Division

The CRC remainder is computed by dividing the input stream by the generator polynomial. The remainder is the CRC.

Shift‑Register Structure

Most CRCs use an LFSR‑like structure:

  • register holds intermediate remainder
  • XOR gates implement feedback taps
  • each input bit updates the register

Reflection Rules

Protocols may require:

  • RefIn: reverse input bits
  • RefOut: reverse output bits
  • Final XOR: apply a constant mask

These must match the protocol exactly.

5. Architectural Variants

Serial CRC

  • 1 bit per cycle
  • minimal hardware
  • deterministic latency
  • ideal for low‑throughput systems

Parallel CRC

  • N bits per cycle (4/8/16/32/64)
  • XOR matrix derived from polynomial
  • used in MACs, PHYs, storage controllers

Pipelined CRC

  • pipeline stages inserted into XOR network
  • required for multi‑GHz datapaths
  • common in ASIC and high‑performance FPGA designs

Table‑Based CRC (software)

Used in CPUs, not in RTL hardware.

6. Parallel CRC Computation

Parallel CRCs are derived by unrolling the serial LFSR for N steps.

Each next‑state CRC bit is expressed as XOR of:

  • previous CRC bits
  • input bits

The XOR matrix depends on:

  • polynomial
  • reflection rules
  • input width

Example: CRC‑32 Ethernet

  • polynomial: 0x04C11DB7
  • reflected input/output
  • init = 0xFFFFFFFF
  • final XOR = 0xFFFFFFFF

Common widths:

  • 4‑bit (100 Mbps MACs)
  • 8‑bit (1 Gbps MACs)
  • 32‑bit (10G MACs)

Each width requires a different XOR matrix.

7. How to Generate Parallel CRC Equations

Three methods:

  • Matrix method (general and rigorous)
  • Symbolic unrolling
  • Automated generation (Python/MATLAB)

Matrix method:

  • represent CRC LFSR as matrix A
  • represent input influence as matrix B
  • compute A^N and \sum A^kB
  • extract XOR equations

Works for any polynomial, width, reflection rule, or input size.

8. Practical Implementation Notes

  • XOR depth grows with input width
  • pipelining may be required
  • reflected vs non‑reflected CRCs produce different equations
  • initial value and final XOR must be applied correctly
  • verification requires golden models and standard test vectors (“123456789”)
  • CRC must be updated only on valid bytes in MACs

9. Applications

CRCs are used in:

  • Ethernet (CRC‑32)
  • USB (CRC‑5, CRC‑16)
  • PCIe (CRC‑32)
  • SATA (CRC‑32)
  • storage controllers
  • avionics and automotive protocols
  • compression and multimedia formats

They provide strong error detection with minimal hardware.

Related Pages