A linear feedback shift register, or LFSR, shifts its state and inserts an XOR-derived feedback bit. Appropriate tap choices produce long deterministic sequences useful for pattern generation and other digital functions. Its behavior depends on the exact direction, tap convention and initialization.
Worked example
Define a four-bit update as new Q = {old Q[2:0], old Q3 XOR old Q0}. From seed 0001, the next states begin 0011, 0111, 1111 and 1110. Under this convention the chosen taps give a 15-state nonzero cycle; trace it to verify the period.
What to watch for
An XOR LFSR initialized to all zeros remains there. An LFSR sequence is predictable and is not suitable by itself as a cryptographic random generator.
Try it yourself
Using the stated update, what follows 1110?
Answer: Old Q3 XOR Q0 = 1 XOR 0 = 1. Shift the low three bits 110 left and append one: the next state is 1101.
How to study this topic
Define the reset state and update rule before tracing a sequence. List several successive states by hand and check the wraparound. Bit direction, enable behavior and illegal-state handling are part of the specification.
Explore related programmes
These recorded programmes are upcoming. This article is general educational content, not a syllabus or course sample.
Digital Electronics