JK Flip-Flop

A JK Flip-Flop is an advanced redstone memory circuit that upgrades the standard RS NOR latch by eliminating invalid input states. It uses two data inputs (J and K) along with a clock line (C) to set, reset, hold, or toggle its stored output state. You can use this circuit in complex redstone computers, binary counters, and synchronized automation systems.

Memory CircuitsAdvancedJava Edition
JK Flip-Flop video tutorial

Video: Minecraft Redstone Tutorial: RFB Ep.9 JK Flip-Flops by V3Slayer

How to build it

  1. Set Up the J, K, and Clock Inputs

    Place three input lines at the front of your build area: the J input (set), the K input (reset), and the C input (clock/control). Attach levers to the J and K inputs, and wire your clock or pulse trigger into the C line.

  2. Build the Input AND Gates

    Connect the J, K, and Clock inputs into a pair of redstone torch AND gates. These gates ensure that the J and K states are only passed forward into the memory section when the clock signal updates.

  3. Construct the Dual RS NOR Latches

    Behind the input gates, build two interconnected RS NOR latches using solid blocks, redstone torches, and redstone dust. One latch will control the main output state while the secondary latch helps manage the state switching.

  4. Wire the Repeater Feedback Loops

    For a more compact build (Design D), place redstone repeaters running from the input gates into the RS NOR latch blocks. Loop redstone dust from the output back toward the input gates so the circuit knows which side to toggle when both J and K are active.

  5. Add the Lower Pulse Torch

    If building the level-triggered variant (Design C), dig down one block beneath the main trigger block and place a redstone torch. When triggered, this torch sends a brief upward burst of power to flip the opposing latch.

  6. Connect the Main and Inverted Outputs

    Run a line of redstone dust out from the back of the primary latch to serve as your main output (Q), and a second line from the opposite side if you need an inverted output. Test the build by toggling the J and K levers while pulsing the clock.

How it works

A JK Flip-Flop operates by combining gated inputs with dual RS NOR latches, updating its output only when the Clock (C) signal triggers:

  • Hold State (J = 0, K = 0): When both J and K levers are off, clock pulses do nothing and the latch locks and maintains its previous output state.
  • Set State (J = 1, K = 0): Turning J on and K off forces the primary RS NOR latch into the ON (1) state on the next clock update.
  • Reset State (J = 0, K = 1): Turning J off and K on clears the memory, forcing the output into the OFF (0) state when the clock triggers.
  • Complement / Toggle State (J = 1, K = 1): When both J and K are powered, the feedback wiring causes the two internal latches to alternate and reset each other. Every clock trigger inverts the current output from on to off or vice versa.

Tips & variations

  • Avoid Race Conditions: In level-triggered designs (like Design C and the vertical Design E), holding the clock signal ON for too long while both J and K are active causes a race condition where the torches rapidly cycle and burn out. Use an edge trigger or short pulse on the clock line to prevent this.
  • Compact Repeater Variant (Design D): Using repeaters to lock and redirect signals into the RS NOR latch shrinks the footprint significantly compared to pure torch-logic gates.
  • Vertical Tileable Variant (Design E): If you are tight on horizontal space, build the vertical 1-wide variant in a zigzag pattern (alternating left-to-right and right-to-left) with a 1-block gap between each slice so adjacent dust lines do not cross.

Frequently asked questions

What is the difference between an RS NOR latch and a JK Flip-Flop?
An RS NOR latch enters an unstable or invalid state when both inputs are turned on at the same time. A JK Flip-Flop solves this by using a clock input and internal feedback so that powering both J and K simply toggles (inverts) the output.
Why does my JK Flip-Flop flicker or burn out when both levers are on?
You are likely using a level-triggered design with a clock pulse that is too long. When J and K are both active, a sustained clock signal causes a race condition where the circuit continuously toggles itself. Shorten the clock pulse using a pulse limiter or edge trigger.
Can I stack JK Flip-Flops next to each other?
Yes. The vertical design (Design E) can be placed side-by-side in a series if you leave a one-block space between each unit and alternate their build direction.

Components used

More jk flip-flop