-
sdr.FLFSR.reset(state: ArrayLike | None =
None
) Resets the Fibonacci LFSR state to the specified state.
- Parameters:¶
Examples¶
Step the Fibonacci LFSR 10 steps to modify its state.
In [1]: c = galois.primitive_poly(7, 4); c Out[1]: Poly(x^4 + x^2 + 3x + 5, GF(7)) In [2]: lfsr = sdr.FLFSR(c); lfsr Out[2]: <Fibonacci LFSR: c(x) = x^4 + x^2 + 3x + 5 over GF(7)> In [3]: lfsr.state Out[3]: GF([1, 1, 1, 1], order=7) In [4]: lfsr.step(10) Out[4]: GF([1, 1, 1, 1, 5, 5, 1, 3, 1, 4], order=7) In [5]: lfsr.state Out[5]: GF([5, 5, 6, 6], order=7)
Reset the Fibonacci LFSR state.
In [6]: lfsr.reset() In [7]: lfsr.state Out[7]: GF([1, 1, 1, 1], order=7)
Create an Fibonacci LFSR and view its initial state.
In [8]: c = galois.primitive_poly(7, 4); c Out[8]: Poly(x^4 + x^2 + 3x + 5, GF(7)) In [9]: lfsr = sdr.FLFSR(c); lfsr Out[9]: <Fibonacci LFSR: c(x) = x^4 + x^2 + 3x + 5 over GF(7)> In [10]: lfsr.state Out[10]: GF([1, 1, 1, 1], order=7)
Reset the Fibonacci LFSR state to a new state.
In [11]: lfsr.reset([1, 2, 3, 4]) In [12]: lfsr.state Out[12]: GF([1, 2, 3, 4], order=7)