Logic gates: symbols and truth tables

The seven basic logic gates, with the symbol, the truth table, how to write each one as a Boolean expression, and the 74-series package that holds it.

Logic gates

The seven gates every tool uses, with the symbol, how to type it, its truth table and the 74-series packages that hold it.

AND

Out is 1 only when every input is 1.

Type AB · reads as A · B

74LS08 quad 2-input · 74LS11 triple 3-input · 74LS21 dual 4-input

ABF
000
010
100
111

OR

Out is 1 when any input is 1.

Type A + B · reads as A + B

74LS32 quad 2-input

ABF
000
011
101
111

NOT

One input, turned over: 1 becomes 0 and 0 becomes 1.

Type A' · reads as A′

74LS04 hex inverter · 7406 open-collector

AF
01
10

NAND

AND, then NOT: 0 only when every input is 1. Universal — any function can be built from NANDs alone.

Type (AB)' · reads as (A · B)′

74LS00 quad 2-input · 74LS10 triple 3 · 74LS20 dual 4 · 74LS30 8-input

ABF
001
011
101
110

NOR

OR, then NOT: 1 only when every input is 0. Universal, like NAND.

Type (A + B)' · reads as (A + B)′

74LS02 quad 2-input · 74LS27 triple 3-input

ABF
001
010
100
110

XOR

Out is 1 when the inputs differ — an odd number of 1s, for more than two.

Type A ^ B · reads as A ⊕ B

74LS86 quad 2-input

ABF
000
011
101
110

XNOR

XOR, then NOT: 1 when the inputs are equal.

Type (A ^ B)' · reads as (A ⊕ B)′

No XNOR package in Breadboard Simulator's library: a 74LS86 into a 74LS04 does it

ABF
001
010
100
111

From Boolean algebra to breadboard.

The simulators carry one function from an expression to a circuit you can build. Free, in your browser.