LFSR, PRBS & CRC
PRBS-32 Sequence Generator
A 32-bit Pseudo-Random Binary Sequence generator using the IEEE 802.3 polynomial. Supports synchronous reset, enable control, and seed reload for deterministic testing.
About this block
Simulate it in the Verilog IDE
PRBS-32 Sequence Generator is a SystemVerilog reference block in the LFSR, PRBS & CRC catalog. LFSR, PRBS, CRC, and pseudo-random sequence generators. Marked Medium: more state or a wider datapath, still one workspace in the IDE.
This IP implements a 32-bit Pseudo-Random Binary Sequence (PRBS) generator based on the IEEE 802.3 standard polynomial. It is designed for high-speed data integrity testing, offering synchronous reset, enable control, and deterministic seed reload capabilities. The module is fully synthesizable, latch-free, and provides a simple interface for integration into verification environments or hardware stress tests.
The core of this IP is a Linear Feedback Shift Register (LFSR) with 32 bits of state. It uses the primitive polynomial:
x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1
- Choose Open in IDE. RTL Studio loads the packaged workspace for PRBS-32 Sequence Generator.
- Read the SystemVerilog module in the editor. The catalog line for this block: A 32-bit Pseudo-Random Binary Sequence generator using the IEEE 802.3 polynomial. Supports synchronous reset, enable control, and seed reload for deterministic testing.
- 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.
Features
- Standard Compliance: Uses the IEEE 802.3 PRBS-32 polynomial.
- Synchronous Control: Supports active-low synchronous reset and enable signals.
- Deterministic Testing: Allows loading a specific seed to reproduce sequences.
- Parallel Output: Exposes the full 32-bit LFSR state for monitoring.
- Synthesizable: Fully synthesizable RTL with no latches.
Interface
| Signal Name | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | Clock input |
rst_n | Input | 1 | Active-low synchronous reset |
en | Input | 1 | Enable signal to advance state |
load_seed | Input | 1 | Load seed_d into state register |
seed_d | Input | 32 | Data to load into state register |
prbs_out | Output | 32 | Current LFSR state |
Architecture
The LFSR updates its state on the positive edge of the clock. The next state is determined by:
- Reset: If
rst_nis low, the state is cleared to zero. - Seed Load: If
load_seedis high, the state is loaded withseed_d. - Shift: If
enis high, the state shifts right, and the new MSB is the XOR of specific tap bits (feedback). - Hold: If neither reset nor seed load is active and
enis low, the state remains unchanged.
### Feedback Logic
The feedback bit is calculated by XORing the bits at positions defined by the polynomial taps:
Verification
The provided testbench (tb_prbs_32b.sv) includes seven test cases to ensure correctness:
- Reset Verification: Confirms output is zero after reset.
- Seed Load Verification: Confirms output matches the loaded seed.
- Enable/Shift Verification: Confirms state changes when enabled.
- Determinism Verification: Confirms reloading the seed produces the same sequence.
- Edge Cases: Tests all-zeros and all-ones seeds.
- Statistical Properties: Verifies ~50% Hamming weight over long sequences.
All tests pass successfully in simulation.
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
- CRC-32 Generator (lfsr_crc)
- PRBS-32 Sequence Checker with Error Counter
- Trivium-Lite Keystream 8-bit
- Xorshift32 PRNG — L2 Upgrade
- Xorshift64* PRNG