Home Back

Linear Feedback Shift Register Calculator

LFSR Equation:

\[ \text{next} = (\text{state} \gg 1) \oplus \text{feedback} \text{ if lsb} \]

(integer)
(integer or hex)
(1-100)

Unit Converter ▲

Unit Converter ▼

From: To:

1. What is a Linear Feedback Shift Register?

A Linear Feedback Shift Register (LFSR) is a shift register whose input bit is a linear function of its previous state. They are commonly used in digital circuits for pseudo-random number generation, cryptography, and error detection.

2. How Does the Calculator Work?

The calculator implements the standard LFSR algorithm:

\[ \text{next} = (\text{state} \gg 1) \oplus \text{feedback} \text{ if lsb} \]

Where:

Explanation: The register shifts right by one bit. If the LSB was 1, it XORs the new state with the feedback value.

3. Applications of LFSRs

Details: LFSRs are used in digital communications, cryptography, built-in self-test (BIST) for hardware, and as pseudo-random number generators.

4. Using the Calculator

Tips: Enter initial state as decimal or hexadecimal (prefix with 0x), feedback polynomial, and number of iterations (1-100). The calculator will show each step of the LFSR operation.

5. Frequently Asked Questions (FAQ)

Q1: What makes a good feedback polynomial?
A: Good feedback polynomials are primitive polynomials that generate maximal-length sequences (2^n - 1 states before repeating).

Q2: How do I represent the feedback polynomial?
A: It's typically represented as a binary number where 1 bits indicate tap positions. For example, 0xB4 (binary 10110100) taps bits 7,5,4,2.

Q3: What's the maximum length sequence?
A: For an n-bit LFSR with a primitive polynomial, the maximum sequence length is 2^n - 1 before repeating.

Q4: Are LFSRs cryptographically secure?
A: No, simple LFSRs are not cryptographically secure as their output can be predicted with enough observations.

Q5: What are Galois vs Fibonacci configurations?
A: Fibonacci (external XOR) is shown here. Galois (internal XOR) has taps XOR'd into multiple bits but produces identical sequences.

Linear Feedback Shift Register Calculator© - All Rights Reserved 2025