# How to develop a random number generation device

Discussion in 'Electronic Design' started by [email protected], Sep 6, 2007.

1. ### Guest

Hi,

I'm a researcher. As a part of my project work I want to desing a
random number generated and displayed on a LCD/ LED module. Can
anybody help me out in this.

Thiagu

2. ### Spehro PefhanyGuest

Maybe you should research how to generate random numbers.

Displaying a number is not very complex, maybe as simple as:
"printf("%d", x);"

Best regards,
Spehro Pefhany

4. ### Mahurshi AkillaGuest

Typically, the microcontroller that you use has a random number
generator (it may not be truly random, of course) which is "good
enough" for most school projects (I am assuming this is a school
project here)

I remember using PIC and Motorola microcontrollers a few years ago and
they both had some way of getting a random number. I just had to
"scale" the numbers so they ended up in the ranges I wanted.

What microcontroller are you using? Try looking up its user guide for
the assembly/c/BASIC command to get random numbers.

Mahurshi Akilla

5. ### Rich GriseGuest

Get a piece of cesium-137 for \$79.00, like from here:
http://www.unitednuclear.com/isotopes.htm
Set it up next to a radiation counter, like a Geiger-Mueller tube
or something (would a PV cell catch betas or gammas?), and use its
output to clock a counter or pseudorandom generator.

Good Luck!
Rich

1. Take a radio, tune it away from stations.
2. Connect the radio to the input of a sound card.
3. Compute the 1/16 hash of the wave input.

DSP and Mixed Signal Design Consultant

http://www.abvolt.com

7. ### Rich GriseGuest

OK, I'm an ignoramus, but what's a "1/16 hash" - I know what a hash
is, and I know what 1/16 means, but I can't imagine what 1/16 of
a hash could be.

Thanks,
Rich

The quantity of the random numbers at the output should not exceed the
entropy of the incoming noise like signal. Otherwise the random numbers
will not be truly random; there will be the statistical dependencies.

The simple way to deal with this problem is computing a hash of the
incoming data. So you generate one random word from 16 incoming words.
The 1/16 will make a near perfect randomness taking the radio noise
spectrum and the typical audio sampling rate into the account.

DSP and Mixed Signal Design Consultant
http://www.abvolt.com

9. ### Martin GriffithGuest

Same here, my first guess was about drugs, but I don't think Valdimir
would be into that sort of thing

Martin

10. ### Guest

Search on pseudo-random binary sequence generators. Wikipedia has a
good general entry on the subject.

One way of getting a pseudo-random binary sequence is with a linear
feedback shift register - if you exclusive-OR the output with a couple
of carefully selected taps along the shift register you can guarantee
that the content of the shift register goes through all but one of tis
possible combinations.

OK, now I can understand.

BTW, once long ago, when we just moved to the US, I designed a
schematics. I noticed that this schematics always raised the mood of a
person who was looking at it. Later, they explained it to me. The reason
was the refdes: one of the fuses was marked as FU2.

DSP and Mixed Signal Design Consultant
http://www.abvolt.com

12. ### JamieGuest

what he's means in sort, is take a reading from the results every 1/16
of the total samples you acquired while recording the white/pink noise
from the receiver. this will give you a random set of values.
Hash is just a slang for noise that is unintelligent able. Something
you hear from FM radio while tuned on a dead area of the band with
MUTE off.

How ever, this doesn't help if you have to get a computer involved!
this means you would have to have something like a PIC,AVR or even a
Serial ROM chip that up load the data information so that you can
play it back to reference the signals for random control of the LED's

I think there is a better way to generate random signals at a more
basic level.

13. ### Rich GriseGuest

When I was a tech in the USAF, they'd use a number to designate a
particular sub-unit, and everyone's favorite component was the second
transistor on the fourth unit: 4Q2. ;-)

Cheers!
Rich

14. ### Rich GriseGuest

These things come up from time to time - does anyone know if there's an
algorithm for selecting taps for the maximum-length sequence, or is it
just by-guess-and-by-gosh?

Don L? Any ideas here?

Thanks,
Rich

15. ### John FieldsGuest

It's often more than just a couple of the taps and, with a little
ingenuity, the "lockup" state can be included in the sequence.

16. ### Guy MaconGuest

Ever hear of MIL-TFP-41C?

17. ### John FieldsGuest

---
Depending on the period, there's generally more than just one
maximal-length sequence, but I'm not aware of any algorithm which
can successfully predict which sequences will be maximal length.

Google "Table of irreducible polynomials" for some fascinating
reading, if you like that kind of thing.

I do

I have a photocopy of Marsh's "TABLE OF IRREDUCIBLE POLYNOMIALS OVER
GF(2) THROUGH DEGREE 19" which stops at degree 14, and the
introductory material indicates that all of the sequences were
unveiled/tested through the use of software.

That is, I guess, EXORing all of the taps sequentially and examining
the output sequences.

18. ### Guest

The rules of thumb appears to be:

1. Prime numbers tend to make good taps.
2. Good taps tends to have an even number of bits.

19. ### Guest

A simpler/cheaper set-up is the good old : http://willware.net/hw-rng.html
Uses the avalanche noise from a reverse biased PN junction.

The taps should represent a primitive polynomial in GF(2^n). The
algorithm is similar to the search of the prime numbers: you pick a
polynomial of a degree n and try to factor it by dividing by all of the
prime polynomials up to degree n/2. There are not too many of the
primitive polynomials, so this procedure is fairly fast.