How do I get random #s?

Jim Adcock jima at hplsla.HP.COM
Fri Feb 10 05:13:45 AEST 1989


> I finally got tired of non-random random numbers, so
> I hooked an ADC converter and a hot resistor to my computer and xor'ed the 
> results from it with rand(). This gives me about 10000 really random numbers
> a second. It is not trivial to get REALLLY random numbers out of such
> a setup, but it can be done.

My concern would be with using the [multi-bit?] ADC.  We use a similar 
technique to generate noise sources for our FFT analysers, only using 
well known tapped shift registers, bitwise results xor'ed with a 
one-bit result from a one bit-ADC and a noise diode.  We then 
collect say 16-bits from the shift register to make a 16-bit word.
While neither the shift register nor the diode make all that great 
"random noise", the result of the xor is the convolution of their two 
spectrums, so the result is generally pretty good.  You still need to 
keep the shift register and the noise diode isolated though.



More information about the Comp.lang.c mailing list