Skip to content
Tactiverge

Tactiverge BuildBUILD 008

Create a Virtual Computer

Every app, game and website comes down to switches that are either on or off. Can you wire a handful of logic gates into a machine that actually adds numbers?

Start buildingWatch first60 min · browser only · free

Live build-along: not scheduled yet. Everything here works on your own, any time.

Why it matters

Every processor, from a microwave's controller to a games console, is built from logic gates doing very simple things very fast. Understanding how a few gates add two numbers takes the magic out of computers and is the first step in computer engineering, chip design and embedded systems.

Your objective: Build up a computer from the bottom in a browser simulation: represent numbers in binary, build gates from NAND, watch a carry ripple through a 4-bit adder, then program a tiny 4-bit processor that fetches, decodes and executes your instructions one at a time.

  1. 1.

    The bit

    A single 0 or 1. On a chip it is a voltage that is either low or high.

  2. 2.

    The gate

    A tiny circuit that makes a decision about bits. NAND alone can build every other gate.

  3. 3.

    The adder

    A few gates that add two bits and pass a carry on, exactly like column addition.

  4. 4.

    The processor

    Adders, memory and a control unit that fetches, decodes and executes one instruction after another.

Watch (optional, short)

Hand-picked explainers from their creators. Each one has a reason to watch it. Skip them if you’d rather just build.

Shows how ones and zeros can stand for numbers and text, so binary stops feeling like magic.

10 min 45 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

Introduces AND, OR, NOT and XOR, the building blocks behind every digital decision a computer makes.

10 min 7 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

Shows step by step how a handful of gates add binary numbers, using real chips you can buy.

13 min 38 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

The engineering you’ll use

Binary place value

Each place is worth twice the one to its right. 1101 is 8 + 4 + 0 + 1 = 13.

value = Σ bitᵢ · 2ⁱ

Fixed width and overflow

With n bits you can store 0 to 2ⁿ − 1, so 4 bits hold 0 to 15. Adding 1111 + 0001 gives 10000, and the fifth bit falls off: overflow.

range = 0 … 2ⁿ − 1

Universal NAND

NAND with both inputs joined is NOT. Every other gate can be built from NANDs, which is why it matters to chip makers.

NOT A = A NAND A

Half adder

Adding two bits: the sum bit is 1 when exactly one input is 1, and the carry is 1 when both are.

S = A ⊕ B, C = A · B

Full adder and ripple carry

A full adder also takes a carry in. Chain n of them, each carry feeding the next, to add n-bit numbers. The carry has to ripple through, adding two gate delays per bit in the design we build.

S = A ⊕ B ⊕ Cin, Cout = A·B + Cin·(A ⊕ B)

Two's complement

In 4 bits, 1111 can mean 15 or −1: adding 1111 to any number carries out of the top bit and leaves one less. That is how a machine with only an adder can count down and subtract.

−x ≡ 2ⁿ − x

Fetch, decode, execute

A processor repeats one cycle: fetch the instruction the program counter points at, decode its opcode, execute it (often using the adder), then move on. Our Nibble machine has one register A, a zero flag and a carry flag, and five instructions: LOAD, ADD, STORE, JNZ and HALT.

Connects to: Binary, hexadecimal and digital signals · Fixed-width integers, bits and registers · Logic gates and Boolean algebra · Sequential logic and memory · Inside a microcontroller · Functions and decomposition · Testing and debugging · Algorithms, searching and complexity · Decisions and loops

Same machine. Five ways in.

Pick the level that feels like a stretch, not a wall. You can switch any time, and your work saves to your Workshop.

△ Builder · Everything from NAND

In the circuit builder, wire NOT from one NAND, XOR from at most four NANDs, and a half adder from at most two gates. Toggle the inputs to watch signals light up and read your live truth table; the server checks every row.

You’ll make: Three passing circuits within the gate limits.

Checked instantly on our server

NOT from NAND. Make Y the opposite of A, using only NAND. Gates allowed: NAND · at most 1.

Try inputsA
AY=?
    Your circuit's truth table
    AY
    0?
    1?

    Tip: a gate's two inputs can be the same wire.

    At the live build-along

    60 minutes, building together

    Team challenge
    Teams of three build the half adder together, then each member checks a different half of the truth table and the team proves it is right for every row. No leaderboard: every team that gets there explains how they know it works.
    Your own design
    On your own: build XOR from as few NAND gates as you can, then explain in plain words why it works.
    Questions
    Moderated questions in the live room. Questions are answered on screen without names, and chat stays off.
    Extension
    Our adder has no memory: change the inputs and the answer changes. Research what a flip-flop does and sketch where one would sit in a computer that adds a list of numbers one at a time.
    You leave with
    A saved set of passing circuits (NOT, XOR and a half adder), a checked full adder, a multiply program that runs on the server and a written explanation of overflow, stored in your Workshop and counted toward your Passport.

    For educators & facilitators

    A complete run of show, misconceptions, safety notes and a printable worksheet.

    Open the facilitator guide

    Safety: Browser simulation and paper design only. Never open a computer, phone or power supply, and keep any breadboard work to low-voltage battery kits checked by an adult. Any physical extension needs an adult's safety review and supervision before anyone starts.

    Go further

    Tell the people who built this

    Optional. We’re students too, and we change things because of what you say.

    Please don’t include your name or anything personal. Nothing you write is shown publicly.

    Next build · 001Design a Washing Machine