Linear Feedback Shift Register

Register Shift


A Linear Feedback Shift Register (LFSR) is a type of shift register, a sequential circuit used in digital communication and computing systems. LFSRs are particularly useful for generating pseudo-random sequences, implementing finite-state machines, and error-detecting digital signal processing. The circuit takes the output of one or more bits of the register, combines them linearly using the XOR operation, and feeds the result back into the input, creating a continuous cycling pattern.

Key Takeaways

  1. A Linear Feedback Shift Register (LFSR) is a sequential shift register with a linear feedback function, mainly used in digital systems and communication technology for generating pseudo-random binary numbers, error detection/correction, and cryptography.
  2. An LFSR is composed of a series of flip-flops, a clock signal, and feedback logic (usually XOR or XNOR gates), which uses the current state of the flip-flops to determine the next state of the register during a clock cycle.
  3. The output sequence generated by an LFSR has a characteristic maximum length depending on the number of flip-flops and feedback tap positions before the pattern repeats, making it useful for applications that require a predictable cycle length with minimal hardware resources.


The technology term Linear Feedback Shift Register (LFSR) is important because it represents a critical component in the design of digital systems, specifically for generating pseudo-random number sequences, encryption algorithms, and error detection/correction codes.

LFSRs are efficient, with simple hardware implementation, enabling quick execution and low power consumption.

Consequently, they are widely employed in applications such as communication systems, digital signal processing, cryptography, and hardware testing.

By providing advanced functionalities with minimal complexity, LFSRs have become a valuable tool in improving the performance, security, and reliability of various digital systems.


A Linear Feedback Shift Register (LFSR) is a versatile and essential component in modern digital systems, particularly in the fields of cryptography, error detection and correction, as well as digital signal processing. The primary purpose of an LFSR is to generate a sequence of binary numbers, which appears to be random even though it is produced by a deterministic process.

This pseudo-random number generation capability makes LFSRs ideal for applications such as stream ciphers, spread spectrum communications, or for implementing noise-like sequences in simulators and test equipment. In addition to their role in generating pseudo-random sequences, LFSRs are known for their high-speed operation and simple hardware implementation.

The basic structure of an LFSR consists of a shift register and a feedback network, which combines the outputs of specific stages within the shift register via exclusive or (XOR) gates and feeds the result back into the input of the register. As the shift register is clocked, its contents shift position, creating a cyclical pattern of bits based on the initial state or “seed” value.

Depending on the feedback configuration, different sequences or “polynomial tap configurations” can be generated, potentially maximizing the period length of the pseudo-random bit sequence. The inherent mathematical properties of LFSRs also make them instrumental in error detection and correction techniques, such as in Cyclic Redundancy Check (CRC) circuitry, where transmitted data can be efficiently verified for integrity and corrected to a certain degree if errors occur during transmission.

Examples of Linear Feedback Shift Register

A Linear Feedback Shift Register (LFSR) is a digital circuit that generates a sequence of binary bits using linear feedback. LFSRs have various applications in the field of technology, including cryptography, digital communication, and computer simulation. Here are three real-world examples of where LFSRs are utilized:

Stream ciphers: LFSRs play a crucial role in the development of cryptographic algorithms, specifically in key stream generation for stream ciphers. A well-known example is the A5/1 algorithm, used in the GSM mobile communication system. The A5/1 algorithm combines the outputs of three different LFSRs to generate a pseudorandom sequence of bits used for encrypting voice data in GSM cellular networks.

Pseudorandom number generators: LFSRs are used as the basis for certain types of pseudorandom number generators, providing seemingly random sequences of numbers that can be used in computer simulations, random testing, and numerical analysis. For example, they are employed in the Maximum Length Sequence (MLS) generation, which is crucial in areas such as audio engineering for room impulse response measurements and system identification.

Error detection and correction: LFSRs are utilized in error detection and correction algorithms, like cyclic redundancy check (CRC) codes. CRC codes are widely used in digital communication systems, such as data transmission and data storage, for error detection purposes. These codes use LFSRs to compute CRC values and ensure data integrity during the transmission or storage process.

Linear Feedback Shift Register FAQ

What is a Linear Feedback Shift Register (LFSR)?

A Linear Feedback Shift Register (LFSR) is a type of shift register used mainly in digital systems to generate a sequence of binary bits. It is a simple and efficient method to produce pseudorandom binary sequences with applications in cryptography, error detection and correction, and digital signal processing.

How does an LFSR work?

An LFSR consists of a series of flip-flops connected in a chain, with the output of one flip-flop serving as the input of the next. Additionally, it includes a feedback path where the outputs of certain flip-flops are combined using XOR gates and fed back as an input to the first flip-flop in the chain. This feedback mechanism leads to a shift pattern that generates a pseudo-random sequence of bits.

What are the applications of LFSRs?

LFSRs are widely used in various digital systems due to their simplicity, efficiency, and ability to produce pseudorandom sequences. Some common applications include cryptography, error detection and correction, digital signal processing, stream ciphers, and hardware testing.

What is the difference between maximal length LFSRs and non-maximal length LFSRs?

A maximal length LFSR generates the longest possible sequence of output bits before repeating, given its number of stages (flip-flops). This sequence length is equal to 2^n – 1, where n is the number of stages. Non-maximal length LFSRs produce shorter sequences, which may be desirable for particular applications but can also lead to less randomness in the generated output.

How can you change the sequence generated by an LFSR?

The sequence generated by an LFSR can be changed by modifying the initial state of the flip-flops (seed), altering the feedback path configuration, or changing the number of stages in the register. By adjusting these factors, different pseudorandom sequences can be produced, allowing for customization of the LFSR’s output to suit specific applications.

Related Technology Terms

  • Bit Manipulation
  • Pseudorandom Number Generation
  • Maximum Length Sequence
  • Polynomial Representation
  • XOR Operation

Sources for More Information

  • National Instruments – A reliable source for concepts and applications related to test, measurement, and control technology, including Linear Feedback Shift Registers.
  • Xilinx – A leading provider of programmable platforms, offering valuable information about FPGA logic technologies such as Linear Feedback Shift Registers.
  • IEEE Xplore – An extensive digital library and resource for articles, papers, and conference proceedings related to Electrical Engineering and Computer Science, including Linear Feedback Shift Registers.
  • ASIC World – A comprehensive resource for information related to Application Specific Integrated Circuits (ASICs) and other digital design concepts, including Linear Feedback Shift Registers.

Technology Glossary

Table of Contents

More Terms