Lab 3 of 10 · rank 02

XOR

Y = A XOR B. The half-adder’s sum bit.

← All labsNext lab →

Learn first

XOR means 'different': Y is 1 when A and B are not the same.

Turn a light on when exactly one of two switches is on — that's XOR. It's the gate that adds two bits without the carry, so it's the heart of every adder.

You can build it from four NANDs: one NAND shared in the middle, one NAND per input that mixes the input with that middle signal, and a final NAND that joins the two. It looks like a diamond.

Try this

NAND #1 takes A and B. NAND #2 takes A and the output of #1. NAND #3 takes B and the output of #1. NAND #4 takes the outputs of #2 and #3, and its output is Y. Not sure? Press Examples in the Studio later — but try it here first.

A=1B=0NANDY=1
  1. 1
    Build itPorts named A, B and Y
  2. 2
    Pass the truth table4 rows checked
  3. 3
    Claim the grant+16 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 4
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 cell to rename it
Y=0

What it should do

A BY
0 00
0 11
1 01
1 10

Stuck?

Classic 4-NAND XOR, or the XOR cell.

Par is 4 NAND. Using more still passes; fewer is just neater.

Your reward

Grant+16 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