Search for a tool
Linear Feedback Shift Register

Tool to use a linear feedback shift register or LFSR and generate pseudo-random bits using XOR exclusive OR operations.

Results

Linear Feedback Shift Register -

Tag(s) : Informatics

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Linear Feedback Shift Register' tool for free! Thank you!

Linear Feedback Shift Register

LFSR Bits Generator

LFSR in Fibonacci Mode


Loading...
(if this message do not disappear, try to refresh this page)




Answers to Questions (FAQ)

What is a linear feedback shift register? (Definition)

A linear feedback shift register or LFSR is a system that generates bits from a register and a feedback function.

After several iterations, the register returns to a previous state already known and starts again in a loop, the number of iterations of which is called its period.

In practice, this kind of LFSR register is useful in cryptography because it allows the generation of pseudo-random numbers when the period is long enough.

How does a LFSR work?

From the current state of the binary register, a bit selection is chosen to apply an XOR operation to it.

The result is then concatenated at the start of the register (on the left) while the final value (on the right) is deleted from the register and displayed at the output.

Example: The register is 1010, an XOR ⊕ is applied to bits 0 and 2 (numbered from left to right starting from 0)

StepRegisterXOROutput
0_______01010 ⊕ 0 = 0
1______0010_0 ⊕ 1 = 11
2_____1001__1 ⊕ 0 = 10
3____1100___1 ⊕ 0 = 11
4___1110____1 ⊕ 1 = 00
5__0111_____0 ⊕ 1 = 10
6_1011______0 ⊕ 1 = 11
70101_______0 ⊕ 0 = 01

How to use a LFSR?

To use an LFSR, the user must configure the register length, determine the initial configuration of the flip-flops, choose an appropriate linear feedback function (XOR), and specify the number of iterations/cycles needed to generate the desired sequence.

How to calculate the period of an LFSR?

The period of an LFSR is the number of iterations necessary for the generated sequence to return to its initial state.

If the register is at maximum feedback, there is no repetition, except after 2^n - 1 iteration, with n the length of the register.

Source code

dCode retains ownership of the "Linear Feedback Shift Register" source code. Any algorithm for the "Linear Feedback Shift Register" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Linear Feedback Shift Register" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Linear Feedback Shift Register" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Linear Feedback Shift Register" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source. Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link: https://www.dcode.fr/linear-feedback-shift-register
In a scientific article or book, the recommended bibliographic citation is: Linear Feedback Shift Register on dCode.fr [online website], retrieved on 2025-04-23, https://www.dcode.fr/linear-feedback-shift-register

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Linear Feedback Shift Register' tool for free! Thank you!


https://www.dcode.fr/linear-feedback-shift-register
© 2025 dCode — The ultimate collection of tools for games, math, and puzzles.
 
Feedback