View Single Post
  #15 (permalink)  
Old 07-06-2009, 05:46 PM
Nicholas Kinar
Guest
 
Posts: n/a
Default Re: Generating Maximum Length Sequence using Galois LFSR


> It's good to keep track of the algebra. For a generating
> polynomial G of degree m over GF(2), you are computing the remainder
>
> x^n mod G
>
> for a series of values n=0, n=1,....
>
> This remainder is a polynomial over GF(2) of (at most) degree m-1.
> How you represent it in a bit field is totally up to you,
> and your method is as correct as any.
>
> Steve


In my C++ implementation, I use an std::vector<bool>v to keep track of
the zeros and the ones, so I can simply generate an MLS without having
to worry about bit-shifting a uint32_t or uint16_t or similar variable.
To do the rotation, I simply pop a bit off the back of the vector, do
the XOR with the taps, and then insert the resulting bit at the front of
the vector. It works quite well, but for embedded hardware, it might be
a little bit too slow for a quick implementation.


Nicholas
Reply With Quote