Press one button to remember a 1, another to forget it. A ready-made memory circuit you can open in the TorchAnvil simulator.
Every circuit you've seen so far is combinational — its output is a pure function of its inputs. Flip the lever, the lamp responds; let go, it goes back. There's no memory.
This one is different. Tap Set once: the lamp lights and stays lit — even after you release the button. Tap Reset: the lamp goes dark and stays dark. The circuit remembers which button you pressed last.
The SR flip-flop has two inputs (S for "set", R for "reset") and one state bit Q that survives between clicks:
1 (lamp on).0 (lamp off).| S | R | Q (next) |
|---|---|---|
| 0 | 0 | Q (hold) |
| 1 | 0 | 1 (set) |
| 0 | 1 | 0 (reset) |
| 1 | 1 | unstable |
This tiny block is how computers store a single bit. Wire eight of them up side by side and you've got a byte of memory. Add an address decoder and a clock, and you're most of the way to RAM.
1.