Solutions for The Nand Game, a game that teaches the fundamentals of computing by building a computer from scratch. Each level is accompanied by images of the logic gates used to build the components.
🔩 Hardware Implementation

This NAND gate is built using two SPDT (Single Pole Double Throw) relays. Each input (A and B) controls one relay's coil. The relays are wired so that only when both inputs are HIGH do the coils switch their contacts and disconnect the output from voltage — making the output LOW. In all other cases, the output remains HIGH, satisfying the NAND truth table. While modern systems use transistors for speed and efficiency, this relay-based implementation demonstrates the fundamental logic at a hardware level.

Builds a NOT gate using a NAND gate by tying both inputs together. This creates an inverter — a fundamental building block in digital logic.

This builds the AND Gate, which takes two inputs and will tell you if they are both on, this is created by inverting the output of a NAND gate.

Builds an OR gate using only NAND gates by applying De Morgan’s Law. Inverts both inputs, then NANDs the results — producing a circuit that’s true when either (or both) inputs are HIGH.

Implements exclusive logic using only NAND gates — true when inputs differ, false when they’re the same.

This is the adder which allows us to add binary numbers from 0 to 2 (1 0) in binary

The Full Adder allows us to add up 3 1-bit binary numbers to add from 0 to 3 (1 1 in binary)

We made the Full Adder,and now we can chain multiple Full Adders to perform binary addition on multi-bit numbers.

Increases a binary number by one — useful for counters and loops.

Performs binary subtraction using adders and two’s complement logic.

Checks if a binary value is zero — essential for condition checking and branching.

Detects negative values in signed binary numbers — useful in arithmetic logic decisions.

Routes one of two inputs to the output based on a control signal — a 2:1 multiplexer.

Acts like a controlled gate — opens or closes the path between input and output.

Performs bitwise operations (AND, OR, NOT) between binary inputs.

Handles binary addition and subtraction operations.

Combines logic and arithmetic functions into one unit — the brain of binary computation.

Evaluates flags or result bits from the ALU to guide decision making.

Basic memory cell that stores 1 bit using feedback between NAND gates.

Stores data based on a clock or enable signal — an improvement over the SR Latch.

Edge-triggered version of the D Latch — useful for precise timing.

Stores multiple bits together — like a row of flip-flops.

A sequential circuit that counts up (or down) with each clock pulse

Random Access Memory — stores and retrieves binary values at addressed locations.

Unifies program and data memory for compact system design.

Encodes control bits to instruct the ALU on which operation to perform.

Selects control paths to guide instruction flow.

Directs the execution of instructions based on inputs and current state.

Combines the control unit, the storage memory (RAM and Registers), program memory(Rom), A counter, and a clock unit to create a working programmable microprocessor.

Interfaces the computer with the outside world through signals and devices, in this case a button and a light.
👤 Steven Reynoso
- LinkedIn: @Steven Reynoso
- GitHub: @Steven Reynoso