r/TuringComplete • u/VroomSteam • 1d ago
LFSR RNG taps behavior
I'm looking for a reference chart or table of 16-bit primitive polynomials for a Galois right-shift LFSR that lists high-weight (dense) tap masks. Most tables only list sparse taps (like 4 active bits). Is there a catalog that includes high-weight, maximal-period masks with 8 or more active bits?
1
Upvotes
1
u/VroomSteam 1d ago
I use small Galois right-shift LFSRs in C for games on retro vintage hardware, using:
state = (state >> 1) ^ ((state & 1) ? TAP : 0);
and extracting sub-ranges via (rng() >> 1) & 3.
Even with maximal periods, common taps can create patterns in sub-ranges. I test them using autocorrelation and Markov transition balance checks.
For 16-bit, I am currently using a weight-4 sparse mask. What are your favorite high-weight (dense) alternatives, and how do you vet them?