← all environments 12 · Advanced · Sequential digital · v0.1.0
Maximal-Length LFSR
Sequential digitalA 4-bit Fibonacci linear-feedback shift register with taps at stages 3 and 4 — the primitive polynomial . Each clock edge shifts the register and feeds back the XOR of the tapped bits. The result cycles through all 15 non-zero states before repeating: a deterministic sequence wearing the disguise of randomness.
7 components · 11 connections · clocked shift register over GF(2)
the ahaA handful of flip-flops and a single XOR generate a stream that passes for random — yet is perfectly deterministic and repeats after exactly steps.
why it works
Each clock edge, the register shifts one place and a new bit enters from the left: the XOR of a chosen set of taps. Over the field this is just repeated multiplication, and if the tap positions correspond to a primitive polynomial — here — the register visits every non-zero 4-bit state before returning home. That is states in a fixed but scrambled order: a maximal-length sequence. It looks statistically random (equal 0s and 1s, flat autocorrelation) which is why LFSRs sit inside CRCs, spread-spectrum radios, and cheap noise sources — yet knowing the taps and one state predicts all of it forever. The all-zero state is the one trap: it maps to itself, a dead register.
governing model
structural inventory
- shared clock
- D flip-flop chain
- XOR feedback taps
- serial m-sequence output
boundaries
- period
- all-zero state forbidden
- primitive polynomial taps
fault relay feedback tap moved (short cycle)
-
Single-step the clock and read the state.
Each edge produces a new 4-bit pattern. Write them down — you will pass through all 15 non-zero values with no repeats until the cycle closes. -
Confirm the period is exactly 15.
The sequence returns to its start after clocks. Fewer flip-flops would give ; the maximal length is the payoff of primitive taps. -
Move a feedback tap.
A non-primitive tap set shatters the one long cycle into several short ones — the register gets stuck in a stunted loop of length 5 or 3. Same hardware, ruined sequence.
causal signal trace paused
Clock the register One clock edge samples every D input simultaneously.
step 1 / 7 Clock the register
Loading Maximal-Length LFSR model…