LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Primitive Polynomial (Generate Bits VI)

Solved!
Go to solution
Solution
Accepted by josephkirmani

Primitive Polynomials.png

I took your suggestion and installed the Modulation Toolkit.  I think I am now in a position to fully explain the problem and the logic of the correct solution.  [You might consider giving me some credit for this help].

 

My first suggestion, which would probably have led you quickly to the correct solution, is to always wire in an Error Indicator.  It also (sometimes) helps to make really simple VI with constants wired in instead of Controls -- makes it easier to test with "known values".

 

The top example uses the 4th degree Primitive Polynomial you mentioned in your original post.  I wrote the actual polynomial above the (Boolean) array of its coefficients.  When I ran it and looked at the Error Indicator, I saw Error -21802, whose explanation is that the Primitive Polynomial must be of degree 5 to 31, so 4 doesn't work.  There are several Primitive Polynomials of degree 5 -- I chose 1+x^2+x^5, and wired it into the second Generate Bits function.  This ran without any error.

 

Finally, the polynomial you used in your "solution", 1+x+x^4+x^5, is of degree 5, but it is not a Primitive Polynomial (there are six of them, including the one that I used).  Thus the sequence generated by your code will not be of maximal length (31), whereas mine will be.  Indeed, I just test where my sequence repeats (I looked at the output on the Front Panel, made a copy underneath it, and started scrolling the copy until the two outputs matched -- the Index was 31).  When I do the same thing with the sequence you used, it repeats every 4 bits.

 

Thank you for this opportunity to reacquaint myself with Galois Fields (I used PseudoRandom Binary Sequences, or PRBS, early in my career).  I hope this explanation / solution is helpful to you.

 

Bob Schor

Message 11 of 11
(695 Views)