LearnTronics
AND, OR, NOT — Logic in Ordinary Language
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
“The motor may run when the guard is closed AND the start command is present.” Both conditions must be true.
| A | B | A AND B |
|---|---|---|
| F | F | F |
| F | T | F |
| T | F | F |
| T | T | T |
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.
| A | B | A OR B |
|---|---|---|
| F | F | F |
| F | T | T |
| T | F | T |
| T | T | T |
| A | B | A XOR B |
|---|---|---|
| F | F | F |
| F | T | T |
| T | F | T |
| T | T | F |
NOT
NOT simply reverses a truth value. If A means “the door is open,” then NOT A means “the door is not open.”
| A | NOT A |
|---|---|
| F | T |
| T | F |
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.