The Gate
The Asteroids[1] PCB (Atari, 1979) runs a MOS 6502A at 1.5 MHz. Alongside the CPU are several 74-series logic chips doing address decode and video timing. Among them: 74LS00 quad NAND gates[2] — four two-input gates in a 14-pin package. They invert address lines to generate the chip-enable signals that tell the ROM and RAM which of them the CPU is addressing.




The 74HC00 in the f03b parts list is the same gate in a newer process. Same pinout. Same logic. In the breadboard computer it will again invert A15 to produce ROM CE# — the exact job the Asteroids hardware needs it for.
Before wiring the 74HC00 into a 6502 computer, this chapter uses all four of its gates for something simpler. A breadboard. Four LEDs. A transistor. No software. The goal is to make the chip's behaviour visible at the speed you can think, before it disappears inside a more complex circuit running at a million operations per second.
The implementation pages step through the building blocks in order: binary counting with four LEDs, then a transistor as a switch, then logic gates from the 74HC00. Each page ends with a visual verification — the right LEDs lit for the right input combinations. No software is required at any point. Start at Setup.
Four LEDs, Sixteen States
Before touching the 74HC00, four LEDs go into the breadboard in a row — one per bit. Four bits hold values from 0 to 15: sixteen states. Each LED is wired through a 1kΩ resistor to ground; each anode connects to a separate output pin driven manually by a wire to VCC or GND.
Count to 15 in binary: 0000 — all off. 0001 — rightmost on. 0010 — second from right on. 0011 — two rightmost on. Work through every combination up to 1111 — all four on. Every number from 0 to 15 has exactly one pattern of lit and unlit LEDs. The pattern is not symbolic; it is the number, represented as voltage states in hardware.
That mapping is the layer below everything else — below assembly, below C, below any abstraction the later chapters build. Computation is state, and state is voltage.
The First Gate
I pushed the 74HC00 into a breadboard, found pin 1, and wired one gate: VCC to pin 14, GND to pin 7, a LED and 1kΩ resistor from the output pin to ground. Both input pins got a free wire.
Touch both inputs to VCC — both high. Output goes low. The LED lights. Touch one input to GND — one low. Output goes high. The LED turns off.
That is a NAND gate. Both inputs high is the only combination that drives the output low; everything else drives it high. The chip does not compute this. It has no program. It is a network of transistors in a fixed configuration, and that configuration produces this table of outputs from every combination of inputs. Always, deterministically, within a few nanoseconds.
The Asteroids PCB does not know it is inside an arcade cabinet. The 74LS00 on it receives A15 from the CPU and inverts it. When A15 is high (CPU addressing ROM space), CE# goes low (ROM selected). When A15 is low (CPU addressing RAM space), CE# goes high (ROM deselected). That is the entire address decode for the ROM. One gate, one operation.
This chapter builds up to that. Binary first, then the transistor it is made of, then the gates.
The Project
Three exercises, no code, no software. Verification is visual throughout.
Binary counting — wire four LEDs (one per bit) with 1kΩ resistors. Drive each anode manually to VCC or GND. Work through all sixteen combinations from 0000 to 1111 and confirm each LED pattern matches the expected binary value.
Transistor switch — wire an NPN transistor (BC547 or equivalent) with a base resistor. Apply voltage to the base; the transistor connects collector to emitter, lighting an LED on the collector side. Remove base voltage; transistor opens, LED turns off. This is the basic switching element that gates are built from.
Logic gates — wire three configurations from a single 74HC00 and verify each against its truth table using LEDs (one per input, one on the output):
- NOT gate — output is the logical inverse of the input. Built by tying both inputs of one NAND gate together.
- NAND gate — output is low only when both inputs are high.
- AND gate — output is high only when both inputs are high. Built by feeding a NAND output into a NOT.
The Tester
There is no software tester for this chapter. Work through the truth table for each gate and confirm the LED output matches the expected result. The full truth tables are on the gate pages.
The Companion Repo
CHECKLIST.md contains the truth tables for all three gates. Tick off
each row as you verify it on the breadboard.