## Help change 6-sided dice circuit to 20-sided

I'm looking for input as to how I could modify this:

http://www.electronicdesignworks.com...ronic_dice.htm

so that it does a 20-sided dice instead of a 6. Thanks.
 PhysOrg.com engineering news on PhysOrg.com >> Sensitive bomb detector to rove in search of danger>> PNNL-developed injection molding process recognized with emerging technologies award>> How soon could car seats enter the 3-D comfort zone?

Mentor
 Quote by mishima I'm looking for input as to how I could modify this: http://www.electronicdesignworks.com...ronic_dice.htm so that it does a 20-sided dice instead of a 6. Thanks.
Do you understand how the 4017 is being used as a random number generator?

Do you have experience programming microcontrollers? Using a PIC might be the easiest way to generate 20-bit random numbers...
 Well I guess 20 bits will not be necessary... The circuit consists of two parts an oscillator producing 0 and 1 (high and low voltage) really fast, and a Johnson counter that is running in circles by this oscillation, and it stops when you release the button. The Johnson counter would normally run from 0 to 9, but it is folded back onto itself so it resets to 0 when reaching 6. I hope you understand the circuit this far. The problem is, that going above 9 is not straight forward as the counter will restart at 0. The two ways to get to 20 easily that I see: 1) I think the counter is made for chaining. So you can connect a second counter to the carry output that counts tens. You would connect the third output of the counter for tens to both reset inputs and reset the counter once it reaches 20. The die would then count from 0 to 19. Another disadvantage of this setup is that the diode for tens turns on and off slower then the one for ones and depending on the oscillator speed it might be too slow and you might be able to manipulate the output by good timing. 2) the second way to do it are shift registers. They are very similar to Johnson counters, but they don't loop back. If you put one bit in at the first input it moves on every cycle and you can loop it back from the last chip to the first so it runs in a circle. The most tricky part is getting the first bit in. If you are lazy you can just say that the rolled number is the number of LEDs that are on. Put the input of the first shift register on high and let the 20th output reset the shift registers.