LFSR simulator
About the LFSR Simulator
An LFSR (Linear Feedback Shift Register) is a deterministic bit generator that produces a pseudorandom bit sequence from an initial state (seed).
The simulator allows you to select a feedback polynomial, enter an initial seed, and observe step by step how subsequent bits are generated. Each new bit is calculated using the taps specified by the polynomial and the XOR operation.
For example, a 14-bit LFSR with the polynomial:
x14 + x13 + x8 + x4 + 1
generates the next bit according to the following rule:
b[i] = b[i−4] ⊕ b[i−8] ⊕ b[i−13] ⊕ b[i−14]
This means that the entire generated bit sequence depends entirely on two things: the polynomial and the initial seed. If both values are identical, the LFSR will always generate the same sequence.
Why Is an LFSR Useful?
LFSRs are used in various digital electronics, communication, and data processing systems, including data scrambling, error detection, and pseudorandom sequence generation.
In data recovery, understanding how an LFSR works can be particularly important because a controller may use an LFSR to transform the bit sequence of data written to NAND flash memory. If the polynomial is known and the correct seed is recovered, this transformation can be deterministically reversed.
How to Use the Simulator
- Select an LFSR polynomial.
- Enter the initial seed.
- Press Play to generate the bit sequence automatically, or Step to observe each LFSR transition individually.
- Use Reset to return to the initial state.
Important: An LFSR is not a random number generator in the classical sense. Its sequence is deterministic: given the polynomial and the initial state, the entire subsequent bit sequence can be calculated precisely.