Redstonery › Circuits › Edge-triggered D flip-flop
Memory circuit
Edge-triggered D flip-flop
Sample data on a selected clock event.
11 × 6 footprint1 layer28 blocksTested in 4 rotationsJava Edition 26.2
Layout
redstone dustredstone torchrepeater or comparatorinputlampsolid blockarrows point where a device sends its output; north is up
How it works
A master and slave repeater latch alternate their lock phases. Data is captured when Clock turns on; changing Data while Clock stays on leaves Q unchanged. Keep Data stable for at least 12 game ticks before Clock, and leave 20 game ticks between clock changes.
- A master and slave repeater latch alternate their lock phases, capturing data when Clock turns on.
- The stored output then remains stable while data changes with Clock still on. Hold Data steady for at least 12 game ticks before Clock and leave 20 between clock changes.
Inputs and outputs
- InputData (x 0, y 0, z 0)
- InputClock (x 0, y 0, z 5)
- OutputQ (x 9, y 0, z 0)
Blocks you need
19 × redstone dust, 4 × repeater, 2 × lever, 1 × redstone lamp, 1 × stone, 1 × redstone torch (on a wall).
Build it in the game: 28 commands
Relative to where you stand, with x running east and z running south. Paste one line at a time into chat, or into a chain of command blocks. The block art is the game's own; the layout is what the page above shows.
setblock ~0 ~0 ~0 minecraft:lever[face=floor,facing=north,powered=false] setblock ~1 ~0 ~0 minecraft:redstone_wire setblock ~2 ~0 ~0 minecraft:redstone_wire setblock ~3 ~0 ~0 minecraft:redstone_wire setblock ~4 ~0 ~0 minecraft:repeater[facing=west,delay=2] setblock ~5 ~0 ~0 minecraft:redstone_wire setblock ~6 ~0 ~0 minecraft:redstone_wire setblock ~7 ~0 ~0 minecraft:redstone_wire setblock ~8 ~0 ~0 minecraft:repeater[facing=west,delay=1] setblock ~9 ~0 ~0 minecraft:redstone_wire setblock ~10 ~0 ~0 minecraft:redstone_lamp setblock ~0 ~0 ~5 minecraft:lever[face=floor,facing=north,powered=false] setblock ~1 ~0 ~5 minecraft:redstone_wire setblock ~2 ~0 ~5 minecraft:redstone_wire setblock ~3 ~0 ~5 minecraft:redstone_wire setblock ~4 ~0 ~5 minecraft:redstone_wire setblock ~5 ~0 ~5 minecraft:redstone_wire setblock ~6 ~0 ~5 minecraft:redstone_wire setblock ~7 ~0 ~5 minecraft:redstone_wire setblock ~8 ~0 ~5 minecraft:redstone_wire setblock ~4 ~0 ~4 minecraft:redstone_wire setblock ~4 ~0 ~3 minecraft:redstone_wire setblock ~4 ~0 ~2 minecraft:redstone_wire setblock ~4 ~0 ~1 minecraft:repeater[facing=south,delay=1] setblock ~8 ~0 ~4 minecraft:redstone_wire setblock ~8 ~0 ~3 minecraft:stone setblock ~8 ~0 ~2 minecraft:redstone_wall_torch[facing=north] setblock ~8 ~0 ~1 minecraft:repeater[facing=south,delay=1]