adapted from Harowitz and Hill, The Art of Electronics, page 657:
(where
m is the length of the linear feedback (right-)shift register, and the
taps are to be XOR'd to make the next input for the register. For example: m=6
"ShiftIN <= Q(5) xor Q(4);" where Q(5) is the bit shifted out of the register in the next cycle.
)
| m | tap bit(s) | cycles-before-repeat |
| 3 | 2 | 7 |
| 4 | 3 | 15 |
| 5 | 3 | 31 |
| 6 | 5 | 63 |
| 7 | 6 | 127 |
| 8 | 4, 5, and 6 | 255 |
| 9 | 5 | 511 |
| 10 | 7 | 1023 |
| 11 | 9 | 2047 |
| 15 | 14 | 32767 |
| 16 | 4, 13, and 15 | 65535 |
| 17 | 14 | 131071 |
| 18 | 11 | 262143 |
| 20 | 17 | 1048575 |
| 21 | 19 | 2097151 |
| 22 | 21 | 4194303 |
| 23 | 18 | 8388607 |
| 24 | 17, 22, and 23 | 16777215 |
| 25 | 22 | 33554431 |
| 28 | 25 | 268435455 |
| 29 | 27 | 536870911 |
| 31 | 28 | 2147483647 |
| 33 | 20 | 8589934591 |
| 35 | 33 | 34359738367 |
| 36 | 25 | 68719476735 |
| 39 | 35 | 549755813887 |
Interesting note: a 100-bit LFSR clocked at 10MHz takes one million times longer than the age of the visible universe to repeat.