Lab 1 of 15 · rank 00

Invert a bit

Build a circuit with input A and output Y such that Y is the inverse of A. Label the ports A and Y.

← All labsNext lab →

Learn first

A NOT gate flips a bit: 0 becomes 1 and 1 becomes 0.

Everything in a computer is a bit: a switch that is either off (0) or on (1). The simplest thing you can do to a bit is flip it.

Wafer only gives you one kind of gate, NAND. But here's the trick: if you connect the same wire to both inputs of a NAND, it becomes a NOT. When A is 1, both inputs are 1, so the NAND gives 0. When A is 0, the NAND gives 1.

Try this

Place an IN cell and name it A. Place a NAND (or a NOT cell — it costs the same). Wire A's output pin to both input pins of the NAND. Place an OUT, name it Y, and wire the NAND's output to it. Click A to toggle it and watch Y do the opposite.

AY = not Asame wire into both pins
  1. ✓
    Build itPorts named A and Y
  2. 2
    Pass the truth table2 rows checked
  3. 3
    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 1
LATCH used0 / par 0
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 wire to remove it · click a cell to rename it
→ Y=0

What it should do

AY
01
10

Stuck?

Drop a NOT, or a NAND with both pins wired to A.

Par is 1 NAND. Using more still passes here. To etch it as a verified die that mines, keep it within 5 NAND-equivalent (a LATCH counts 2): the verifier refuses bigger designs, so padding can't buy mining weight.

Etch it as a die (optional)

Turn this circuit into a verified die you own. It burns 0 NAND. Get materials at the Foundry.

connect a wallet to pick a project