Skip to content
LearnTronics menu

LearnTronics

AND, OR, NOT — Logic in Ordinary Language

Tutorial Index

Four little words do a lot of work

Much of digital logic grows from a few ideas we already use in speech: AND, OR, NOT, and the special “one but not both” form called XOR.

AND both must be true OR either or both XOR one, but not both NOT reverse the truth “Joe got gas AND a meal.” “Joe got gas OR a meal.” “Turn left XOR right.”

AND

“The motor may run when the guard is closed AND the start command is present.” Both conditions must be true.

ABA AND B
FFF
FTF
TFF
TTT

OR — the word that causes trouble

In everyday English, “or” can mean two different things.

“Joe stopped for gas or a meal” may still be true if Joe did both. That is inclusive OR.

“Turn left or right” usually means one direction but not both. That is exclusive OR, written XOR.

ABA OR B
FFF
FTT
TFT
TTT
ABA XOR B
FFF
FTT
TFT
TTF

NOT

NOT simply reverses a truth value. If A means “the door is open,” then NOT A means “the door is not open.”

ANOT A
FT
TF

Some terminology

AND is called conjunction. OR is disjunction. XOR is exclusive disjunction. NOT is negation. Collectively we can simply call them logical operators or connectives.

Why language comes first

The old truth-table page made a particularly useful distinction between the two everyday meanings of “or.” That is exactly the kind of language habit that later determines whether a circuit does what its designer intended.

Try these yourself

A AND B is true when:
AND requires both conditions to be true.
In formal logic, ordinary inclusive OR is true when:
Inclusive OR includes the case where both statements are true.
“Turn left or right, but not both” is closest to:
XOR means one or the other, but not both.