random number generator

Thread Starter

random3

Joined Dec 25, 2010
2
dear friends,
i need to make a random number genarator in digital logic design, Can any body tll me how to do it and what are the components to be used. By the way i want to use BCD counters and sevensegment display. i need detail plz.
thanks in advance
 

Kermit2

Joined Feb 5, 2010
4,162


With the right choice of sample clock rate and maybe some tweaking with the timing difference of the two IC's it would be very random.
 

jpanhalt

Joined Jan 18, 2008
11,087
With the right choice of sample clock rate and maybe some tweaking with the timing difference of the two IC's it would be very random.
Perhaps appear random. But if you can affect the number by changing the clock rate, is that not inconsistent with the definition of a random number?

I suggest collecting 1000 samples or more and submitting that output to statistical analysis.

John
 

Wendy

Joined Mar 24, 2008
23,408
True random is harder than it sounds. I'll be following this thread with interest.

In theory it is possible to use Zener diode noise or a radio active source and use it to generate a random number.
 

jpanhalt

Joined Jan 18, 2008
11,087
Here's an interesting discussion of some of the problems, including hypothetical problems with using nuclear events. That is, does radioactive decay only appear to be random, because we don't understand it enough? Sounds like some of the religious arguments. Ah, let's don't go there.

http://www.random.org/randomness/

John
 

Adjuster

Joined Dec 26, 2010
2,148
dear friends,
i need to make a random number genarator in digital logic design, Can any body tll me how to do it and what are the components to be used. By the way i want to use BCD counters and sevensegment display. i need detail plz.
thanks in advance
This looks like a homework assignment.
 

Kermit2

Joined Feb 5, 2010
4,162
A TV receiver on a blank station (analog TV-remember those?)

will give you an RF noise background with random peaks and valleys in the signal. Are they truly random? Who knows.

You will of course settle for some form of pseudo-random technique.

Random - REAL random is hard to prove in a hardware device. (meaning it costs lots of $ to get something like true random.)
 

Wendy

Joined Mar 24, 2008
23,408
Proving it isn't that hard. It is a job for a computer though, thousands and thousands of samples, all recorded, compiled, graphed.
 

wayneh

Joined Sep 9, 2010
17,495
Proving it isn't that hard.
True, it's not hard, it's merely impossible. I get your point that "practical" randomness could be proven easily to whatever degree of precision one specifies. You'd look for a proper mean and standard deviation, normal distribution and so on. Standard statistical test might reveal a patter of some kind lurking in the data.

But we can never "prove" the lack of a pattern we don't specifically look for. A book containing the first few billion digits of pi ∏ would appear to be a random string of digits if you didn't know what ∏ is.
 

jpanhalt

Joined Jan 18, 2008
11,087
Random vs. chaotic? I agree on the philosophical "proof" part. The link I provided gave and example where the difference is demonstrable in a practical application.

John
 

djsfantasi

Joined Apr 11, 2010
9,155
How many digits are you looking for and what is the purpose of the display? For a non-critical game application, I've used a cheap pushbutton switch directly wired to the input of a decade counter and let the switch bounce generate 'random' numbers... Worked good enough for me.
 

JDT

Joined Feb 12, 2009
657
White noise is theoretically truly random.

For your application, why not use the fact that the time between button presses will probably be random. So have an oscillator that drives a counter and a display. The counter rotates round 1 to 6 (or whatever) continuously at rate far to fast to see. When the button is pressed, the counter is stopped at a random position.

Good enough?
 

tom66

Joined May 9, 2009
2,595
Here is one possible circuit, built in 15 minutes.

It works by utilising small temperature drifts in components. In simulation, the results will be predictable, but in practice, it will appear random enough.

Press the button more frequently to get the "die" to roll for longer (this could be a useful function.) Also, a "stop" button can be added, to stop the die from spinning. You may want to omit this. The capacitor across the switch ensures the die starts in a random position when it is switched on.

The circuit on the ctl pin is optional but increases randomness as it modulates the frequency of the clock signal and makes it more unpredictable. The diode in the discharge path is also optional, but it too adds thermal noise and variation to the delay.

Click here.
 

tom66

Joined May 9, 2009
2,595
That looks like quite a neat random number generator.

For one way to implement a PRNG in pure logic, try a LFSR, which can be done with two or three 74xx series ICs.
 

#12

Joined Nov 30, 2010
18,224
It's always interesting to watch the brightest minds debate the qualities of the most exquisite random number generators that have ever been conceived, for a kid who can't spell "please".
 
Top