LFSR Formula:
From: | To: |
A Linear Feedback Shift Register (LFSR) is a shift register whose input bit is a linear function of its previous state. They are widely used in digital communications and cryptography for generating pseudo-random numbers.
The calculator uses the LFSR formula:
Where:
Explanation: The register shifts right by one bit. If the lsb was 1, the tap sequence is XOR'd with the new value. The mask ensures proper register length.
Details: LFSRs are efficient in hardware, produce long pseudo-random sequences, and are used in CRC checksums, scrambling, cryptography, and test pattern generation.
Tips: Enter initial state, tap positions, bitmask, and number of iterations. Common 8-bit tap value is 0xB4 (180), with mask 0xFF (255).
Q1: What makes a good tap sequence?
A: Taps should correspond to a primitive polynomial to achieve maximum-length sequence (2^n - 1 states for n-bit register).
Q2: How do I choose the mask value?
A: The mask should have bits set for all positions you want in your register (e.g., 0xFF for 8 bits, 0xFFFF for 16 bits).
Q3: What's the significance of the initial state?
A: The initial state (seed) must be non-zero. All-zero state will remain zero. Different seeds produce different sequences.
Q4: Can LFSRs be cryptographically secure?
A: Simple LFSRs are not secure alone, but can be combined to create more secure systems (e.g., A5/1 cipher in GSM).
Q5: What are common applications?
A: Digital broadcasting, GPS, hardware testing, pseudo-random number generation, and stream ciphers.