Teach Your Kid Electronics

Advanced · Project 2

Flip-Flop Memory

Build a one-bit memory, the same idea as the billions of memory cells in a computer. Press SAVE and the LED remembers what the DATA button said, even after you let go.

Build this only with an adult present. Before you start, read our safety notice and disclaimer.

Advanced⏱ About 35 min

🧰 What you need

  • 1×Half-size breadboardA board full of little holes with metal clips inside, so you can build circuits without soldering.
  • 1×3×AA battery holder with wire leadsHolds three AA batteries in a row and gives you a red (+) and black (−) wire.
  • 3×AA batteryA regular household battery. Each one gives 1.5 volts.
  • 1×74HC74 flip-flop chipTwo D flip-flops: tiny memories that each store one bit (on or off).
  • 2×Push button (tactile switch)A little button with 4 legs. It connects its two sides only while you press it.
  • 2×10 kΩ resistor — brown, black, orange, goldColors: brown, black, orange, gold.
  • 1×220 Ω resistor — red, red, brown, goldOur go-to LED resistor. Colors: red, red, brown, gold.
  • 1×5 mm LED (any color) — any color worksA tiny light that only lets current flow one way. The long leg is +.
  • 15×Jumper wireA short wire with stiff ends that push into the breadboard.

✨ The finished project

A one-bit memory: a 74HC74 flip-flop with a DATA button and a SAVE button; the LED shows what it remembers ++−−++−−aabbccddeeffgghhiijj115510101515202025253030 74HC74 10 kΩ 10 kΩ 220 Ω +− AAAAAA3 × AA = 4.5 V+−
A one-bit memory: a 74HC74 flip-flop with a DATA button and a SAVE button; the LED shows what it remembers ++−−++−−aabbccddeeffgghhiijj115510101515202025253030 74HC74 10 kΩ 10 kΩ 220 Ω +− AAAAAA3 × AA = 4.5 V+−
Schematic: A one-bit memory: a 74HC74 flip-flop with a DATA button and a SAVE button; the LED shows what it remembers 1D21CLK31PRE41CLR12D122CLK112PRE102CLR131Q51Q̄62Q92Q̄8VCC14GND774HC74U1 +4.5V +4.5V +4.5V +4.5V 4.5 V button 10 kΩ button 10 kΩ 220 Ω yellow LED
The finished build. This picture is generated from the circuit itself and checked by computer, so every leg is in the right hole.

The logic gates in the last project forget instantly: let go of the buttons and the answer changes. A computer needs to remember things. The simplest memory is a flip-flop: it stores one bit, a single 1 or 0.

Chip pins work with two levels: high means connected to + (ON, 1) and low means connected to − (OFF, 0).

The 74HC74 has two “D flip-flops” inside. Each one has:

  • a D (data) input: what you want to remember;
  • a CLK (clock) input: the moment it goes from OFF to ON, the flip-flop copies D into its memory;
  • a Q output: what it’s remembering right now.

Between clock pulses (each quick OFF → ON → OFF), D can do whatever it likes. Q doesn’t change. That’s memory!

74HC7411CLR21D31CLK41PRE51Q61Q̄7GND82Q̄92Q102PRE112CLK122D132CLR14VCC
  • Pin 1 · 1CLR — "clear": pulling it LOW forces the memory to 0. We hold it high.
  • Pin 2 · 1D — data in (DATA button)
  • Pin 3 · 1CLK — clock (SAVE button)
  • Pin 4 · 1PRE — "preset": pulling it LOW forces the memory to 1. We hold it high.
  • Pin 5 · 1Q — the remembered bit (LED)
  • Pin 6 · 1Q̄ — the opposite of Q (not used)
  • Pin 7 · GND — connect to battery −
  • Pin 14 · VCC — connect to battery +

Build it

  1. Rail bridges: red T+25 → B+25 (bottom red + rail, column 25), black T-26 → B-26 (bottom blue − rail, column 26).

  2. The chip: 74HC74 across the gap, notch on the left, pin 1 in f12.

  3. Power: red a12 (VCC) → T+11 (top red + rail, column 11); black j18 (GND) → B-17 (bottom blue − rail, column 17).

  4. Hold CLR and PRE high: red j12 → B+11 (bottom red + rail, column 11) and red j15 → B+15 (bottom red + rail, column 15).

  5. Switch off the second flip-flop: black wires from a13, a14, a15 and a16 to the top − rail (T-13, T-14, T-15, T-16).

  6. DATA button: legs in e3, f3, e5, f5. Red j3 → B+3 (bottom red + rail, column 3). 10 kΩ pull-down a5 → T-5 (top blue − rail, column 5). Yellow h5 → h13 (D).

  7. SAVE button: legs in e7, f7, e9, f9. Red j7 → B+7 (bottom red + rail, column 7). 10 kΩ pull-down a9 → T-9 (top blue − rail, column 9). Green g9 → g14 (CLK).

  8. LED: 220 Ω resistor i16 (Q) → i21; long leg g21, short leg g22; black j22 → B-22 (bottom blue − rail, column 22).

  9. Power: 3×AA red into T+1, black into T-2. The LED might be on or off. A flip-flop wakes up remembering a random bit!

Play with your memory

  1. Hold DATA, then tap SAVE. The LED turns on.
  2. Let go of everything. It stays on. It remembers!
  3. Press DATA on its own. Nothing changes: without a SAVE, it ignores DATA.
  4. Tap SAVE without DATA. It saves a 0: the LED goes off, and stays off.

The build check ran exactly this story on the simulated chip, starting from both possible random wake-up states.

How it works

Inside the chip, a few gates loop back into each other so the output keeps feeding itself: once ON it holds itself ON, once OFF it holds itself OFF. The clock input opens a tiny “door” for an instant to let a new value in. Computer memory (RAM, the memory a computer uses while it’s working) is billions of these, and the clock in a computer ticks billions of times a second.

Not working?

  • LED changes when you press DATA alone? Check the green wire goes to CLK (g14) and the yellow one to D (h13).
  • LED stuck on or off? Check the two red CLR and PRE wires: if either is low, it forces the memory.
  • Acts randomly? A floating input. Check the pull-downs and the four black wires on the top row.

Try it!