Boolean algebra is the branch of algebra in which the values of the variables are the truth values true ($1$) and false ($0$). It is fundamental to computer science, digital logic circuits, and set theory.
The primary operations of Boolean algebra are conjunction (AND), disjunction (OR), and negation (NOT). These operations are implemented in hardware as logic gates.
Derived operators include:
A truth table is a mathematical table used in logic to compute the functional values of logical expressions on each of their functional arguments.
| $A$ | $B$ | AND ($A \wedge B$) | OR ($A \vee B$) | XOR ($A \oplus B$) | NAND | NOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
| $A$ | NOT ($\neg A$) |
|---|---|
| 0 | 1 |
| 1 | 0 |
Boolean algebra obeys several fundamental laws, allowing us to simplify complex logical expressions and circuit designs.
A term is absorbed when it is redundantly "OR"-ed or "AND"-ed. $$ A \vee (A \wedge B) \Leftrightarrow A $$ $$ A \wedge (A \vee B) \Leftrightarrow A $$
A term "AND"-ed with 0 is always 0. A term "OR"-ed with 1 is always 1. $$ A \wedge 0 \Leftrightarrow 0 $$ $$ A \vee 1 \Leftrightarrow 1 $$
The grouping of variables connected by the same operator does not affect the result. $$ A \vee (B \vee C) \Leftrightarrow (A \vee B) \vee C $$ $$ A \wedge (B \wedge C) \Leftrightarrow (A \wedge B) \wedge C $$
The order of variables does not matter. $$ A \vee B \Leftrightarrow B \vee A $$ $$ A \wedge B \Leftrightarrow B \wedge A $$
A term "OR"-ed with its complement equals 1. A term "AND"-ed with its complement equals 0. $$ A \vee \neg A \Leftrightarrow 1 $$ $$ A \wedge \neg A \Leftrightarrow 0 $$
Formally written, these are:
$$ \neg(P \vee Q) \Leftrightarrow (\neg P) \wedge (\neg Q) $$
and
$$ \neg(P \wedge Q) \Leftrightarrow (\neg P) \vee (\neg Q) $$
Variables can be distributed across operators, similar to standard algebra. $$ A \wedge (B \vee C) \Leftrightarrow (A \wedge B) \vee (A \wedge C) $$ $$ A \vee (B \wedge C) \Leftrightarrow (A \vee B) \wedge (A \vee C) $$
Negating a term twice results in the original term. $$ \neg(\neg A) \Leftrightarrow A $$
A term "OR"-ed or "AND"-ed with itself equals itself. $$ A \vee A \Leftrightarrow A $$ $$ A \wedge A \Leftrightarrow A $$
A term "OR"-ed with 0 or "AND"-ed with 1 will always equal that term. $$ A \vee 0 \Leftrightarrow A $$ $$ A \wedge 1 \Leftrightarrow A $$
Boolean operations map directly to fundamental operations in set theory.
For example, De Morgan's Laws in set theory are: