← ProblemsCircuits / Sequential Logic / Shift Registers
32-bit LFSR
15%shift-registersvectorsBuild a 32-bit Galois LFSR with taps at bit positions 32, 22, 2, and 1. As in the 5-bit version, the register shifts right and the output bit q[0] is XORed into the bit entering each tap position:
q[31]getsq[0](the shift-in at the top tap)q[21]getsq[22] ^ q[0]q[1]getsq[2] ^ q[0]q[0]getsq[1] ^ q[0]- every other bit
q[i]getsq[i+1]
reset is synchronous, active-high, and sets the register to 32'h1. (At 32 bits you'll want vector part-selects, not 32 separate assignments.)