NAND-16: A Visual Exploration of Computer Architecture
This interactive experience allows you to explore the inner workings of a computer built from NAND gates. You can "Play" the machine, interacting with it as if it were a game console, or "Explore" its architecture in detail.
Playing the Machine
In "Play" mode, your keyboard inputs are sent directly to the machine, acting as its keyboard encoder chip. Use the arrow keys (↑, ↓, ←, →) for directional input, X and Z for pad buttons, and Enter for start and Esc for select. The Space bar inputs character 32. You can also type letters and digits directly.
- Controls:
↑,↓,←,→: Pad up, down, left, rightX,Z: Pad A, Pad B (and their characters)Enter: Pad start (and its character)Esc: Pad select (and its character)Space: Character 32- Letters, digits: Typed characters
Tab: Switch between Play and Explore modesHome: Fly back to the deskEnd: Fly to the screen (playing view)- Mouse:
- Wheel: Zoom toward the cursor
- Drag / Right-drag: Pan / Orbit
- Double-click: Fly into a chip or block; on the monitor: fly to that pixel's latch
- Click: Inspect a gate or block (click the monitor to play)
- Right-click: Open a gate in the Fault Lab, ready to break
Exploring the Architecture
"Explore" mode gives you a deeper look into the computer's design. You can control the camera, use various tools, and even run curated experiments.
- Controls:
P,Space: Run / Pause[]: Clock dial: slower / faster.,/T: Step an edge, a cycle, an instruction, a tickB: Bullet time: record one cycle, replay it gate delay by gate delay; pressBagain to resume.←,→: Bullet time: advance one gate delay (holdShiftfor 10)C: Bullet time: show the critical path of the current edgeF: Open the Fault Lab0,1: Fault Lab: set selected gate to stuck-at 0 or 1R: Fault Lab: release all faultsL: Logic analyzerH: Toggle more / less machine detailA: Audit a cycle nowG: Start the Genesis tour (use←/→for chapters,Enterto prove,Mto see in the machine)Esc: Deselect / Close?: Show this card
Key Features
- Genesis: Explore the invention of this computer from a single gate through 15 chapters. You can "prove it" and "see it in the machine."
- Fault Lab: Break individual gates and observe the consequences.
- Clocks: Control the speed, pause, and step through time with "bullet time" for detailed analysis.
- Logic Analyzer: View waveforms of buses and clocks.
- Machine View: Monitor speeds, registers, and audit the machine's state. Gate counts are also displayed.
- Desk View: Get an overview of the entire machine.
Auditing and Performance
Everything displayed on screen is read directly from the NAND gates' own nets or measured. The audit function (top right) re-executes sampled cycles with an independent evaluator and flags any mismatches in red.
- Machine Status: Running at 16.4 kHz with 0.0% slip.
- Performance Metrics: Gate evaluations (23.1 M/s), instructions (4.0 k/s), cycles/instructions (160,315 / 58,446).
- Current Instruction:
st r0, [r0-9]atkbd.s:98(fetch cycle). - Gate Count: 277,248 NAND gates.
Curated Experiments
Choose from a list of pre-defined experiments to test specific aspects of the machine:
- 1A: Dead video bank
- 2A: Broken carry
- 3A: Invisible block
- 4A: Stuck key
- 5A:
bneis never taken - 6A: Weaker random number generator
- 7A: No
φ2
Getting Started
To begin, you can "Pick a gate" and zoom into the chip until the NANDs appear, then click one. Alternatively, double-click a pixel on the monitor to fly to the latch that stores it, or run a curated experiment. You can also start a program like NANDTRIS or SNAKE.




