← All docs

Circuits

Memory: latches and flip-flops

Circuits that remember — holding a value long after the input that set it has gone.

Plain logic forgets instantly: remove the input and the output drops. Memory circuits hold their state until something tells them to change. They're the basis of counters, storage, and anything that has to remember what happened a moment ago.

The RS latch

The fundamental memory cell is the RS latch (“reset–set”). It has two inputs: Set turns the output on, and Reset turns it off. The important part is what happens next — when both inputs return to off, the latch *keeps* whatever it was last told. It remembers a single bit.

The usual build is two NOR gates cross-coupled: each gate's output feeds back into the other gate's input. That feedback loop is exactly what stores the bit — the circuit holds itself in place.

Set turns it on and it stays on; Reset turns it off and it stays off.View & run →

Flip-flops

A T flip-flop (“toggle”) takes the idea further: one input, and every pulse flips the output to its opposite. Press once for on, again for off. It's how a single button behaves like a switch — the logic behind turning a momentary button into a sticky on/off control.

Keep reading