Skip to content
BetterDL

JK flip-flop

Also called: JK, J-K flip-flop, JK flip flop, JKFF, J-K flip flop

An edge-triggered flip-flop with inputs J (set) and K (reset) that holds on 00, sets on 10, resets on 01 and toggles on 11.

A JK flip-flop is a clocked memory element with two control inputs. At each active clock edge it looks at J and K and decides what Q should become; between edges, Q holds.

  • J = 0, K = 0: hold. Q keeps its value.
  • J = 1, K = 0: set. Q becomes 1.
  • J = 0, K = 1: reset. Q becomes 0.
  • J = 1, K = 1: toggle. Q flips to its opposite.

Think of J as "jump to 1" and K as "kill to 0". The JK is an improved SR design: where an SR latch has a forbidden input (S = R = 1), the JK gives that combination a useful meaning, toggling. It manages this by ANDing J with and K with Q inside, so J can only set a flip-flop that is 0 and K can only reset one that is 1. With both at 1, exactly one of them acts, and Q flips.

That makes it a handy building block for counters, and with J and K tied together it behaves as a t flip flop. With K wired to it behaves as a d flip flop.

Its behavior fits in one characteristic equation: Q⁺ = . Read it as: "Q becomes 1 if J asks to set while Q is 0, or if K doesn't ask to reset while Q is 1."

0000
0011
0100
0110
1001
1011
1101
1110

Worked examples

Example

Tracing a JK flip-flop edge by edge

A positive-edge-triggered JK flip-flop starts with Q = 0. CLK rises in slots 2, 4, 6, 8 and 10, and J and K only change while CLK is low. At each rising edge, read J and K and apply the rule.

CLKJKQ
  1. 1.

    Slot 2 edge: J = 1, K = 0 → set. Q becomes 1.

  2. 2.

    Slot 4 edge: J = 0, K = 0 → hold. Q stays 1.

  3. 3.

    Slot 6 edge: J = 1, K = 1 → toggle. Q flips to 0.

  4. 4.

    Slot 8 edge: J = 1, K = 1 → toggle again. Q flips back to 1.

  5. 5.

    Slot 10 edge: J = 0, K = 1 → reset. Q becomes 0.

  6. 6.

    Between edges Q never changes, even when J and K do.

Example

Checking the equation against the table

Take Q = 1 with J = 1, K = 1. The rule says toggle, so Q⁺ should be 0.

The equation agrees: = 1·0 + 0·1 = 0. Now Q = 0 with J = 1, K = 0: 1·1 + 1·0 = 1, a set. ✓

Example

Shortcut for a long sequence

Q starts at 0. The (J, K) pairs at six edges are (1, 1), (0, 0), (0, 1), (1, 1), (1, 0), (1, 1). Name each row first, then apply it.

  1. 1.

    (1, 1) toggle: Q = 1.

  2. 2.

    (0, 0) hold: Q = 1.

  3. 3.

    (0, 1) reset: Q = 0.

  4. 4.

    (1, 1) toggle: Q = 1.

  5. 5.

    (1, 0) set: Q = 1 (already 1).

  6. 6.

    (1, 1) toggle: Q = 0.

  7. 7.

    Final Q = 0. Only the hold and toggle rows needed the current Q; set and reset don't care.

Common mistakes

  • Changing Q as soon as J or K changes. A JK flip-flop only acts at the active clock edge; between edges it holds.

  • Treating J = K = 1 as forbidden. That's the SR latch's rule. For a JK it means toggle.

  • Reading J alone. J = 1 means set only when K = 0; with K = 1 it means toggle.

  • Reading J and K after the edge. Use the values they have just before the edge, when they're stable.

Practice JK flip-flop

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

JK flip-flop is taught in Latches and Flip-Flops and Counters.