0

So I am trying to make a 8-bit PRNG using a LFSR but I am told to use a specific polynomial(X^8 + x^3 + 1). How exactly do I implement this polynomial? I need help understanding how I can design a PRNG using a LFSR.

bzrk89
  • 55
  • 3
  • 9
  • 1
    The wikipedia item [Fibonacci LFSRs](http://en.wikipedia.org/wiki/Linear_feedback_shift_register#Fibonacci_LFSRs") has a small schematic for a many into one polynomial of x^{16} + x^{14} + x^{13} + x^{11} + 1. Do you think you could do the equivalent for your polynomial? An 8 bit shift register with tap offs XOR'd for feedback. Were you also told to provide a seed? –  Feb 18 '15 at 06:03
  • @DavidKoontz Yes I was told to provide a seed, I am also told that that I can use the above listed polynomial OR the primitive polynomial (1 + x^2 + x^3 + x^4 + x^8). – bzrk89 Feb 18 '15 at 06:35
  • Google [How do you implement a polynomial in a LFSR](https://www.google.dk/#q=How+do+you+implement+a+polynomial+in+a+LFSR) for start. – Morten Zilmer Feb 18 '15 at 07:23

2 Answers2

1

Xilinx wrote a good AppNote on how to implement 'pseudo random number generators' (PRNGs). The AppNote describes how to implement an LFSR based and shift register optimzed PRNG for 3..168 bits.

Efficient Shift Registers, LFSR Counters, and Long PseudoRandom Sequence GeneratorsXilinx [XAPP 052][1996.07.07]

Paebbels
  • 15,573
  • 13
  • 70
  • 139
0

You can just write it like feedback_polynome shows x^8 + x^3 + x^0 where x^8 is actually 7th bit,x^3 is actually 2nd bit and x^0 is always 1.

feedback_polynome := temp_out(8-1) xor temp_out(3-1) xor temp_out(0); temp_out <= feedback_polynome & temp_out(7 downto 1);

p.s i hope u have found a better solution till now

hrsd
  • 21
  • 5