Lab 7 of 10 · rank 06

Hold a bit

A D-latch: when E is high, Q follows D. When E is low, Q holds. Use one tick per vector.

← All labsNext lab →

Learn first

A latch remembers a bit. Without memory, a circuit has no past.

All the gates so far forget everything the moment their inputs change. A latch is different: while the enable pin E is on, its output Q copies D; when E turns off, Q stays exactly where it was — even if D changes.

That is one bit of memory. A million of them make RAM. In Wafer, LATCH is the second and last primitive, and it's what makes a die able to count, store, and eventually run a program.

Try this

Place a LATCH cell with D and E as inputs and Q as the output. Set D=1 and E=1: Q becomes 1. Turn E off, then change D: Q should not move. That's memory.

LATCHone bit of memoryD (data)E (enable)QE on: Q follows D · E off: Q keeps the last value
  1. 1
    Build itPorts named D, E and Q
  2. 2
    Pass the truth table5 rows checked
  3. 3
    Claim the grant+8 NAND
  4. 4
    Etch it (optional)a verified die in your project
Cellsclick one, then click the canvas

Build your die

Turn logic into a permanent, verifiable part.

NAND used0 / par 0
LATCH used0 / par 1
Ainput · pin0Youtput · pin
Pick a cell on the left, click to place it · drag from an output pin to an input pin to wire · click a cell to rename it
Y=0

What it should do

D EQ
0 10
1 11
0 01
1 01
0 10

Stuck?

Drop a LATCH cell. Wire D and E, read Q.

Par is 0 NAND and 1 LATCH. Using more still passes; fewer is just neater.

Your reward

Grant+8 NAND
Statuspass the lab first

One grant per lab per wallet, materials only — WFR is earned by mining verified dies, never given away. The server re-checks your circuit before signing.

Etch it as a die (optional)

Turn this circuit into a verified die you own. It burns 0 NAND — the grant covers it.

connect a wallet to pick a project