CS ATLAS A map of computing

Gate Reference

Gate reference

Six basic gates, each from three angles: expression, truth table and symbol. Click any row of a truth table and the pin values on the symbol follow.

The “basic gates” here are the digital-logic view: AND, OR and NOT are the primitives, with NAND and NOR listed for their universality. In Boolean algebra the primitives are ∧, ∨ and ¬; in CMOS they are NAND, NOR and the inverter — an AND is usually NAND plus inverter.The same gate at four levels →

GateTruth tableSymbol

NOT

Inverter

¬a

the output is the opposite of the input

af
01
10
a 0f 1

AND

Conjunction

a ∧ b

the output is 1 only when both inputs are 1

abf
000
010
100
111
a 1b 1f 1

OR

Disjunction

a ∨ b

the output is 1 when either input is 1

abf
000
011
101
111
a 0b 1f 1

XOR

Exclusive or

a ⊕ b

the output is 1 when the inputs differ

abf
000
011
101
110
a 0b 1f 1

NAND

¬(a ∧ b)

the output is 0 when both inputs are 1

abf
001
011
101
110
a 0b 0f 1

NOR

¬(a ∨ b)

the output is 1 only when both inputs are 0

abf
001
010
100
110
a 0b 0f 1

Click any row of a truth table and the pin values on the symbol to the right follow.