A Boolean operator takes one or more 0/1 values and produces a 0/1 result. The three basic operators are:
- AND (
AB): 1 only when all inputs are 1. - OR (
A + B): 1 when at least one input is 1. - NOT, the complement (): flips 0 and 1.
These three are enough to describe any boolean function: list the rows where the output is 1, write an AND term for each, and OR them together. That is why they are the core of Boolean algebra.
Other common operators are built from them. NAND is , NOR is , XOR is and XNOR is . Each has its own gate; see logic gate.
When operators are mixed, operator precedence decides the order: NOT, then AND, then OR.
Notation differs between fields: ∧, ∨ and ¬ in discrete maths, &&, || and ! in code. The logic is identical.
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 |