← All concepts
TechnologyBasic theoryInteractive

Boolean logic & gates

Boolean algebra and the seven logic gates, with truth tables you can toggle.

Logic gate explorer
0
ABAND
000
010
100
111

Boolean algebra works with two values, 0 (false) and 1 (true). Logic gates are the hardware that implements the Boolean operators, and they are the building blocks of every digital circuit.

The gates

GateOutput is 1 when…
ANDboth inputs are 1
ORat least one input is 1
NOTthe single input is 0 (it inverts)
NANDNOT of AND — 0 only when both inputs are 1
NORNOT of OR — 1 only when both inputs are 0
XORthe inputs differ
XNORthe inputs are the same

Laws worth memorising

  • Identity: A·1 = A, A+0 = A.
  • Complement: A·Ā = 0, A+Ā = 1.
  • De Morgan's: ¬(A·B) = Ā+B̄ and ¬(A+B) = Ā·B̄.
Tip:NAND and NOR are *universal* — any circuit at all can be built from just one of them.