Mod-60 counter: the seconds of a digital clock, live
A mod-60 counter counts 00 to 59 and wraps back to 00, which is exactly what the seconds (or minutes) of a digital clock do. It is two counters in a row: a BCD units digit that counts 0 to 9, and a tens digit that counts 0 to 5 and steps only when the units digit is at 9.
Splitting the count into decimal digits makes the display easy, because each digit drives its own BCD to 7-segment decoder. The units digit is a decade counter: D0 = U0', D1 = (U1 XOR U0) U3', D2 = U2 XOR U1U0 and D3 = U2U1U0 + U3U0', which counts 0 to 9 and goes from 9 back to 0. The tens digit is a mod-6 counter whose next state is chosen only when E = U3 U0, the units digit's 9; otherwise each tens flip-flop keeps its value through a small multiplexer (E AND next, OR NOT E AND Q). Its increment wraps 5 to 0: T0+ = T0', T1+ = (T1 XOR T0) T2', T2+ = T2T0' + T1T0. All seven flip-flops share one clock, so both digits change on the same edge, and each D is ANDed with NOT CLR for a synchronous clear to 00. Give the clock one pulse per second and the outputs are a clock's seconds; chain another mod-60 counter for minutes and a mod-12 counter for hours.
Open this circuit in the lab →
What you need
- 7× D flip-flop: U3 to U0 (units) and T2 to T0 (tens), on one clock
- 1× NOT: U0' for D0
- 8× AND, OR, XOR, NOT: the rest of the units digit's 0 to 9 count logic
- 1× AND: E = U3 U0, the units digit is 9
- 8× AND, OR, XOR, NOT: the tens digit's 0 to 5 increment
- 10× AND, OR, NOT: hold-or-step selection by E (and NOT E) for the three tens bits
- 8× AND, NOT: synchronous clear: NOT CLR, and each D ANDed with it
Step by step
- Build the units digit as a BCD (decade) counter on four D flip-flops: it counts 0 to 9 and returns to 0.
- Detect the units digit's 9 with E = U3 AND U0.
- Build the tens digit's 0 to 5 increment on three flip-flops, and feed each flip-flop either its increment (when E = 1) or its own Q (when E = 0).
- AND every D input with NOT CLR, put all seven flip-flops on one clock, and probe T2 T1 T0 and U3 U2 U1 U0.
- Clear once and clock: 00, 01 ... 09, 10 ... 59, 00.
Mod-60 counter: key transitions
| Now (T U) | Next | What changes |
|---|---|---|
| 0 0 | 0 1 | units +1 |
| 0 9 | 1 0 | units wraps, E = 1 steps the tens |
| 1 9 | 2 0 | same |
| 5 8 | 5 9 | units +1 |
| 5 9 | 0 0 | both digits wrap |
Before the page is built, the live circuit runs 67 clocks (a clear, 00 to 59, the wrap to 00 and a few more), and all seven outputs are checked after every clock.
You can also read the full theory in the lesson on counters. Prefer to build it yourself from scratch? Open the digiwleea lab and place the gates on the canvas, or start from the logic gate simulator.
More builds: Registers and counters
All 246 build guides, by topic
Each of these is one step from a transistor to a working CPU. Build every gate from CMOS transistors and work all the way up in the free digiwleea lab, with the free theory reference alongside.
Open the Mod-60 counter in the lab →Frequently asked
How do you design a mod-60 counter?
Cascade a BCD units counter (0 to 9) and a mod-6 tens counter (0 to 5). The tens counter advances only when the units counter is at 9, and both wrap together after 59.
How many flip-flops does a mod-60 counter need?
Seven in this BCD form: four for the units digit and three for the tens. A pure binary mod-60 counter would need six (2^6 = 64), but its output would not be in decimal digits.
How is a mod-60 counter used in a digital clock?
Clocked once per second, it counts the seconds; its carry out at 59 steps a second mod-60 counter for the minutes, which steps an hours counter, and each BCD digit drives a 7-segment display.