Introduction to boolean algebra
A clear introduction to Boolean algebra covering its fundamental laws, Boolean operations, subalgebras, duality, De Morgan’s theorems, truth tables, and basic logic gates.
Gulshan Kumar
Boolean algebra is an algebraic system used to work with logical values and logical operations. It provides a mathematical foundation for propositional logic, switching circuits, and digital logic.
Unlike ordinary algebra, Boolean algebra uses operations such as OR, AND, and complementation. In the familiar two-element Boolean algebra, the only values are
where
- represents False
- represents True
The symbols and are used for Boolean addition and Boolean multiplication respectively, but they do not behave exactly like ordinary arithmetic addition and multiplication.
Definition of Boolean Algebra
A non-empty set equipped with two binary operations and , a unary operation , and two distinct elements and is called a Boolean algebra if the required Boolean algebra laws are satisfied.
It is written as
For elements :
- represents the OR operation.
- represents the AND operation.
- represents the complement of .
- and are the distinguished Boolean elements.
When there is no possibility of confusion, the multiplication symbol may be omitted:
Fundamental Laws of Boolean Algebra
Boolean algebra is governed by a collection of fundamental laws.
Commutative Laws
The order of the operands does not affect the result.
For OR:
For AND:
Distributive Laws
Boolean algebra has two distributive laws.
AND distributes over OR:
OR also distributes over AND:
This second distributive law is one of the important differences between Boolean algebra and ordinary algebra.
Identity Laws
For OR:
For AND:
Thus, is the identity element for OR, while is the identity element for AND.
Complement Laws
Every Boolean element has a complement such that
and
For the two Boolean constants,
and
Basic Theorems of Boolean Algebra
Several useful results follow from the fundamental laws.
Idempotent Laws
Repeating the same variable does not change the result.
and
For example,
and
Boundedness Laws
OR with always gives :
AND with always gives :
Absorption Laws
The absorption laws are
and
For example,
because once is true, the value of does not affect the OR expression.
Associative Laws
The grouping of variables does not affect the result.
For OR:
For AND:
Therefore, expressions such as
and
can usually be written without parentheses.
Uniqueness of Complement
The complement of an element is unique.
If an element satisfies
and
then
Therefore, every element of a Boolean algebra has exactly one complement.
Involution Law
Taking the complement twice returns the original element:
For example,
because
and
Complement of the Constants
The Boolean constants are complements of each other:
De Morgan's Laws
The complement of an OR expression is the AND of the complements:
The complement of an AND expression is the OR of the complements:
These laws are among the most important tools for simplifying Boolean expressions.
Summary of Important Boolean Laws
| Law | OR Form | AND Form |
|---|---|---|
| Identity | ||
| Boundedness | ||
| Idempotent | ||
| Complement | ||
| Commutative | ||
| Associative | ||
| Distributive | ||
| Absorption | ||
| De Morgan |
Also,
Algebraic Verification of Some Boolean Laws
Boolean identities can be proved either algebraically using previously established laws or by constructing truth tables.
Proof of the Idempotent Law
We want to prove
Using the identity and complement laws,
can be written as
Since
we obtain
Using distributivity,
Since
this becomes
Using absorption,
Hence,
Similarly,
Proof of the Boundedness Law
Consider
Since
we have
Using associativity and idempotence,
Therefore,
Hence,
The dual result is
Proof of an Absorption Law
Consider
Using the distributive law,
Since
we get
Therefore,
Its dual is
Some Distinctive Features of Boolean Algebra
Boolean algebra differs from ordinary arithmetic algebra in several important ways.
In the commonly used two-element Boolean algebra,
all variables take only the values or .
However, Boolean algebras can contain more than two elements. The two-element algebra is simply the most important one for logic and digital circuits.
Boolean algebra also has no direct equivalent of ordinary subtraction or division.
Another characteristic operation is complementation:
which has no direct counterpart among the standard arithmetic operations.
Boolean Subalgebra
Suppose
is a Boolean algebra.
A non-empty subset is called a Boolean subalgebra if itself forms a Boolean algebra under the same Boolean operations.
In particular, the subset must be closed under the required operations.
If
then the appropriate results such as
and
must also belong to .
Example Using the Divisors of 30
Consider
the set of positive divisors of .
Define
and
Under these operations, forms a Boolean algebra.
Here the Boolean zero is the number , because
while the Boolean one is , because
Consider the subset
The complements are
and
The subset is also closed under the corresponding and operations. Therefore it forms a Boolean subalgebra of .
Basic Boolean Operations
The three basic operations of Boolean algebra are:
- logical addition,
- logical multiplication,
- complementation.
They correspond to
In digital logic, and can be interpreted in several equivalent ways.
| Logic 0 | Logic 1 |
|---|---|
| False | True |
| Off | On |
| Low | High |
| Open | Closed |
| No | Yes |
The exact physical interpretation depends on the system being considered.
Logical Addition: OR Operation
Logical addition is represented by
and corresponds to the OR operation.
Its basic rules are
If
then is true whenever at least one of or is true.
Truth Table of OR
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Therefore,
is read as
A OR B.
Notice that Boolean addition is different from ordinary arithmetic addition because
in Boolean algebra.
Logical Multiplication: AND Operation
Logical multiplication corresponds to the AND operation.
It may be written as
or simply
The operation is defined by
If
then is only when both and are .
Truth Table of AND
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Thus,
is read as
A AND B.
Complementation: NOT Operation
Complementation reverses the Boolean value of a variable.
If
then
If
then
Therefore,
and
The expression
is read as
NOT A.
Truth Table of NOT
| 0 | 1 |
| 1 | 0 |
Principle of Duality
One of the most useful properties of Boolean algebra is the principle of duality.
The dual of a Boolean expression is obtained by simultaneously replacing
and
Variables and their complements remain unchanged.
For example, consider
Replacing OR with AND and with gives
Thus these two identity laws are duals of one another.
Similarly,
has the dual
Another example is
Its dual is
The principle of duality means that when a Boolean identity follows from the Boolean algebra axioms, its dual identity also follows.
Example of Forming a Dual
Suppose
To obtain the dual, interchange
and
Therefore,
The variables themselves remain unchanged.
De Morgan's Theorems
De Morgan's theorems describe how complementation interacts with OR and AND.
They are
and
In words:
- the complement of an OR becomes the AND of the complements;
- the complement of an AND becomes the OR of the complements.
Verification Using a Truth Table
| 0 | 0 | 1 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 1 | 0 | 0 |
The final two columns are identical. Therefore,
Similarly:
| 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 |
Therefore,
De Morgan's Theorem for More Than Two Variables
De Morgan's laws can be extended to any number of Boolean variables.
For example,
Let
Then
Using De Morgan's theorem,
Since
we obtain
Therefore,
Similarly,
Applying De Morgan's Theorem to Expressions
The variables in De Morgan's theorem may themselves be compound Boolean expressions.
Consider
Using De Morgan's theorem,
Now,
Using the involution law,
Therefore,
Hence,
Distributing gives
A General Rule for Complementing Boolean Expressions
To complement a Boolean expression, perform the following transformations simultaneously:
- replace with ,
- replace with ,
- replace with ,
- replace with ,
- replace every variable with its complement.
This provides a systematic way of applying De Morgan's theorem to larger expressions.
Logic Gates
Boolean operations can be implemented electronically using logic gates.
A logic gate is a digital circuit that accepts one or more input signals and produces an output signal according to a Boolean operation.
The main gates considered here are:
- OR
- AND
- NOT
- NAND
- NOR
- XOR
- XNOR
Each input and output normally has one of two logical values:
OR Gate
An OR gate performs Boolean addition.
For two inputs and ,
The output is when at least one input is .
An OR gate symbolically represented as
Loading image…
Two-Input OR Truth Table
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
The OR operation can also be extended to more than two inputs.
For three inputs,
Loading image…
Three-Input OR Truth Table
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
AND Gate
An AND gate performs Boolean multiplication.
For two inputs,
Loading image…
The output is only when both inputs are .
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
The same principle applies to an AND gate containing more than two inputs.
For example,
is only when
NOT Gate
A NOT gate has only one input and one output.
It is also called an inverter because its output is the opposite of its input.
It is symbolically represented as
Loading image…
| 0 | 1 |
| 1 | 0 |
NAND Gate
A NAND gate is an AND operation followed by complementation.
Therefore,
Using De Morgan's theorem,
It is symbolically represented as
Loading image…
Its truth table is
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Thus, a NAND gate produces only when both inputs are .
NOR Gate
A NOR gate is an OR operation followed by complementation.
Therefore,
Using De Morgan's theorem,
It is symbolically represented as
Loading image…
Its truth table is
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
A NOR gate therefore produces only when both inputs are .
Exclusive OR: XOR Gate
The ordinary OR operation is sometimes called inclusive OR, because it produces even when both inputs are .
The Exclusive OR, or XOR, behaves differently.
It produces when the two inputs are different.
The XOR operation is represented by
Thus,
Its Boolean expression is
It is symbolically represented as
Loading image…
XOR Truth Table
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Thus, XOR produces when exactly one of the two inputs is .
Exclusive NOR: XNOR Gate
An XNOR gate is the complement of an XOR gate.
Therefore,
Its Boolean expression is
The output is when both input values are equal.
It is symbolically represented as
Loading image…
XNOR Truth Table
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Thus,
can also be written as
or
Logic Gates at a Glance
| Gate | Boolean Expression | Output Condition |
|---|---|---|
| AND | when both inputs are | |
| OR | when at least one input is | |
| NOT | Complement of the input | |
| NAND | Complement of AND | |
| NOR | Complement of OR | |
| XOR | when inputs are different | |
| XNOR | when inputs are equal |
Combined Truth Table of Two-Input Gates
The behavior of the major two-input gates can be compared directly.
| AND | OR | NAND | NOR | XOR | XNOR | ||
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
The NOT gate is not included in this table because it has only one input.
Its truth table is simply
| NOT | |
|---|---|
| 0 | 1 |
| 1 | 0 |
Interconnecting Logic Gates
Logic gates can be connected together to form larger logic networks or gating networks.
The Boolean expression corresponding to a circuit can be determined by moving systematically from the inputs toward the final output.
Consider an intermediate output
and another operation
Substituting the expression for gives
Thus, the Boolean expression for a network can be built one gate at a time.
Several gates may also use the same input. In a circuit diagram, this can be represented by branching the input line so that the same signal is supplied to multiple gates.
Few examples of interconnected gates
Loading image…
Final Summary
Boolean algebra provides an algebraic framework for working with logical quantities.
Its three fundamental operations are
represented respectively by
Important Boolean laws include the identity, complement, idempotent, boundedness, absorption, associative, distributive, involution, and De Morgan laws.
The principle of duality allows one valid Boolean identity to generate another by interchanging
and
De Morgan's theorems,
and
provide a systematic method for complementing Boolean expressions.
Finally, Boolean operations are implemented physically using logic gates such as AND, OR, NOT, NAND, NOR, XOR, and XNOR. By interconnecting these gates, increasingly complex Boolean expressions and logic networks can be constructed.
What did you think?
Follow the idea
Keep reading
K-Map Simplification — Part 1
Free · 15 min read
Algebra of Propositions and Logical Equivalences
Free · 20 min read
K-Map Simplification — Part 2
Premium · 20 min read
Continue the conversation
Share a question, an insight, or a different perspective.
Discussion loads when you reach this section.