Display Numbers On 7-Segment Display Randomly

Potato Pudding

Joined Jun 11, 2010
Just use two clocks or a clock and a debounced switch, one of fairly low frequency and another of very high frequency with a decade counter connected. Try to avoid having the two clocks in harmonics so that you don't get aliasing, or use a button press to select a number is even better. On the edge of the slow counter or of the debounced switch pulse you stop the count on the high frequency counter. A counter running at over 1 MHz stopped by a button press will be close enough to a random number for values upto around 52 for example. That would allow you to simulate a card draw for a black jack game. It is even better if you use a fairly unstable clock. Crystal Oscillator would be the wrong idea. A Precision component RC oscillator would also be the wrong idea. 20% tolerance should work. If you want to make it slightly more random then have two unharmonic oscillators feeding into an OR gate and feed that to your high frequency counter, but the best simplest method to increase the randomness is just have the high frequency side run as fast as you can. 15MHz should be easily managed.