I’m struggling with the mathematical representation of an LFSR as polynomials, and I’d like to understand where I go wrong.
In my example, I use an LFSR with a 5-bit shift to the left and feedback on bits $b_4$ and $b_2$.
My LFSR polynomial is:
$$ P(x) = x^4 + x^2 + 1 $$
Starting with the initial state $(b_4, b_3, b_2, b_1, b_0) = (0, 1, 1, 0, 0)$, we can represent this state as:
$$ S_0(x) = x^3 + x^2 $$
To find $S_1(x)$, I calculated $S_1(x) = (x \cdot S_0(x)) \bmod P(x)$:
$$ S_1(x) = (x^4 + x^3) \bmod P(x) = x^3 + x^2 + 1 $$
This gives me the sequence $(0, 1, 1, 1, 0)$, but I was expecting the sequence $(1, 1, 0, 0, 1)$.
Could someone explain my mistake, please?
I also looked at this answer, which discusses getting the output sequence from the characteristic polynomial. However, I’m confused because, in that example, it seems that $S_1 = x^3$ and then $S_2 = x^3 + 1$, which doesn’t appear to involve a shift.
Edit : I really try my best to understand this answer on this topic but i can't figure out why the states given are valide (How can we have S1=(0,0,0,1) and then S2=(1,0,0,0) i dont see shift here O_O)
Have a great day !
Edit : @fgrieu points that I had the wrong polynomial P(x), it should be $$ P(x) = x^5 + x^2 + 1 $$ I don't know if I should edit directly for the original post ^^
