Verilog four tap linear feedback shift register

broken image
broken image

In the case of primitive 6 th-degree polynomials, there are only six. Every number between 1 and 31 will occur in the shift register before it repeats. Consequently, a 6 th-degree polynomial will have 31 different states. A new state is transitioned to after each shift. A maximum length polynomial of degree n will have 2 n - 1 different states. We are interested in primitive polynomials because they will give us maximum length periods when shifting. Just as with numbers, some polynomials are prime or primitive. There are 2 (6 - 1) = 32 different possible polynomials of this size. For example, a 6 th-degree polynomial with every term present is represented with the equation x 6 + x 5 + x 4 + x 3 + x 2 + x + 1. LFSRs and PolynomialsĪ LFSR is specified entirely by its polynomial. Figure 2 shows an LFSR implementation in C, and Figure 3 shows a 16-bit LFSR implementation in 8051 assembly. Generating the pseudo-random numbers only requires a right-shift operation and an XOR operation. LFSRs (linear feedback shift registers) provide a simple means for generating nonsequential lists of numbers quickly on microcontrollers. The application note describes how they can be implemented and techniques that can be used to improve the statistical properties of the numbers generated. Linear feedback shift registers are introduced along with the polynomials that completely describe them.

broken image