Library
Back to reading

What Is a Linear Feedback Shift Register?

How Does a Linear Feedback Shift Register Generate Pseudorandom Binary Sequences?

A Linear Feedback Shift Register (LFSR) is a digital circuit that generates long sequences of binary digits that exhibit many of the statistical properties of random noise. Despite their apparent randomness, these sequences are completely deterministic and repeat after a predictable interval. LFSRs are widely used in communication systems, error-control coding, spread-spectrum signalling, digital testing, and some cryptographic applications because they can generate complex binary sequences using very simple hardware.

The basic principle is straightforward. An LFSR consists of a series of binary storage elements, known as flip-flops, connected as a shift register. At each clock pulse, every stored bit shifts one position along the register while a new input bit is calculated from selected stages of the register. This feedback bit is produced using one or more Exclusive-OR (XOR) operations. The choice of feedback connections, often called taps, determines the characteristics and period of the generated sequence.

A useful analogy is a line of people each passing a coloured ball to the next person every second. Before the first person receives a new ball, they determine its colour by applying a simple rule to the colours currently held by selected people in the line. Although the rule is simple, the resulting sequence of colours can appear highly unpredictable while remaining completely repeatable.

When the feedback taps are chosen appropriately, an n-stage LFSR can generate a maximum-length sequence, often called an m-sequence, containing 2ⁿ − 1 bits before repeating. For example, a 10-stage LFSR can generate a sequence of 1,023 bits, while a 16-stage LFSR produces a sequence of 65,535 bits. These sequences possess desirable statistical properties, including nearly equal numbers of zeros and ones, excellent autocorrelation characteristics, and predictable spectral behaviour.

LFSRs play an important role in communication systems. In Direct Sequence Spread Spectrum (DSSS), they generate the pseudorandom spreading codes used to spread the transmitted signal over a much wider bandwidth. Similar sequences are used in Code Division Multiple Access (CDMA) systems, ranging systems, frame synchronisation, data scrambling, and test pattern generation. LFSRs also underpin many Cyclic Redundancy Check (CRC) generators and other error-control coding techniques, where their polynomial structure provides efficient hardware implementations.

It is important to distinguish an LFSR from a cryptographically secure pseudorandom number generator (CSPRNG). Although LFSRs produce sequences with excellent statistical properties, their linear structure makes them mathematically predictable if sufficient output bits are observed. Consequently, a single LFSR is generally unsuitable for modern encryption systems. Cryptographic applications instead employ multiple LFSRs combined with nonlinear functions or more sophisticated algorithms designed to resist cryptanalysis.

Today, Linear Feedback Shift Registers remain fundamental building blocks in digital communications and electronic systems. Their simplicity, high speed, and efficient hardware implementation make them indispensable for spread-spectrum communications, channel coding, data scrambling, digital testing, and many other applications where deterministic pseudorandom binary sequences are required.

Back to reading