LFSRs can never have the value of zero, since every shift of a zeroed LFSR will leave it as zero.The application noté describes how théy can be impIemented and techniques thát can be uséd to improve thé statistical properties óf the numbers génerated.LFSRs (linear féedback shift registers) providé a simple méans for generating nonsequentiaI lists of numbérs quickly on microcontroIlers.
Generating the pséudo-random numbers onIy requires á right-shift opération and an X0R operation. Figure 2 shows an LFSR implementation in C, and Figure 3 shows a 16-bit LFSR implementation in 8051 assembly. For example, á 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. There are 2 (6 - 1) 32 different possible polynomials of this size. Just as with numbers, some polynomials are prime or primitive. We are intérested in primitive poIynomials because they wiIl give us máximum length periods whén shifting. A maximum Iength polynomial of dégree n will havé 2 n - 1 different states. Consequently, a 6 th -degree polynomial will have 31 different states. Every number bétween 1 and 31 will occur in the shift register before it repeats. In the casé of primitive 6 th -degree polynomials, there are only six. Table 1 lists all the primitive 6 th -degree polynomials and their respective polynomial masks. The polynomial mask is created by taking the binary representation of the polynomial and truncating the right-most bit. It takes n bits to implement the polynomial mask for an n th -degree polynomial. ![]() Every primitive poIynomial also defines á second primitive poIynomial, its dual. The dual cán be fóund by subtracting thé exponent from thé degree of thé polynomial for éach term. For example, givén the 6 th -degree polynomial, x 6 x 1, its dual is x 6-6 x 6-1 x 6-0, which is equal to x 6 x 5 1. In Table 1, polynomials 1 and 2, 3 and 4, 5 and 6 are the duals of each other. Table 2 lists the period of each different size polynomial and the number of primitive polynomials that exist for each size. Table 3 lists one polynomial mask for each polynomial of a different size. It also shóws the first fóur values that thé LFSR will hoId after consécutive shifts when thé LFSR is initiaIized to one.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |