# Linear Feedback Shift Register Calculator

URL: https://speedycalculator.com/calculators/math/linear-feedback-shift-register/
Last updated: 2026-10-30

> The LFSR calculator runs a Fibonacci or Galois linear feedback shift register from a seed and tap pattern, listing the output bits, the states and the period (and whether it is maximal length).

## Inputs

- LFSR type
- Feedback
- Seed (initial state)
- Taps
- Number of output bits (0 = one full period)

## Results

- Output sequence
- Period
- States

## Formula

```
Fibonacci: new bit = XOR of tapped bits, shifted in on the left
Maximal period = 2ⁿ − 1 for n bits
```

## Explanation

LFSRs generate pseudo-random bit sequences with just a few logic gates. They are used in Wi-Fi scrambling, GPS codes, CRC checksums, built-in self-test of chips and old video game sound and random generators.

### How to use the Linear Feedback Shift Register Calculator

- **LFSR type**
- **Feedback**
- **Seed (initial state)**
- **Taps**
- **Number of output bits (0 = one full period)**

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

### How it works

Enter the seed and taps as bit strings of the same length (a 1 marks a tapped position). Choose Fibonacci or Galois form and XOR or XNOR feedback.

## Worked example

Inputs — LFSR type: Fibonacci; Feedback: XOR; Seed (initial state): 1001; Taps: 0011; Number of output bits (0 = one full period): 0.

Results — **Output sequence = 100110101111000**; Period = 15 (maximal length 2⁴ − 1); States = 1: 1100 → output 1
2: 0110 → output 0
3: 1011 → output 0
4: 0101 → output 1
5: 1010 → output 1
6: 1101 → output 0
7: 1110 → output 1
8: 1111 → output 0
9: 0111 → output 1
10: 0011 → output 1
11: 0001 → output 1
12: 1000 → output 1
13: 0100 → output 0
14: 0010 → output 0
15: 1001 → output 0.

## Key terms

- **Tap**: A register position fed back into the XOR.

## FAQ

**What is a maximal-length LFSR?**
One that cycles through all 2ⁿ − 1 non-zero states.

**Why can't the seed be all zeros?**
With XOR feedback the register would stay at zero forever.

**Is an LFSR cryptographically secure?**
No – the sequence can be recovered from 2n bits (Berlekamp–Massey).

**What is the difference between Fibonacci and Galois forms?**
Same sequences, different wiring: Galois XORs inside the register in parallel.


## Sources

- [Wolfram MathWorld – Shift register sequence](https://mathworld.wolfram.com/ShiftRegisterSequence.html)
