
VLSI
Design and Implementation of an LFSR-Based Pseudo Random Number Generator Using Verilog HDL
Abstract:
This project focuses on designing and implementing a Linear Feedback Shift Register (LFSR)-based Pseudo Random Number Generator (PRNG) using Verilog HDL. An LFSR generates a deterministic sequence of bits using a shift register and XOR feedback logic connected to selected register positions called taps. The proposed design uses a configurable register width, feedback polynomial, clock, reset, and enable control to generate pseudo-random sequences efficiently. The project evaluates sequence generation, hardware complexity, and timing performance through simulation and synthesis analysis.
Project Description:
The project develops a parameterized LFSR-based PRNG using Verilog HDL. It consists of a shift register, XOR feedback network, clock input, reset signal, enable control, and pseudo-random output.
The LFSR shifts its stored bits during each active clock cycle. Selected register bits are combined using XOR operations to generate a feedback bit, which is inserted into the shift register.
The design can use different register widths, such as 4-bit, 8-bit, 16-bit, and 32-bit configurations.
For an example 4-bit implementation, the polynomial x⁴ + x + 1 can be used with a suitable Fibonacci LFSR tap configuration. A non-zero initial seed is required to avoid the all-zero lock-up state.
A maximal-length LFSR with a suitable primitive polynomial can generate up to 2ⁿ − 1 non-zero states before repeating, where n is the register width.
Working Principle:
1. The LFSR initializes with a predefined non-zero seed after reset.
2. The clock signal controls the shift-register operation.
3. When the enable signal is active, the register contents shift by one position.
4. Selected register bits are supplied to the XOR feedback logic.
5. The XOR network calculates the new feedback bit.
6. The feedback bit is inserted into the designated register position.
7. The updated register value is provided as the pseudo-random output.
8. The process repeats to generate a sequence of changing binary values.
9. After completing its sequence, the LFSR returns to a previously visited state and repeats the sequence.
10. Simulation waveforms verify the generated sequence, feedback operation, reset, and enable behavior.
Notes:
- Use Verilog HDL for RTL implementation.
- Make the LFSR register width configurable through a parameter.
- Select a suitable feedback polynomial for the required register width.
- Verify the polynomial and tap positions against the chosen Fibonacci or Galois LFSR architecture.
- Use XOR gates to implement the feedback network.
- Initialize the register with a non-zero seed.
- Prevent the all-zero state because a conventional XOR-feedback LFSR can remain locked in that state.
- Include reset and enable signals for controlled operation.
- Verify the sequence length and confirm that the expected states are generated before repetition.
- Test different seed values and ensure the selected polynomial provides the intended sequence properties.
- Compare generated sequences with a reference software model.
- Tools may include ModelSim, QuestaSim, Vivado, Quartus, and Icarus Verilog.
- Optional enhancements include configurable tap selection, parallel PRNG outputs, multiple LFSR configurations, and statistical sequence testing.
- An LFSR produces deterministic pseudo-random sequences, not cryptographically secure random numbers. Do not use a basic LFSR as the sole random-number source for passwords, encryption keys, or security-critical authentication.
Expected Outcome:
The expected outcome is a functional parameterized LFSR-based PRNG implemented using Verilog HDL. It generates repeatable pseudo-random binary sequences using shift-register and XOR feedback operations. The design demonstrates feedback polynomial selection, sequence generation, register architecture, RTL implementation, and simulation-based verification. It provides practical knowledge of pseudo-random sequence generators used in digital testing, built-in self-test circuits, communication systems, simulation, scrambling, and hardware verification.
Expected Applications:
- Built-In Self-Test (BIST) pattern generation.
- Digital communication scrambling and descrambling.
- Simulation and hardware testing.
- Randomized test-vector generation.
- Error-detection and coding experiments.
- Non-security-critical sequence generation.
All Projects




