The universal flip-flop, wired to flip its output on every click. A ready-made memory circuit you can open in the TorchAnvil simulator.
The JK is the universal flip-flop. With the right choice of J and
K, it can impersonate any of the others — SR, D, or T. Here we've
tied both J and K to a HIGH constant (a single source fanned out to
both pins), which puts it in toggle mode: every rising clock edge,
Q flips to its opposite.
Press the button. Lamp on. Press again. Lamp off. Press again. Lamp on. That's it.
JK looks at three inputs on each rising clock edge: J (like "set"), K (like "reset"), and CLK. The combination decides what happens to Q:
| J | K | on rising edge |
|---|---|---|
| 0 | 0 | hold |
| 1 | 0 | set (Q=1) |
| 0 | 1 | reset (Q=0) |
| 1 | 1 | toggle |
With J=K=1 we're parked in the bottom row — pure toggle. Same
behaviour as a T flip-flop with T held high, which is exactly how the
two-bit counter chains its bits.
SR flip-flops have that awkward "both inputs high" state that's ambiguous. JK fixes it by defining that corner as "toggle," making the thing well-behaved under all four input combinations. That's why textbooks call JK the most general flip-flop: one component, any behaviour you need.