LFSR, PRBS & CRC
CRC-32 Generator (lfsr_crc)
Byte-serial CRC-32 generator with Ethernet-style polynomial, init 0xFFFFFFFF, and zlib-compatible output.
About this block
Simulate it in the Verilog IDE
CRC-32 Generator (lfsr_crc) is a Verilog reference block in the LFSR, PRBS & CRC catalog. LFSR, PRBS, CRC, and pseudo-random sequence generators. Marked Hard: a larger reference. Simulate the packaged testbench before you change the RTL.
This IP implements a byte-serial CRC-32 generator using Alex Forencich's parametrizable lfsr_crc wrapper and combinatorial lfsr engine.
Default parameters match Ethernet-style CRC-32: polynomial 0x04C11DB7, initial value 0xFFFFFFFF, LSB-first input (REVERSE=1), and inverted output (INVERT=1).
- Top module:
lfsr_crc - Polynomial:
32'h04C11DB7 - Init state:
32'hFFFFFFFF - Data width: 8 bits per clock when
data_in_validis asserted - Configuration: Galois, LSB-first, inverted CRC output compatible with
zlib.crc32
- Choose Open in IDE. RTL Studio loads the packaged workspace for CRC-32 Generator (lfsr_crc).
- Read the Verilog module in the editor. The catalog line for this block: Byte-serial CRC-32 generator with Ethernet-style polynomial, init 0xFFFFFFFF, and zlib-compatible output.
- Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
- Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.
RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.
Interface
| Signal | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | System clock |
rst | Input | 1 | Synchronous reset; clears output and reloads LFSR init |
data_in | Input | 8 | Input data byte |
data_in_valid | Input | 1 | Advance CRC with data_in on rising clock edge |
crc_out | Output | 32 | Registered CRC result (~state when INVERT=1) |
Verification
Run simulation from this directory:
Test vectors include the standard 123456789 CRC-32 value 0xCBF43926.
More in LFSR, PRBS & CRC
- 16-Bit Fibonacci LFSR (Left-Shift, Fixed Taps) — L1 Upgrade — L2 Upgrade
- 32-Bit Fibonacci LFSR (Right-Shift + Enable) — L2 Upgrade
- 64-Bit LFSR (2 Tap-Set Parameter Select)
- 8-Bit Fibonacci LFSR (Right-Shift + Mask XOR) — L1 Upgrade
- 8-Bit Galois LFSR (x⁸+x⁶+x⁵+x⁴+1)
- 8-Bit Parallel Scrambler — L2 Upgrade
- Additive Lagged Fibonacci 16
- CRC-16-CCITT Serial
- PRBS-32 Sequence Checker with Error Counter
- PRBS-32 Sequence Generator
- Trivium-Lite Keystream 8-bit
- Xorshift32 PRNG — L2 Upgrade
- Xorshift64* PRNG