Electrical – How to design a circuit for genrating random numbers

circuit-designrandom number

I'm working on a project, where we need to generate random numbers between 1-5. After researching a bit I figure out generally LFSR (Linear-feedback shift register) is used for generating random numbers (more preciously Pseudo-random).

So, I used 3 bit LFSR with polynomial \$x^3 + x + 1\$, which generates \$2^3 – 1 = 7\$ numbers {1, 2, 3, 4, 5, 6, 7}. Now I need to somehow map {6, 7} to one of the number {1, 2, 3, 4, 5}.

I can not use a mod circuit as it will be deterministic. So, How can I randomly (or Pseudo randomly) map {6, 7} to {1, 2, 3, 4, 5}.

I'm not a electronics student, so pardon me If the question seems silly.

Best Answer

There are a lot of circuits around advertised as "digital dice". The usual approach is to use a counter which runs at high speed, for a time determined by how long the user presses the button. Since a human can't press a button repeatably for the same number of microseconds, this produces acceptably random numbers.

The purist approach is to use a genuine noise source such as a silicon junction (diodes, especially Zeners), and amplify it. In a suitably shielded case this will produce "real" noise which you can use for cryptographic purposes.