Dangerous Prototypes

Other projects => Past projects => Open 7400 Competition => Topic started by: NiHaoMike on October 12, 2012, 03:22:10 am

Title: [Entry] Random Number Generator
Post by: NiHaoMike on October 12, 2012, 03:22:10 am
Generating truly random numbers using a purely digital circuit is not possible - after all, digital logic is supposed to give the same results given the same input! This circuit cheats a little - a 4049 is used in an analog manner, amplifying and digitizing diode noise. Due to imperfections, the output will be "colored", that is, it will have slightly more 0s than 1s or vice versa, enough to cause it to fail being truly random. To solve that, the output is sent through a LFSR to debias it. It is then gated by a counter and two flip flops to frame the data for sending over a serial line. Two outputs of the prescaler counter are used to drive a charge pump in order to obtain enough voltage to get a diode-connected transistor to generate noise.
http://http://i50.tinypic.com/2jdkxoo.jpg
http://http://i47.tinypic.com/1j6hsk.png
Title: Re: [Entry] Random Number Generator
Post by: ian on October 12, 2012, 03:19:02 pm
Nice work, thanks for submitting!
Title: Re: [Entry] Random Number Generator
Post by: mwilson on October 23, 2012, 04:21:30 pm
A common way to remove bias is to read successive pairs of output bits until they differ, then take one -- either always the first or always the second.  It has the sad effect of cutting the data rate to slightly under one-quarter (depending on the degree of bias), but it provably removes the bias.
Title: Re: [Entry] Random Number Generator
Post by: t0mpr1c3 on October 23, 2012, 08:12:35 pm
That technique is known as the von Neumann extractor and relies on the absence of autocorrelation, which I would not think is guaranteed in this case.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01072060136session_write_close ( )...(null):0
20.01102191728ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01102192504Database_MySQL->query( ).../DatabaseHandler.php:119
40.05452331240Database_MySQL->error( ).../Db-mysql.class.php:273