Boolean Algebra: Two Values, Three Operations
Digital circuits implement logic operations using Boolean algebra. This article introduces Boolean variables, the three fundamental operations, truth tables, and physical switch equivalents.
Theoretical Foundations
In 1847, George Boole published The Mathematical Analysis of Logic. Boole formulated logical deduction as an algebraic system that operates on two states: true and false (represented as 1 and 0).
In 1937, Claude Shannon demonstrated in his master’s thesis (A Symbolic Analysis of Relay and Switching Circuits) that Boolean algebra directly models electrical switching circuits. Shannon proved that switches connected in series execute an AND function, while switches connected in parallel execute an OR function. This discovery established Boolean algebra as the mathematical foundation for digital hardware engineering.
Every microprocessor, memory array, and FPGA implements Boolean algebraic equations using physical transistors.
Fundamental Operations
Boolean variables evaluate only to binary states 0 or 1. Boolean algebra defines three primary operations on these variables:
- AND Operation ($A \cdot B$ or $AB$): The output evaluates to 1 only when input $A = 1$ and input $B = 1$. If either input is 0, the output evaluates to 0.
- OR Operation ($A + B$): The output evaluates to 1 when input $A = 1$, input $B = 1$, or both inputs are 1. The output evaluates to 0 only when both inputs are 0.
- NOT Operation ($A’$ or $\bar{A}$): The output evaluates to the inverted state of input $A$.
Note: In Boolean algebra, symbol $+$ designates the logical OR operation, not arithmetic addition. For example, $1 + 1 = 1$.
Comparison with Elementary Algebra
Boolean algebra conforms to formal mathematical axioms known as Huntington’s postulates:
| Elementary Algebra | Boolean Algebra |
|---|---|
| $a \cdot 1 = a$ | $A \cdot 1 = A$ |
| $a + 0 = a$ | $A + 0 = A$ |
| $a \cdot 0 = 0$ | $A \cdot 0 = 0$ |
| $a + (-a) = 0$ | $A + A’ = 1$ |
| $a(b+c) = ab + ac$ | $A(B+C) = AB + AC$ |
Boolean algebra includes a second distributive law:
$$A + (B \cdot C) = (A + B) \cdot (A + C)$$
This second distributive property does not exist in standard arithmetic algebra.
Electrical Switch Equivalents
Figure 1 shows how mechanical switches implement Boolean logic operations:
- Series Switches (AND): Current conducts to the load only when switch A AND switch B are both closed. If either switch is open, the circuit breaks.
- Parallel Switches (OR): Current conducts to the load when switch A OR switch B is closed. The circuit breaks only when both switches are open.
- Normally-Closed Switch (NOT): Actuating the control input opens the circuit, which interrupts electrical conduction.
In CMOS technology, an NMOS transistor acts as a switch that conducts when its gate is high. A PMOS transistor acts as a switch that conducts when its gate is low.
Truth Tables
A truth table lists output states for every valid combination of input variables. An $n$-input Boolean function produces exactly $2^n$ distinct input rows.
| Input $A$ | Input $B$ | AND ($A \cdot B$) | OR ($A + B$) | NOT ($A’$) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
Design Example: Security Access Controller
A security access system unlocks a door ($U = 1$) under specific conditions: the user presents a valid card ($C = 1$) AND enters a correct PIN ($P = 1$), OR an administrator turns an override key ($K = 1$).
Boolean equation:
$$U = (C \cdot P) + K$$
Because the circuit contains three inputs, the truth table contains $2^3 = 8$ rows:
| Row Index | Card ($C$) | PIN ($P$) | Key ($K$) | Term ($C \cdot P$) | Output ($U$) |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 1 |
| 2 | 0 | 1 | 0 | 0 | 0 |
| 3 | 0 | 1 | 1 | 0 | 1 |
| 4 | 1 | 0 | 0 | 0 | 0 |
| 5 | 1 | 0 | 1 | 0 | 1 |
| 6 | 1 | 1 | 0 | 1 | 1 |
| 7 | 1 | 1 | 1 | 1 | 1 |
In Verilog RTL, this equation evaluates using continuous assignment:
assign U = (C & P) | K;
Operator Precedence
Boolean expressions evaluate in a specified hierarchical order:
- Expressions enclosed in parentheses
- NOT operations
- AND operations
- OR operations
For example, $A + B \cdot C$ evaluates as $A + (B \cdot C)$. Designers should include explicit parentheses to prevent syntax ambiguity in hardware descriptions.
Practice Exercises
Exercise 1: A control lamp illuminates ($L = 1$) if switches A and B are both closed, or if switch A is closed and switch C is open. Formulate the Boolean equation and derive the truth table.
View Solution
Equation: $L = AB + AC'$
| $A$ | $B$ | $C$ | $AB$ | $C'$ | $AC'$ | Output $L$ |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 1 |
Exercise 2: Evaluate expression $F = A’B + AB’$ for all four input combinations. Identify the common logic gate implemented by this function.
View Solution
| $A$ | $B$ | $A'$ | $B'$ | $A’B$ | $AB'$ | Output $F$ |
|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 | 0 | 0 |
The output evaluates to 1 when the inputs differ. This implements the exclusive-OR (XOR) logic function.
Exercise 3: Three committee members vote on a motion. The motion passes ($V = 1$) if at least two members vote affirmative. Formulate the Boolean equation and derive the truth table.
View Solution
Equation: $V = AB + AC + BC$
| $A$ | $B$ | $C$ | $AB$ | $AC$ | $BC$ | Output $V$ |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
This implements the majority vote function. This same logic generates the carry-out signal in a binary full adder.