When designing a digital one-minute counting circuit I came across a difficult problem. 

Basically, I designed the circuit to drive the (normally HIGH) clock of the 10s slot low if the 1s slot's current state was 9 (actually, just if the first and last bits are HIGH -> 1001)

The devices I am using are positive edge, so when the 1s slot returns to zero the condition is no longer satisfied - therefore the clock returns to a HIGH state and increments the 10s slot.

The problem is that I was getting double clock problems(7->8 transition and the designed clock mechanism).   

It turns out that there was just enough delay in the switching between 7 -> 8 (0111 -> 1000) that the first/last bit HIGH condition is satisfied:

i.e., some combination occurs in the transition period to register a logical HIGH at the output

1001 1011 1101 1111

The temporary solution to the problem I came up with was to actually keep the clock for the 10s slot LOW until the condition where the 1s slot equals 0 (0000) is satisfied(So, essentially clock WHEN we get to the state as opposed to before). However, this solution requires too many gates (a 4-input NOR minimum). My previous design was actually fed from another part in the design that is already present, so it didn't require any additional circuitry. 

Any ideas on a more efficient solution?  




The IC's used in this design are the 74LS47 (7Segment decoder) and the 74LS163 (4-bit binary counter). The pull-down resistor inclusion is a mechanism to set the counters to 00 and hold while the switch is closed. 


Question: How to easily determine the results distribution for multiple dice?
Answer: There's a very neat way of computing the combinations or probabilities in a spreadsheet (such as excel) that computes the convolutions directly. 

I'll do it in terms of probabilities and illustrate it for six sided dice but you can do it for dice with any number of sides (including adding different ones).

(btw it's also easy in something like R or matlab that will do convolutions)

Start with a clean sheet, in a few columns, and move down a bunch of rows from the top (more than 6).


put the value 1 in a cell. That's the probabilities associated with 0 dice. put a 0 to its left; that's the value column - continue down from there with 1,2,3 down as far as you need.
move one column to the right and down a row from the '1'. enter the formula "=sum(" then left-arrow up-arrow (to highlight the cell with 1 in it), hit ":" (to start entering a range) and then up-arrow 5 times, followed by ")/6" and press Enter - so you end up with a formula like =sum(c4:c9)/6  (where here C9 is the cell with the 1 in it).



Then copy the formula and paste it to the 5 cells below it. They should each contain 0.16667 (ish).



Don't type anything into the empty cells these formulas refer to!
move down 1 and to the right 1 from the top of that column of values and paste ...



... a total of another 11 values. These will be the probabilities for two dice. 



It doesn't matter if you paste a few too many, you'll just get zeroes.
repeat step 3 for the next column for three dice, and again for four, five, etc dice.



We see here that the probability of rolling $12$ on 4d6 is 0.096451  (if you multiply by $4^6$ you'll be able to write it as an exact fraction).


If you're adept with Excel - things like copying a formula from a cell and pasting into many cells in a column, you can generate all tables up to say 10d6 in about a minute or so (possibly faster if you've done it a few times).



If you want combination counts instead of probabilities, don't divide by 6.

If you want dice with different numbers of faces, you can sum $k$ (rather than 6) cells and then divide by $k$. You can mix dice across columns (e.g. do a column for d6 and one for d8 to get the probability function for d6+d8):