D Flip-Flop

A D Flip-Flop (Data Flip-Flop) is a fundamental redstone memory circuit that stores a single bit of data—either on or off—and only updates its output when triggered by a clock or write pulse. It is the core building block used in advanced technical projects like Minecraft RAM, CPUs, and programmable combination locks. This tutorial covers the classic flat torch-and-dust gate design, which lays out all logic gates clearly for beginners.

Memory CircuitsBeginnerJava Edition
D Flip-Flop video tutorial

Video: Minecraft Logic Gates 10 - D-Flip-Flop [Tutorial] by Sw1Ftx16

How to build it

  1. Place the Input Blocks

    Start by placing three solid blocks in a row on the ground to form the front input section. Leave a one-block gap behind them and place another solid block.

  2. Build the Raised Bridge

    From that middle block, step one block up and extend a small L-shaped bridge of blocks: go two blocks out and one block across.

  3. Add the SR Latch Blocks

    At the back of the circuit, place two blocks diagonally from each other to form the core RS NOR (SR) memory latch, plus an extra block at the end to invert the output for viewing.

  4. Lay the Redstone Dust

    Run redstone dust along the ground paths connecting the input blocks to the back latch, and place dust on top of the first two raised bridge blocks (leaving the corner block without dust on top).

  5. Attach the Redstone Torches

    Place redstone torches on the sides of the input blocks to act as inverters, and place two torches facing each other between the diagonal blocks at the back to complete the SR latch.

  6. Add the Output Torch and Controls

    Place a final redstone torch on the last block to invert and display your output state. Attach a lever (Data input) and a button (Clock/Write input) to the front blocks.

How it works

This classic D Flip-Flop works by pairing two input inverters with an RS NOR Latch (also called an SR latch) at the back of the circuit:

  • Data Input (Lever): The lever sets the desired state (ON or OFF), but its signal is held back by the input torches until the button is pressed.
  • Write/Clock Input (Button): When the button is inactive, it powers the gating torches and keeps them locked off, preventing any changes from reaching the memory latch.
  • Updating the Memory: Pressing the button briefly unpowers the gating line. Depending on whether the lever is ON or OFF, one of the two side torches turns on and sends a pulse into either the Set or Reset side of the back SR latch.
  • Output: The SR latch holds that state indefinitely until the button is pressed again. The final torch at the back inverts the latch signal so you can easily read the saved output.

Tips & variations

  • More Compact Alternatives: Because this wiki-style design only uses redstone dust and torches, it has a large footprint. For survival builds or dense computer builds, you can create a tiny 1-wide D Flip-Flop using two Redstone Repeaters locking each other.
  • Block Types: Always use opaque, solid blocks (like stone, iron, or wool) so the blocks can properly power the attached redstone torches.
  • Cross-Edition Compatibility: Because this circuit relies purely on basic torch inversion and redstone dust without pistons or quasi-connectivity, the logic works reliably in both Java and Bedrock editions.

Frequently asked questions

What is the difference between a T Flip-Flop and a D Flip-Flop?
A T Flip-Flop toggles its output state every time it receives a pulse from a single input. A D Flip-Flop has two inputs (Data and Clock) and only saves the state of the Data lever when the Clock button is pressed.
Why doesn't the output change when I flick the lever?
That is the intended function of a D Flip-Flop. Flicking the lever only prepares the data; you must press the button to write that data into the memory latch.
Where are D Flip-Flops used in Minecraft?
They are primarily used to build Random Access Memory (RAM), registers in redstone computers, and multi-bit data storage systems.

Components used

More d flip-flop