Introduction
Boolean algebra is the algebra of two-valued logic used to describe and simplify digital circuits. Variables take values in ; the operations AND, OR and NOT correspond to series switches, parallel switches and inversion. Every gate network implements a Boolean function, and algebraic identities let you rewrite a network without changing its truth table.
This note states the axioms, the standard theorems (including De Morgan and absorption), duality, and the counting facts GATE tests: how many functions, how many minterms, what self-dual means. Canonical forms and universal gates continue in the next note.
Prerequisites
- Familiarity with truth tables from school logic is enough. Related mathematical views appear in Propositional Logic and Partial Orders and Lattices.
Core concepts
Values, operations, notation
| Operation | Algebra | Gate | Switching |
|---|---|---|---|
| AND (product) | or | AND | series |
| OR (sum) | OR | parallel | |
| NOT (complement) | or | inverter | normally-closed |
Convention used in all Gate CS Mastery DL notes. Juxtaposition means AND; means OR; means NOT. Precedence: NOT binds tightest, then AND, then OR. So means .
Huntington axioms (one common presentation)
A Boolean algebra on set with , , satisfies, among other equivalent axiom sets:
- Commutative: , .
- Distributive: , .
- Identities: , .
- Complements: , .
From these one derives the remaining standard theorems. Hardware interprets 0 and 1 as logic levels; the algebra itself does not care which voltage is HIGH.
Duality
The dual of an expression swaps with and with , leaving variables and complements unchanged. If an identity holds, its dual holds. Example: the dual of is .
Duality versus complement. The two operations look alike and exams confuse them on purpose.
| Operation | Rule | Example |
|---|---|---|
| Dual | Swap and , swap 0 and 1; keep literals | |
| Complement | Swap and , swap 0 and 1, and complement every literal |
They are linked by : the dual is the complement evaluated at complemented inputs. Duality is a statement about identities (the dual of a true identity is true); it does not say that for a function, which holds only for self-dual . Keep the parentheses that the original precedence implied: the dual of is , not .
Self-dual function. A function is self-dual when for every input (equivalently, where is the dual function). Self-dual functions are determined by their values on half of the input space (inputs whose first bit is 0, for example), so there are self-dual Boolean functions of variables.
Standard theorems (use freely)
| Name | Identity | Dual |
|---|---|---|
| Idempotent | ||
| Domination | ||
| Involution | same | |
| Absorption | ||
| De Morgan | ||
| Consensus |
Consensus removes the redundant term when and are present. It is the algebraic twin of eliminating a non-essential implicant.
Proof of consensus. . The term is absorbed by and by , so adding changes nothing. The consensus of and is formed by deleting the opposed variable and ANDing what is left: . Two terms have a consensus only when exactly one variable appears complemented in one and uncomplemented in the other.
Properties of the derived operators
| Operator | Commutative | Associative | Note |
|---|---|---|---|
| AND, OR | yes | yes | Both distribute over each other |
| XOR, XNOR | yes | yes | AND distributes over XOR: |
| NAND, NOR | yes | no |
For NAND, while ; they differ at . A multi-input NAND gate computes ; it is not a cascade of two-input NANDs.
No cancellation law. does not imply (take ), and does not imply (take ). If both equations hold, then . Do not "cancel" a common term from both sides of a Boolean equation.

How it works
Evaluating a function
Substitute 0/1 for each variable and apply the operations with the precedence above, or build a truth table with rows for variables.
Simplifying by algebra
Apply identities to reduce literal count or gate count. Typical moves: factor (distributive), absorb, cancel , apply De Morgan to push complements inward, drop consensus terms.
Example. . First , so . By the distributive law of OR over AND, . So .
Example (product of sums). , where the last step drops , the consensus of and .
Example (factor and absorb). . No further reduction is possible: the two terms have no consensus in a variable that makes either redundant.
Counting
- Number of Boolean functions of variables: (each of rows may be 0 or 1).
- Number of minterms (or maxterms) of variables: .
- Number of self-dual functions: .
- Number of functions that depend on all variables is smaller, see Mathematical explanation.
Function classes and their counts
| Class | Definition | Count for variables | ||
|---|---|---|---|---|
| All functions | any truth table | 16 | 256 | |
| Self-dual | for every input | 4 | 16 | |
| Neutral | as many 1s as 0s in the truth table | 6 | 70 | |
| Symmetric | value depends only on the number of 1 inputs | 8 | 16 | |
| Affine (linear) | 8 | 16 | ||
| Monotone | bitwise implies | no closed form | 6 | 20 |
| Depends on all variables | no variable is irrelevant | 10 | 218 |
Why each count holds.
- Self-dual: the inputs split into complementary pairs . Choosing fixes , so there are free choices. Each pair contributes one 0 and one 1, so every self-dual function is neutral (16 of the 70 neutral functions of 3 variables).
- Neutral: choose which of the rows are 1.
- Symmetric: the input weight takes values , and assigns 0 or 1 to each. Examples: , majority .
- Affine: coefficient bits.
- Depends on all variables: inclusion and exclusion over the set of variables that are ignored. For : (all except the constants 0, 1 and the four functions ).
Algorithms and pseudocode
Truth-table evaluation of an expression tree is the reference semantics for every later minimization note.
EVAL(expr, assign) // normalized variable/constant/NOT/AND/OR tree
0 if expr is constant 0 or 1 then return that constant
1 if expr is a variable x_i then return assign[i]
2 if expr is NOT(t) then return 1 - EVAL(t, assign)
3 if expr is AND(t, u) then return EVAL(t, assign) AND EVAL(u, assign)
4 if expr is OR(t, u) then return EVAL(t, assign) OR EVAL(u, assign)
TRUTH-TABLE(expr, n)
1 rows <- empty list
2 for each assign in {0,1}^n in lexicographic order
3 append EVAL(expr, assign) to rows
4 return rowsTwo expressions are equivalent exactly when their truth tables match. A truth table with rows is a complete proof of any identity in variables.
Mathematical explanation
Shannon expansion (Boole's expansion). For any ,
Iterating yields the sum-of-minterms canonical form (next note). The dual expansion with AND of OR-clauses yields the product of maxterms.
XOR and XNOR. , and . XOR is associative and commutative; , , . Any Boolean function has an algebraic normal form as a XOR of ANDs (Reed-Muller), which is useful but not required for GATE beyond small identities.
Further XOR facts used below:
- exactly when an odd number of inputs are 1 (odd parity).
- , and whenever (disjoint terms can be ORed or XORed).
- .
- For three inputs, : with an odd number of operands, XNOR chains and XOR chains agree; with an even number they are complements.
Shannon expansion as a multiplexer. Expanding about gives and , so : a 2:1 multiplexer with select . This is the basis of MUX-based function implementation in the Multiplexers, Decoders and Encoders note.
Worked examples
Example 1: prove absorption by cases
For : if , both sides 1; if , both sides 0. So . Dual: .
Example 2: De Morgan on three variables
by applying the two-variable rule twice. Dual: .
Example 3: counts for
- Functions: .
- Minterms: 8.
- Self-dual functions: .
Example 4: is self-dual?
, yes. Is self-dual? Dual is , and , so no.
Example 5: consensus
. Truth-table check shows equals on all 8 inputs of three variables; the term never turns a 0 into a 1 that the first two terms miss.
Example 6: dual and complement of one expression
For : the dual is , and the complement is . Check the link at : , and .
Example 7: which of these are self-dual?
- Majority : its dual is , which multiplies out to . Self-dual.
- : complementing all three inputs flips the parity of three bits, so the output flips. Self-dual.
- : complementing both inputs leaves the output unchanged, so . Not self-dual (no function of an even number of XORed inputs is).
- : the dual differs at . Not self-dual.
Example 8: counting with a constraint
How many functions satisfy and ? Two of the 8 rows are fixed, so . How many of the 70 neutral functions are also self-dual? All 16 self-dual functions are neutral, so 16.
Important properties and observations
- AND distributes over OR and OR distributes over AND. Ordinary arithmetic has only one distributive law; Boolean algebra has both.
- and are worth memorising; they are absorption after expanding.
- Literal: a variable or its complement. Term: a product of literals. Clause: a sum of literals.
- A function that ignores some variables still counts among the functions of those names; "depends on all variables" is a stricter class.
Common misconceptions.
- "." False: by absorption , and the two sides differ at . The rule with a complemented first factor is the one that simplifies: .
- "Self-dual means ." No function equals its own complement; self-dual means , that is .
- "The dual of is its complement." The complement also complements every literal; the dual does not.
- "NAND is associative, so a 3-input NAND is two cascaded 2-input NANDs." NAND and NOR are not associative.
- "Number of Boolean functions of inputs is ." That is the number of rows, not functions.
GATE examination perspective
- SIMPLIFY BY IDENTITIES. Reduce an expression; the answer is unique only up to algebraic form, so a specific shape is normally stated (minimum literals, or a given template).
- NUMBER OF FUNCTIONS. ; for it is 16; for it is 256.
- SELF-DUAL COUNT. .
- DUAL OF AN EXPRESSION. Swap / and /.
- WHICH IDENTITY. Spot absorption vs consensus vs De Morgan in a short proof.
- DUAL OR COMPLEMENT. A question giving and asking for will list as a distractor (and vice versa).
- CLASS COUNTS. Neutral , symmetric , self-dual ; fixing rows leaves functions.
- NON-ASSOCIATIVE OPERATORS. Evaluate as written; do not regroup NAND or NOR.
- FUNCTIONAL COMPLETENESS. Whether a gate set can build every function is decided by Post's criteria, see Canonical Forms and Functional Completeness.
Summary
Sources
- M. Morris Mano, M. D. Ciletti, Digital Design, 5th ed., Pearson, 2013: Chapter 2, Sections 2.2 to 2.5 and 2.8 (definitions, axioms, theorems, Boolean functions, logic gates).