Breadbit › Guides › Logic gates and truth tables
Logic gates and truth tables
From a single inverter to a full adder, one truth table at a time.
What a logic gate does
A logic gate takes one or more inputs that are either 0 (low) or 1 (high) and produces an output according to a fixed rule. A truth table lists the output for every possible input combination: with n inputs there are 2n rows.
The six basic gates
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
The chips in Breadbit
- 7400 — four 2-input NAND gates
- 7402 — four 2-input NOR gates
- 7404 — six inverters (NOT)
- 7408 — four 2-input AND gates
- 7432 — four 2-input OR gates
- 7486 — four 2-input XOR gates
Wiring a chip
- Place the chip across the centre gap, then connect VCC (pin 14) to the positive rail and GND (pin 7) to the negative rail. Without power the chip shows “NOT POWERED”.
- Create inputs with the manual inputs (labelled A, B, C and onwards) or with a switch and a pull-down resistor.
- Read the output with the logic probe, which shows 0 or 1 at any hole.
Verify a truth table in the lab
The “Verify” practicals show input toggles and a truth table. Flip the inputs through every combination and each row that matches the chip’s real output is ticked off, so you know when the whole table has been verified.
NAND builds everything
NAND is a universal gate. Using only NAND gates you can build the others:
NOT A = A NAND AA AND B = NOT (A NAND B)A OR B = (NOT A) NAND (NOT B)
Breadbit includes practicals that build NOT, AND and OR from NAND gates, and others that combine gates into adders and parity checkers.