2

I have been using an LFSR implemented according to a primitive polynomial, but as you know an LFSR produces a number of possible values in a repeating order which means that it is not truly random!

one solution to keep using the LFSR and assure that it produces a truly random value is to use some sort of dynamic way of reading values outputed from the LFSR but I can't figure out how to do this in hardware(VHDL)!

Therefore I am after an alternative way of truly producing a random unexpected repeating value of a defined length ie. 10-bits

Any suggestions? I am planning to implement them in VHDL!

Aboudi
  • 308
  • 1
  • 2
  • 17
  • 1
    Is there a [specific programming](http://stackoverflow.com/help/on-topic) question here? –  Feb 11 '16 at 20:43
  • Instead of reinventing a random generator by some kind of "dynamic way of reading values", which may have unknown artifacts making it a bad random generator, you can consider using a [LFSR](https://en.wikipedia.org/wiki/Linear_feedback_shift_register) that is longer than required for the random sequence, and then use the additional bits for initialization e.g. based on timestamp, MAC address, and/or other external data. Thereby the same sequence is never reused, and you can stick to well-known technology that is easy to implement. – Morten Zilmer Feb 12 '16 at 11:39
  • @user1155120 Yes Because I want to implement the solution in VHDL otherwise I would have not put "VHDL" as a tag! – Aboudi Feb 12 '16 at 11:40
  • @Aboudi: The question is a matter of selecting an algorithm for random generation, and the fact that you want to implement this algorithm in VHDL really doesn't make it a VHDL specific question. – Morten Zilmer Feb 12 '16 at 11:42
  • 2
    look at this question: there is somewhat true RNG for FPGA. Idea is to have kind of an /asynchronous/ LFSR and latch data from it synchronously. http://stackoverflow.com/questions/14497877/how-to-implement-a-pseudo-hardware-random-number-generator/26280438#comment44436024_26280438 – lvd Feb 12 '16 at 15:06
  • @lvd: Thanks that makes sense, I'm sure it would work, I'll go ahead and implement it! – Aboudi Feb 12 '16 at 15:34

1 Answers1

3

Generating TRUE random numbers is actually a field of research on it's own. Basically you will need to gather information about some seemingly random natural phenomena via some kind of sensor. Hardware and software for the moment are deterministic so having the same input will always result in the same output. Gathering external sensor information can "randomize" your input.

Here some reading : https://en.wikipedia.org/wiki/Pseudorandom_number_generator

Also, here is a practical example of using external sensor input in a peer reviewed journal article, titled Random Number Generated from White Noise of Webcam, with a short nugget of info from the abstract:

Random number generators play a very import role in modern cryptography, especially in personal information security. For example, to generate random number from white noise of webcam is a new approach for personal device. Through our algorithms, 91% IPcam generating sequences pass at least four statistical tests, 87% pass all five ones has been approved. Compared with webcam and video respectively, on the contrary, the possibility for both generating sequences to pass all five statistical tests is roughly 80%. The result implies improvement by algorithm on personal devices such as laptop, for instance, is necessary to generate qualified random number to protect private information.

bwright
  • 896
  • 11
  • 29
  • That seems to make a lot of sense, however what about if my design does gather any info from external sensors? – Aboudi Feb 11 '16 at 16:22
  • take this information as a number representation and send it through a random number generator. – bwright Feb 11 '16 at 16:27