A simple example of finding the LFSR when the original root polynomial and the initial value of the register are known

A Linear Feedback Shift Register (LFSR) is a simple structure for generating a sequence of pseudorandom numbers. Here we have a tetranomial primitive root polynomial p ( x ) = 1 + x + 0 x 2 = 11 0 2 p(x) = 1 + x + 0x^2 = 110_2p(x)=1+x+0x _2=1102and initial value S 0 = 100 S_0 = 100S0=100 . We will use the LFSR action procedure to generate a pseudo-random sequence.

The action process of LFSR is as follows:
insert image description here

Load initial values ​​into registers.
For each clock cycle:
a. Exclusive OR (XOR) the current value in the register with the non-zero term of the original root polynomial.
b. Shift the result one bit to the right, and place the result of the exclusive OR (XOR) operation into the highest bit.
Now, we will describe the action process of LFSR in detail:

Load initial value: S 0 = 100 S_0 = 100S0=100 .
Clock cycle 1:
a. XOR operation:1 ⊕ 0 = 1 1 \oplus 0 = 110=1 , the target is the first and second bits of the register from left to right
b. Shift right and update the highest bit:S 1 = 110 S_1 = 110S1=110 .
Clock cycle 2:
a. XOR operation:1 ⊕ 1 = 0 1 \oplus 1 = 011=0 .
b. Shift right and update the highest bit:S 2 = 011 S_2 = 011S2=011 .
Clock cycle 3:
a. XOR operation:0 ⊕ 1 = 1 0 \oplus 1 = 101=1 .
b. Shift right and update the highest bit:S 3 = 101 S_3 = 101S3=101 .
Clock cycle 4:
a. XOR operation:1 ⊕ 0 = 1 1 \oplus 0 = 110=1 .
b. Shift right and update the highest bit:S 4 = 110 S_4 = 110S4=110 . Enter the cycle from this bit
After clock cycle 4, the value of the register returns to the first calculated value after the initial value operationS 1 = 110 S_1 = 110S1=110 , so the sequence will start repeating. So, the pseudo-random sequence generated by LFSR is:
100,110,011,101,110,…

Guess you like

Origin blog.csdn.net/Chahot/article/details/130121945