Digital Electronics

Synchronous Counter JK Flip Flop

By CourseTron Team ·  4 min read ·  Updated Oct 2026 💬 𝕏 in f
Table of Contents
    ? Print / Save as PDF

    In short: To build a synchronous counter with JK flip-flops you fix the modulus, write the state transition table, derive each flip-flop's J and K excitation from the JK excitation table, minimise those expressions with K-maps, and wire every clock input to one common edge so all stages update together.

    A synchronous counter is the workhorse of digital timing: every flip-flop sees the same clock edge, so outputs change in lock-step and the ripple delay that plagues asynchronous counters disappears. JK flip-flops are the classic building block for these because their J=K=1 toggle mode makes count progression almost mechanical. This walkthrough designs a 3-bit (mod-8) synchronous up counter end to end, then shows how the same procedure scales to arbitrary or non-binary sequences — the exact skill interviewers probe when they ask you to "design a mod-5 counter at the whiteboard."

    Why synchronous, and why JK?

    In a ripple (asynchronous) counter each stage clocks the next, so for an n-bit counter the worst-case settling time is roughly n × tpd. With a 74-series flip-flop at ~15 ns propagation, a 4-bit ripple counter can glitch for 60 ns before it is valid — unusable above a few MHz and a decoding hazard. A synchronous counter drives one clock to all stages, so total delay is a single tpd plus combinational excitation logic, and it holds at hundreds of MHz in modern CMOS. The cost is the extra steering logic we design below.

    The JK flip-flop earns its place because it has no forbidden input (unlike SR) and a built-in toggle. Its four modes — hold (00), reset (01), set (10), toggle (11) — give the synthesis algorithm maximum freedom, which usually means fewer gates after minimisation.

    ⭐ Key fact: For a binary up counter, bit Q0 toggles on every clock, so its flip-flop is simply tied to J0=K0=1. Every higher bit toggles only when all lower bits are 1 — the entire carry chain.

    Step 1 — State table for a mod-8 up counter

    List present state and the next state in the count sequence 0→1→...→7→0:

    Q2Q1Q0Q2+Q1+Q0+
    000001
    001010
    010011
    011100
    100101
    101110
    110111
    111000

    Step 2 — The JK excitation table

    Excitation logic answers the question: given a required transition of Q, what J and K force it? The JK excitation table is the inverse of its characteristic equation Q+ = J·Q' + K'·Q, and its power is the don't-cares:

    Q → Q+JK
    0 → 00X
    0 → 11X
    1 → 0X1
    1 → 1X0

    Those X (don't-care) entries are the reason JK counters minimise so cleanly: half of every excitation K-map is already free to be whatever the algebra prefers.

    Three JK stages, one shared clock J0K0Q0FF0J1K1Q1FF1J2K2Q2FF2common CLK edgeEvery stage sees the same edge, so all outputs change together. CourseTron · coursetron.com
    All three JK stages share one clock line — the defining feature of a synchronous counter.

    Step 3 — Derive and minimise the excitation

    Applying the excitation table row-by-row to the state table and reducing with Karnaugh maps gives the carry-chain result every digital engineer memorises:

    • J0 = K0 = 1  (LSB toggles every clock)
    • J1 = K1 = Q0  (toggle when Q0 = 1)
    • J2 = K2 = Q1·Q0  (toggle when both lower bits are 1)

    Notice the pattern: each stage's J and K are identical and equal to the AND of all lower-order outputs. That regularity is why counters are laid out as cascaded toggle cells, and why a related T flip-flop — which is literally a JK with J tied to K — is often substituted to halve the wiring. For a mod-16 counter you simply add J3 = K3 = Q2·Q1·Q0.

    Carry-chain excitation for the mod-8 counter J0K0Q0FF0J1K1Q1FF1J2K2Q2FF2J0 = K0 = 1J1 = K1 = Q0J2 = K2 = Q1·Q0Each stage toggles only when every lower bit is 1. CourseTron · coursetron.com
    Excitation equations: each stage toggles when all lower-order outputs are 1.

    Step 4 — Animate the count

    3-bit counter, bits toggling Q2toggles every 4 clocksQ1toggles every 2 clocksQ0toggles every clockclock edgesBinary weighting: 1, 2 and 4 clock periods per toggle. CourseTron · coursetron.com
    Q0 toggles every edge, Q1 every two, Q2 every four — binary weighting in motion.

    ⭐ Key fact: In Cadence Virtuoso or a Synopsys VCS testbench you never hand-build this gate list — you write always @(posedge clk) count <= count + 1; and the synthesis tool (Synopsys Design Compiler, Siemens/Mentor) infers exactly this JK/toggle structure. Knowing the manual derivation is what lets you debug when it does not.

    Step 5 — Non-binary and down counters

    For a mod-5 (0–4) counter the same five steps apply, but states 5, 6, 7 become don't-cares in the K-maps — exploit them for simpler logic, and add a decode so an illegal state self-corrects to 0 on power-up. For a down counter, invert the toggle condition: a stage toggles when all lower bits are 0, i.e. J2 = K2 = Q1'·Q0'. Verification teams at firms like Avecas routinely gate-level simulate these corner states before sign-off, because an unreachable state that never resets is a classic silent bug.

    Common pitfalls

    • Mixing clock edges — a single stage left on the inverted edge turns a synchronous counter back into a ripple one.
    • Ignoring setup/hold — excitation logic adds combinational delay; it must settle within one clock period minus tsu.
    • Unused states — in mod-N where N is not a power of 2, always prove the lock-out states drain to a legal state.
    • Treating X as 0 — forgetting that excitation don't-cares are free gates away your best minimisation. Pair this with our setup and hold time guide before taping out.

    Want to design, simulate and synthesise counters, FSMs and datapaths on real EDA tools? The CourseTron Digital Design & RTL track takes you from flip-flop fundamentals to synthesizable Verilog on industry flows.

    Frequently asked questions

    Why use JK flip-flops instead of D flip-flops for a counter?

    Both work. JK gives explicit toggle/hold modes and don't-care-rich excitation maps, so the hand-derived logic is often smaller. D flip-flops are simpler to reason about (next state = D) and are what RTL synthesis targets, so modern silicon usually ends up D-based regardless.

    How is a synchronous counter faster than a ripple counter?

    All stages clock on the same edge, so the counter is valid after one flip-flop propagation delay plus the excitation gate delay — not n stacked delays. This removes decoding glitches and allows far higher clock frequencies.

    What is the excitation table used for?

    It maps a required output transition (Q → Q+) to the flip-flop inputs that cause it. For sequential synthesis you look up each transition in it to build the J and K expressions, then minimise.

    How do I make it a mod-N counter where N is not a power of two?

    Design for the nearest power of two, mark the unused states as don't-cares, minimise, and add logic (or an asynchronous/synchronous clear) that forces the counter back to 0 after it reaches N−1.

    Advertisement