NAND Gate from Transistors

Build a NAND gate using transistors—the universal gate that can create any other logic function. Includes a debug LED to visualize the AND portion.

Overview

The NAND gate is "NOT AND"—it outputs LOW only when all inputs are HIGH. Like NOR, NAND is a universal gate that can implement any Boolean function. This circuit includes a debug LED showing the AND stage output, making it easier to understand how NAND combines AND and NOT operations.

Components Needed

  • 2x Switch
  • 6x 10kΩ resistor
  • 2x LED
  • 3x 2N2222 transistor
  • severalx Wires

Instructions

  1. Gather Your Components

    This more complex circuit uses two switches, three transistors (two for AND, one for NOT), six 10kΩ resistors, two LEDs (one for main output, one for AND debug), wires, breadboard, and 5V power.

  2. Build the NAND Gate Circuit

    Build an AND gate with series transistors, then add a NOT stage (inverter) after it. The debug LED connects to the AND output so you can see the intermediate result. The main output LED connects after the inverter stage. This helps visualize how NAND = AND + NOT.

  3. Test: Both OFF → Main LED ON

    With both switches OFF, the AND stage outputs LOW (debug LED off). The NOT stage inverts this to HIGH, turning the main LED ON. The debug LED shows the AND portion is off.

  4. Test: Left ON, Right OFF → Main LED ON

    Turn the left switch ON. The AND stage still outputs LOW (both inputs not HIGH), so debug LED stays off. The inverted output keeps the main LED ON.

  5. Test: Left OFF, Right ON → Main LED ON

    Switch positions—left OFF, right ON. Same result: AND outputs LOW, NOT inverts to HIGH. Main LED is ON, debug LED is off.

  6. Test: Both ON → Main LED OFF

    Turn both switches ON. Now the AND stage outputs HIGH (debug LED turns ON!). The NOT stage inverts this to LOW, turning the main LED OFF. This is the only combination where NAND outputs LOW.

Challenges

  • Build a NOT gate using only NAND gates (hint: tie both inputs together)
  • Build an AND gate using only NAND gates
  • Build an OR gate using only NAND gates
  • Remove the debug LED and create a minimal 2-transistor NAND circuit
  • Research how flash memory uses NAND gate structures