NAND-16: Building a Computer from Scratch with 277,248 NAND Gates

NAND-16 builds a fully functional 16-bit computer from 277,248 NAND gates, taking the Nand2Tetris philosophy to its engineering extreme.
NAND-16 is a 16-bit computer constructed entirely from 277,248 NAND gates, rooted in the bottom-up philosophy of the Nand2Tetris course. Because NAND gates are functionally complete, they serve as the sole building block — from them, all Boolean logic, ALUs, registers, memory, and a full CPU can be derived layer by layer. At roughly 1.1 million transistor-equivalents, the project far surpasses early historic processors in scale while remaining comprehensible in a way modern commercial chips are not. Its value lies not in performance but in making the answer to "how does a computer work" tangible — a compelling reference for anyone seeking a deep understanding of computer architecture.
A Computer Rebuilt from the Ground Up
NAND-16 is an ambitious engineering project: an entire computer built from exactly 277,248 NAND (Not-AND) gates. The number may seem staggering, but the philosophy behind it is remarkably pure — start from the most fundamental logical unit, stack layer upon layer, and ultimately arrive at a functioning 16-bit computer.
For anyone familiar with computer organization principles, this bottom-up approach is nothing new. It follows the same spirit advocated by The Elements of Computing Systems (better known as the Nand2Tetris course): all digital logic can be reduced to the NAND gate, a single universal gate. In theory, NAND gates alone are sufficient to express any Boolean function, and from there you can construct arithmetic logic units, registers, memory, and a complete CPU.
The Elements of Computing Systems (commonly abbreviated as Nand2Tetris) was written by Noam Nisan and Shimon Schocken of the Technion — Israel Institute of Technology, and is accompanied by a course of the same name. The course's central idea is to have learners start from a hypothetical NAND gate and progressively build a logic gate library, an ALU, a CPU, a memory system, an assembler, a virtual machine, and finally a high-level language called Jack — traversing every abstraction layer of a complete computing system. The course has attracted a vast community of self-learners and university adopters worldwide, and stands as a landmark educational resource for systematically answering the question "how does a computer work?" NAND-16 can be seen as a further engineering exploration built on top of this educational framework, realizing its theoretical abstraction layers at greater scale and in more complete form.
Why NAND Gates
NAND gates hold a special place in digital circuits — they are one of the "functionally complete" logic gates. This means that NAND gates alone can implement all basic logical operations, including AND, OR, and NOT, without the need for any other gate type.
This property makes NAND gates an ideal starting point for teaching and experimental projects. When you restrict yourself to a single type of gate, the source of complexity in the entire system becomes completely transparent: every higher-level abstraction — whether an adder, a multiplexer, or a storage cell — can be traced back to a specific combination of NAND gates. NAND-16's use of 277,248 gates to realize a complete machine is the ultimate expression of this "everything can be built from NAND" philosophy.
From a physical implementation perspective, NAND gates also have clear advantages. In CMOS technology, a NAND gate requires fewer transistors, runs faster, and consumes less power than an equivalent AND or NOR gate, making it one of the most commonly used primitive cells in real chip design. The mathematical proof of functional completeness is straightforward: NOT(A) can be implemented with a single-input NAND (both inputs tied to the same signal); AND(A,B) = NOT(NAND(A,B)); OR(A,B) = NAND(NOT(A), NOT(B)). From these three derivations alone, all Boolean logic can be expressed. NOR gates are also functionally complete, but NAND gates are far more prevalent in engineering practice, which is why they became the foundational unit of choice for educational projects like Nand2Tetris.
What 277,000 Gates Actually Means
The precise figure of 277,248 itself signals how seriously this project was taken. Modern CPUs routinely contain tens of billions of transistors, making NAND-16 far more modest in scale — but its value lies not in performance, but in comprehensibility.
A computer built from 277,000 NAND gates is one where the behavior of every single component can be fully traced. This stands in sharp contrast to commercial chips, whose complexity has long since exceeded what any individual can completely grasp. For learners and enthusiasts who want to truly understand "how a computer works," this scale hits a sweet spot: complex enough to run meaningful programs, yet simple enough to be understood gate by gate.
Converting to transistor count, a standard CMOS NAND gate typically consists of 4 transistors, so 277,248 NAND gates correspond to roughly 1.1 million transistors. For reference, the Intel 4004 (1971, the world's first commercial microprocessor) contained approximately 2,300 transistors; the MOS 6502 (1975, used in the Apple I and early Nintendo consoles) contained about 3,510. NAND-16's transistor equivalent far surpasses these historic chips, indicating it is not a toy-level demo but a complete implementation with real engineering depth. Of course, those early commercial chips benefited from meticulous physical design optimization, while NAND-16 — whether realized in discrete components or on an FPGA — cannot match them in area or power efficiency. The two operate under entirely different value propositions.
From Educational Project to Engineering Practice
The significance of projects like this often extends beyond their technical content. Building a computer entirely from basic logic gates is a form of deep learning: you no longer treat the CPU, memory, and instruction set as black boxes, but instead forge them yourself from the most primitive raw materials.
Judging by community reception (the project sparked discussion on Hacker News), hardcore low-level projects like this consistently attract a dedicated group of technology enthusiasts. They serve as a reminder that seemingly mysterious modern computing devices are, at their core, built upon extraordinarily simple, fully comprehensible logical units. NAND-16 is an attempt to make that path from "NAND gate" to "complete computer" tangible and concrete.
Key Takeaways
For anyone looking to deeply understand computer architecture, NAND-16 offers a valuable reference point. It validates a classic insight: complex systems can emerge from extremely simple components combined according to clear rules. Understanding this principle has far more lasting value than memorizing any specific chip specifications.
It is worth noting that the publicly available information remains limited. Questions about NAND-16's specific implementation details, instruction set architecture, clock frequency, and whether a simulation environment is available will require consulting the project's original source materials for complete answers.
Related articles

ChatGPT Space Launches: Team Collaboration and New Pages Features Explained
ChatGPT Space is OpenAI's new team collaboration feature with Pages, real-time collaboration, and Slack/Google Drive sync. We break down its privacy design, multi-platform integration, and the full workflow from conversation to document.

Migrating Apache Spark UDFs to GPU Acceleration with AI Agents
NVIDIA developer blog explains how AI Agents rewrite Apache Spark UDFs for GPU acceleration, covering migration criteria, agent rewriting and verification workflows, plus pitfalls like result consistency and CPU-GPU transfer overhead.

Zed Editor v0.40.4-rc2 Released: Usage Credits Now Available Without Upgrading
Zed editor releases v0.40.4-rc2, allowing users to use usage credits for AI features without upgrading to a paid plan, lowering the trial barrier.