Skip to content
digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksBuild a CPUToolsOpen the lab →

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.

Big circuit: pinch, scroll or tap + to zoom in, then drag to move around.

Live circuit: click the inputs to toggle them and watch the outputs update. It runs the real simulator, right here on the page.

Open this circuit in the lab →

Embed or cite this circuit

Free to embed on a course page, blog or worksheet: paste this code. The circuit stays live, and the small digiwleea badge links back here.

To cite it: digiwleea, “Mod-60 counter”, https://digiwleea.wleeaf.dev/tools/build/mod-60-counter/

What you need

Step by step

  1. Build the units digit as a BCD (decade) counter on four D flip-flops: it counts 0 to 9 and returns to 0.
  2. Detect the units digit's 9 with E = U3 AND U0.
  3. 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).
  4. 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.
  5. Clear once and clock: 00, 01 ... 09, 10 ... 59, 00.

Mod-60 counter: key transitions

Now (T U)NextWhat changes
0 00 1units +1
0 91 0units wraps, E = 1 steps the tens
1 92 0same
5 85 9units +1
5 90 0both 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.