Master-slave JK flip-flop
A JK flip-flop is a clocked memory element that can hold, set, reset or toggle its output.
Open this circuit in LogicLab →
Boolean expressions
- J=0,K=0 hold · J=1,K=0 set · J=0,K=1 reset · J=K=1 toggle
How it works
With J=1 and K=0 it sets, with J=0 and K=1 it resets, with both 0 it holds, and with both 1 it toggles on every clock pulse. A single level-triggered latch would toggle repeatedly while the clock is high (race-around); the master-slave arrangement captures the inputs while the clock is high and updates the output only after it falls.
Try it yourself
J=K=1 toggles Q once per clock pulse. The master-slave structure removes the race-around problem. Open the circuit, click the switches to change the inputs, and watch the LEDs and the waveform panel respond. You can edit the circuit, convert it to NAND-only or NOR-only gates, and save or export your version.
Related circuits
Reference: en.wikipedia.org/wiki/Flip-flop_(electronics)#JK_flip-flop