Linear Feedback Shift Register (LFSR) Calculator

Generate pseudo-random bit sequences using linear feedback shift registers. Configure register length, tap positions, and seed to analyze LFSR period, feedback polynomial, and sequence properties.

Presets

2–16
Comma-separated, e.g. 4,1
Initial register state
Max sequence steps
Feedback Polynomial
x^4 + x + 1
Characteristic polynomial of the LFSR
Period
15
Sequence repeats after 15 steps
Max Period (2ⁿ−1)
15
Maximum possible for 4-bit LFSR
Maximal Length?
Yes ✓
Generates maximum-length sequence
Register Length
4 bits
2^4 = 16 possible states
Output Bits Shown
15
Number of output bits generated
Tap Positions
4, 1
Feedback tap bit positions

Period Utilization

Period
100.0%

Output Bit Distribution

1s
8 (53.3%)
0s
7 (46.7%)

Sequence State Table

StepRegister StateOutput BitCumulative Output
0100111
10100010
200100100
3000111001
41000010010
511000100100
6111001001000
71111110010001
801111100100011
9101111001000111
100101110010001111
1110100100100011110
12110111001000111101
130110010010001111010
1400111100100011110101
Common LFSR Polynomials Reference
BitsPolynomialTapsMax Period
3x³+x+13,17
4x⁴+x+14,115
5x⁵+x²+15,231
7x⁷+x+17,1127
8x⁸+x⁶+x⁵+x⁴+18,6,5,4255
10x¹⁰+x³+110,31,023
12x¹²+x¹¹+x¹⁰+x⁴+112,11,10,44,095
16x¹⁶+x¹⁴+x¹³+x¹¹+116,14,13,1165,535
Planning notes, formulas, and examples

About the Linear Feedback Shift Register (LFSR) Calculator

A Linear Feedback Shift Register (LFSR) is a fundamental building block in digital systems, cryptography, and communications engineering. It consists of a shift register whose input bit is computed as a linear function (typically XOR) of selected register bits called tap positions. Despite its simple hardware implementation, an LFSR can generate long pseudo-random sequences with excellent statistical properties.

This LFSR calculator lets you configure the register length (number of bits), specify tap positions that define the feedback polynomial, and set the initial seed state. The tool generates the complete bit sequence, analyzes the period length, determines whether the configuration produces a maximal-length sequence (m-sequence), and displays the characteristic polynomial.

Maximal-length LFSRs produce sequences of period 2ⁿ−1, cycling through every possible non-zero state before repeating. These sequences find applications in spread-spectrum communications (CDMA), error detection (CRC), built-in self-test circuits, stream ciphers, and Monte Carlo simulations. The feedback polynomial must be primitive over GF(2) to achieve maximal length.

Use the presets to explore classic configurations like the 4-bit x⁴+x+1 polynomial or the 16-bit CRC polynomial. The state table shows each clock cycle's register contents and output bit, while the period visualization helps you quickly assess whether your polynomial choice achieves full-period generation.

When This Page Helps

Linear Feedback Shift Register (LFSR) Calculator helps you solve linear feedback shift register (lfsr) problems quickly while keeping each step transparent. Instead of redoing long algebra by hand, you can enter Register Length (bits), Tap Positions, Seed (binary) once and immediately inspect Feedback Polynomial, Period, Max Period (2ⁿ−1) to validate your work.

How to Use the Inputs

  1. Enter Register Length (bits) and Tap Positions in the input fields.
  2. Select the mode, method, or precision options that match your linear feedback shift register (lfsr) problem.
  3. Read Feedback Polynomial first, then use Period to confirm your setup is correct.
  4. Try a preset such as "LFSR-3 (x³+x+1)" to test a known case quickly.
Formula used
Output bit = register LSB; Feedback bit = XOR of tapped positions; New state = [feedback, reg[0], …, reg[n−2]]; Period ≤ 2ⁿ − 1 for n-bit LFSR. Maximal when characteristic polynomial is primitive over GF(2).

Example Calculation

Result: Feedback Polynomial shown by the calculator

Using the preset "LFSR-3 (x³+x+1)", the calculator evaluates the linear feedback shift register (lfsr) setup, applies the selected algebra rules, and reports Feedback Polynomial with supporting checks so you can verify each transformation.

Tips & Best Practices

  • Use known primitive polynomials (available in the reference table) to guarantee maximal-length sequences
  • The seed must contain at least one 1-bit — all zeros is a locked state for XOR feedback
  • For n-bit LFSR, maximal period is 2ⁿ−1; if your period is shorter, the polynomial is not primitive
  • Tap positions correspond to polynomial exponents — taps 4,1 means x⁴+x+1
  • LFSRs with the same polynomial but different seeds produce the same sequence shifted in phase
  • CRC-16 and CRC-32 use specific LFSR polynomials for error detection

How This Linear Feedback Shift Register (LFSR) Calculator Works

This calculator takes Register Length (bits), Tap Positions, Seed (binary), Steps to Show and applies the relevant linear feedback shift register (lfsr) relationships from your chosen method. It returns both final and intermediate values so you can audit the process instead of treating it as a black box.

Interpreting Results

Start with the primary output, then use Feedback Polynomial, Period, Max Period (2ⁿ−1), Maximal Length? to confirm signs, magnitude, and internal consistency. If anything looks off, change one input and compare the updated outputs to isolate the issue quickly.

Study Strategy

Sources & Methodology

Last updated:

Frequently Asked Questions

  • An LFSR is a shift register that uses XOR of selected bit positions (taps) to compute the feedback input bit. Each clock cycle shifts the register right and inserts the feedback bit at the left, producing a pseudo-random output bit sequence.