LogicLab

Master-slave D flip-flop

A master-slave D flip-flop is an edge-triggered memory element built from two gated D latches.

Circuit diagram of the Master-slave D flip-flop

Open this circuit in LogicLab →

Boolean expressions

How it works

The master latch is transparent while the clock is low and the slave latch is transparent while the clock is high. At the rising edge the master freezes and the slave copies it, so Q changes once per clock cycle and later changes on D are ignored until the next edge.

Try it yourself

Two gated D latches with opposite enables copy D to Q on the rising clock edge only. 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)#Master%E2%80%93slave_edge-triggered_D_flip-flop