Ron H said:
Jimbo, Bogdan, do your suggestions address the problem of implementing the variable number of sides he wants for his die? Seems to me that a 4017 Johnson counter, which already has all 10 states decoded, and a multiplexer to select which output is fed back, is pretty minimal. If he wants to have a 7 segment display, then maybe another approach should be investigated. I'll let you guys work that out. :lol:
Ah, now I understand your suggestion: you'd cascade 2 4017s, effectively 'driving' 20 outputs in a row, i.e.: counter state '01': first output/led lights up, counter state '02': second output/led lights up (first goes out), etc...
Then, all 20 outputs are connected to 20 inputs from a bunch of multiplexers (although, wouldn't that be DEmultiplexers?). The address lines of the demux'ers are then connected to a rotary switch with some sort of Diode matrix to set the addresses. The output of this demux bank is then connected to the reset lines of the 4017 counters. Works for me
.
Don't know any demux components, so I'd use bidirectional adressable CMOS switches such as the 4051 ( = "Analog mux/demux").
So it boils down to what sort of output he likes best. In this scenario, he'd get a single led lighting up, indicating the side on which the die stopped rolling (eg 16th led is burning -> he threw 16, as easy as that).
If he wants/likes 7segment displays, I'd go back to 'my' suggestion with double decade counters. Originally I was thinking about thinking up different "discrete" gatings for each number of sides he wants (selected or rather 'gated' through the rotary), with in the web-link an example being shown for a six-sided die ("AND" A1 & A2 address lines).
That might turn out a bit complex (and use heaps of components), but your (de)mux-idea can be recycled: the output address created by the 4010 BCD counters drives three 4051 switches (i.e. on the adress input lines), while the outputs of the rotary switch are connected to each channel of a 4051 in a row. The common connection point of the rotary is simply attached to ground. Therefore, if the counter address matches the rotary position, a 'low' (logic high) is connected through the corresponding 4051 to the reset input(s).
Done!
.