LFSR, PRBS & CRC
8-Bit Galois LFSR (x⁸+x⁶+x⁵+x⁴+1)
8-bit Galois LFSR with parallel load/shift enables using polynomial x^8+x^6+x^5+x^4+1.
About this block
Simulate it in the Verilog IDE
8-Bit Galois LFSR (x⁸+x⁶+x⁵+x⁴+1) is a Verilog 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 an 8-bit Galois Linear Feedback Shift Register (LFSR) with parallel load capability. It is designed for FPGA and ASIC synthesis, offering a robust pseudo-random number generator core with flexible initialization via parallel load. The design is fully verified using Icarus Verilog and supports synchronous reset and independent control signals for load and shift operations.
- Choose Open in IDE. RTL Studio loads the packaged workspace for 8-Bit Galois LFSR (x⁸+x⁶+x⁵+x⁴+1).
- Read the Verilog module in the editor. The catalog line for this block: 8-bit Galois LFSR with parallel load/shift enables using polynomial x^8+x^6+x^5+x^4+1.
- 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
- 8-bit State Width: Standard width for byte-aligned operations.
- Galois Configuration: Efficient hardware implementation with low logic depth using polynomial
x^8 + x^6 + x^5 + x^4 + 1. - Parallel Load: Arbitrary state initialization via
parallel_ininput. - Synchronous Control: Independent
load_enandshift_ensignals with defined priority (Reset > Load > Shift). - Synchronous Reset: Reset to zero via
rst_non the positive clock edge. - High Frequency: Optimized feedback logic for high-speed operation.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | Clock input |
rst_n | Input | 1 | Active-low synchronous reset |
load_en | Input | 1 | Parallel load enable (high priority) |
shift_en | Input | 1 | Shift enable (low priority) |
parallel_in | Input | 8 | Parallel data input |
state | Output | 8 | Current LFSR state |
Verification
The testbench (tb/tb_lfsr_8bit_galois.v) verifies the following behaviors:
- Reset Behavior: Ensures state is zero after reset.
- Parallel Loading: Validates loading arbitrary values (0xAA, 0xFF).
- Shift Sequence: Confirms correct Galois LFSR progression from 0x01 to 0x71.
- Hold State: Ensures state remains unchanged when no enables are active.
All test cases passed successfully.
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 Parallel Scrambler — L2 Upgrade
- Additive Lagged Fibonacci 16
- CRC-16-CCITT Serial
- CRC-32 Generator (lfsr_crc)
- PRBS-32 Sequence Checker with Error Counter
- PRBS-32 Sequence Generator
- Trivium-Lite Keystream 8-bit
- Xorshift32 PRNG — L2 Upgrade
- Xorshift64* PRNG