Lab 9 of 15 · rank 08

4-bit adder

Inputs A0–A3 and B0–B3 (A0/B0 the lowest bit). Outputs S0–S3 and C (the carry out). S = A + B, and C = 1 when the sum doesn't fit in 4 bits.

← All labsNext lab →
  1. 1
    Build itPorts named A0, A1, A2, A3, B0, B1, B2, B3 and S0, S1, S2, S3, C
  2. 2
    Pass the truth table256 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 32
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

A0 A1 A2 A3 B0 B1 B2 B3S0 S1 S2 S3 C
0 0 0 0 0 0 0 00 0 0 0 0
0 0 0 0 0 0 0 10 0 0 1 0
0 0 0 0 0 0 1 00 0 1 0 0
0 0 0 0 0 0 1 10 0 1 1 0
0 0 0 0 0 1 0 00 1 0 0 0
0 0 0 0 0 1 0 10 1 0 1 0
0 0 0 0 0 1 1 00 1 1 0 0
0 0 0 0 0 1 1 10 1 1 1 0
0 0 0 0 1 0 0 01 0 0 0 0
0 0 0 0 1 0 0 11 0 0 1 0
0 0 0 0 1 0 1 01 0 1 0 0
0 0 0 0 1 0 1 11 0 1 1 0
0 0 0 0 1 1 0 01 1 0 0 0
0 0 0 0 1 1 0 11 1 0 1 0
0 0 0 0 1 1 1 01 1 1 0 0
0 0 0 0 1 1 1 11 1 1 1 0
0 0 0 1 0 0 0 00 0 0 1 0
0 0 0 1 0 0 0 10 0 0 0 1
0 0 0 1 0 0 1 00 0 1 1 0
0 0 0 1 0 0 1 10 0 1 0 1
0 0 0 1 0 1 0 00 1 0 1 0
0 0 0 1 0 1 0 10 1 0 0 1
0 0 0 1 0 1 1 00 1 1 1 0
0 0 0 1 0 1 1 10 1 1 0 1
0 0 0 1 1 0 0 01 0 0 1 0
0 0 0 1 1 0 0 11 0 0 0 1
0 0 0 1 1 0 1 01 0 1 1 0
0 0 0 1 1 0 1 11 0 1 0 1
0 0 0 1 1 1 0 01 1 0 1 0
0 0 0 1 1 1 0 11 1 0 0 1
0 0 0 1 1 1 1 01 1 1 1 0
0 0 0 1 1 1 1 11 1 1 0 1
0 0 1 0 0 0 0 00 0 1 0 0
0 0 1 0 0 0 0 10 0 1 1 0
0 0 1 0 0 0 1 00 0 0 1 0
0 0 1 0 0 0 1 10 0 0 0 1
0 0 1 0 0 1 0 00 1 1 0 0
0 0 1 0 0 1 0 10 1 1 1 0
0 0 1 0 0 1 1 00 1 0 1 0
0 0 1 0 0 1 1 10 1 0 0 1

…and 216 more rows, all checked.

Stuck?

A half adder on bit 0, then three full adders, each taking the carry of the one below.

Par is 32 NAND. Using more still passes here. To etch it as a verified die that mines, keep it within 64 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