Mod-3 counter: count 0, 1, 2 with two flip-flops, live
A mod-3 counter counts 0, 1, 2 and back to 0, three states, using two flip-flops. Designed from its state table with the unused state 11 as a don't-care, the next-state logic is just D1 = Q0 and D0 = NOR(Q1, Q0).
Two flip-flops have four states, and a mod-3 counter uses three of them: 00, 01, 10. The state table gives each D input: Q1 must become 1 only after state 01, so D1 = Q0; Q0 must become 1 only after state 00, so D0 = NOR(Q1, Q0). Treating 11 as a don't-care keeps that logic tiny, and the design is still self-starting: if the flip-flops power up as 11, the next clock goes to 10 and the count carries on. A synchronous CLR (each D ANDed with NOT CLR) resets it to 00, and the live circuit opens with CLR on because flip-flops start in an unknown state. Divide-by-3 counters turn up in clock dividers and in sequencing with three phases; the same method designs the mod-5 and mod-6 counters and the decade counter. With all four states in use, the same two flip-flops make the mod-4 counter.
Open this circuit in the lab →
What you need
- 2× D flip-flop: Q1 and Q0, on one clock
- 1× NOR: D0 = NOR(Q1, Q0)
- 2× AND: synchronous clear: each D ANDed with NOT CLR
- 1× NOT: NOT CLR
Step by step
- Place a clock
CLK, an inputCLR, two D flip-flops and probesQ1andQ0. - Write the state table: 00 to 01, 01 to 10, 10 to 00, with 11 as a don't-care.
- Read off the logic: D1 = Q0 and D0 = NOR(Q1, Q0). AND each with NOT CLR for a synchronous clear.
- Turn CLR off and watch Q1 Q0 count 00, 01, 10, 00, ...
Mod-3 counter state table
| Present Q1 Q0 | Next Q1 Q0 | D1 = Q0 | D0 = NOR(Q1, Q0) |
|---|---|---|---|
| 00 | 01 | 0 | 1 |
| 01 | 10 | 1 | 0 |
| 10 | 00 | 0 | 0 |
| 11 (unused) | 10 | 1 | 0 |
The unused state 11 leads to 10, so the counter recovers on its own. Before the page is built, a 13-clock run (a clear, the count four times round with a clear in the middle) is checked on Q1 and Q0 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-3 counter in the lab →Frequently asked
How many flip-flops are needed for a mod 3 counter?
Two. A mod-N counter needs the smallest number of flip-flops n with 2^n at least N, and 2^2 = 4 is at least 3.
How do you design a mod 3 counter?
Write the state table for 00, 01, 10 back to 00, mark the unused state 11 as a don't-care, and derive each flip-flop's D input: D1 = Q0 and D0 = NOR(Q1, Q0).
Is the mod 3 counter self-starting?
Yes. If it powers up in the unused state 11, the logic sends it to 10 on the next clock, and from there it follows the normal count.
What is a mod 3 counter used for?
Dividing a clock frequency by 3, and sequencing anything that repeats in three steps.