All articles
Discrete MathematicsOpen to everyone

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

0and10 \quad \text{and} \quad 1

where

  • 00 represents False
  • 11 represents True

The symbols ++ and ⋅\cdot 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 BB equipped with two binary operations ++ and ⋅\cdot, a unary operation ′', and two distinct elements 00 and 11 is called a Boolean algebra if the required Boolean algebra laws are satisfied.

It is written as

(B,+,⋅,′,0,1)(B,+,\cdot,',0,1)

For elements a,b,c∈Ba,b,c\in B:

  • a+ba+b represents the OR operation.
  • a⋅ba\cdot b represents the AND operation.
  • a′a' represents the complement of aa.
  • 00 and 11 are the distinguished Boolean elements.

When there is no possibility of confusion, the multiplication symbol may be omitted:

a⋅b=aba\cdot b = ab

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:

a+b=b+aa+b=b+a

For AND:

ab=baab=ba

Distributive Laws

Boolean algebra has two distributive laws.

AND distributes over OR:

a(b+c)=ab+aca(b+c)=ab+ac

OR also distributes over AND:

a+bc=(a+b)(a+c)a+bc=(a+b)(a+c)

This second distributive law is one of the important differences between Boolean algebra and ordinary algebra.


Identity Laws

For OR:

a+0=aa+0=a

For AND:

a⋅1=aa\cdot1=a

Thus, 00 is the identity element for OR, while 11 is the identity element for AND.


Complement Laws

Every Boolean element aa has a complement a′a' such that

a+a′=1a+a'=1

and

aa′=0aa'=0

For the two Boolean constants,

0′=10'=1

and

1′=01'=0

Basic Theorems of Boolean Algebra

Several useful results follow from the fundamental laws.

Idempotent Laws

Repeating the same variable does not change the result.

a+a=aa+a=a

and

aa=aaa=a

For example,

1+1=11+1=1

and

0⋅0=00\cdot0=0

Boundedness Laws

OR with 11 always gives 11:

a+1=1a+1=1

AND with 00 always gives 00:

a⋅0=0a\cdot0=0

Absorption Laws

The absorption laws are

a+ab=aa+ab=a

and

a(a+b)=aa(a+b)=a

For example,

x+xy=xx+xy=x

because once xx is true, the value of yy does not affect the OR expression.


Associative Laws

The grouping of variables does not affect the result.

For OR:

(a+b)+c=a+(b+c)(a+b)+c=a+(b+c)

For AND:

(ab)c=a(bc)(ab)c=a(bc)

Therefore, expressions such as

a+b+ca+b+c

and

abcabc

can usually be written without parentheses.


Uniqueness of Complement

The complement of an element is unique.

If an element xx satisfies

a+x=1a+x=1

and

ax=0,ax=0,

then

x=a′x=a'

Therefore, every element of a Boolean algebra has exactly one complement.


Involution Law

Taking the complement twice returns the original element:

(a′)′=a(a')'=a

For example,

(0′)′=0(0')'=0

because

0′=10'=1

and

1′=0.1'=0.

Complement of the Constants

The Boolean constants are complements of each other:

0′=10'=1 1′=01'=0

De Morgan's Laws

The complement of an OR expression is the AND of the complements:

(a+b)′=a′b′(a+b)'=a'b'

The complement of an AND expression is the OR of the complements:

(ab)′=a′+b′(ab)'=a'+b'

These laws are among the most important tools for simplifying Boolean expressions.


Summary of Important Boolean Laws

LawOR FormAND Form
Identitya+0=aa+0=aa⋅1=aa\cdot1=a
Boundednessa+1=1a+1=1a⋅0=0a\cdot0=0
Idempotenta+a=aa+a=aaa=aaa=a
Complementa+a′=1a+a'=1aa′=0aa'=0
Commutativea+b=b+aa+b=b+aab=baab=ba
Associative(a+b)+c=a+(b+c)(a+b)+c=a+(b+c)(ab)c=a(bc)(ab)c=a(bc)
Distributivea+bc=(a+b)(a+c)a+bc=(a+b)(a+c)a(b+c)=ab+aca(b+c)=ab+ac
Absorptiona+ab=aa+ab=aa(a+b)=aa(a+b)=a
De Morgan(a+b)′=a′b′(a+b)'=a'b'(ab)′=a′+b′(ab)'=a'+b'

Also,

(a′)′=a.(a')'=a.

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

a+a=a.a+a=a.

Using the identity and complement laws,

a+aa+a

can be written as

a+a⋅1.a+a\cdot1.

Since

1=a+a′,1=a+a',

we obtain

a+a(a+a′).a+a(a+a').

Using distributivity,

a+aa+aa′.a+aa+aa'.

Since

aa′=0,aa'=0,

this becomes

a+aa.a+aa.

Using absorption,

a+aa=a.a+aa=a.

Hence,

a+a=a\boxed{a+a=a}

Similarly,

aa=a.\boxed{aa=a}.

Proof of the Boundedness Law

Consider

a+1.a+1.

Since

1=a+a′,1=a+a',

we have

a+1=a+(a+a′).a+1=a+(a+a').

Using associativity and idempotence,

a+a+a′=a+a′.a+a+a'=a+a'.

Therefore,

a+1=1.a+1=1.

Hence,

a+1=1\boxed{a+1=1}

The dual result is

a⋅0=0.\boxed{a\cdot0=0}.

Proof of an Absorption Law

Consider

a+ab.a+ab.

Using the distributive law,

a+ab=a(1+b).a+ab=a(1+b).

Since

1+b=1,1+b=1,

we get

a⋅1=a.a\cdot1=a.

Therefore,

a+ab=a.\boxed{a+ab=a}.

Its dual is

a(a+b)=a.\boxed{a(a+b)=a}.

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,

B={0,1},B=\{0,1\},

all variables take only the values 00 or 11.

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:

a′a'

which has no direct counterpart among the standard arithmetic operations.


Boolean Subalgebra

Suppose

(B,+,⋅,′,0,1)(B,+,\cdot,',0,1)

is a Boolean algebra.

A non-empty subset A⊆BA\subseteq B is called a Boolean subalgebra if AA itself forms a Boolean algebra under the same Boolean operations.

In particular, the subset must be closed under the required operations.

If

a,b∈A,a,b\in A,

then the appropriate results such as

a+b,a+b, ab,ab,

and

a′a'

must also belong to AA.


Example Using the Divisors of 30

Consider

D30={1,2,3,5,6,10,15,30},D_{30}=\{1,2,3,5,6,10,15,30\},

the set of positive divisors of 3030.

Define

a+b=lcm⁡(a,b),a+b=\operatorname{lcm}(a,b), ab=gcd⁡(a,b),ab=\gcd(a,b),

and

a′=30a.a'=\frac{30}{a}.

Under these operations, D30D_{30} forms a Boolean algebra.

Here the Boolean zero is the number 11, because

lcm⁡(a,1)=a,\operatorname{lcm}(a,1)=a,

while the Boolean one is 3030, because

gcd⁡(a,30)=a.\gcd(a,30)=a.

Consider the subset

A={1,5,6,30}.A=\{1,5,6,30\}.

The complements are

1′=30,1'=30, 5′=6,5'=6, 6′=5,6'=5,

and

30′=1.30'=1.

The subset is also closed under the corresponding gcd⁡\gcd and lcm⁡\operatorname{lcm} operations. Therefore it forms a Boolean subalgebra of D30D_{30}.


Basic Boolean Operations

The three basic operations of Boolean algebra are:

  • logical addition,
  • logical multiplication,
  • complementation.

They correspond to

OR,AND,NOT.\text{OR},\qquad \text{AND},\qquad \text{NOT}.

In digital logic, 00 and 11 can be interpreted in several equivalent ways.

Logic 0Logic 1
FalseTrue
OffOn
LowHigh
OpenClosed
NoYes

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

0+0=00+0=0 0+1=10+1=1 1+0=11+0=1 1+1=1.1+1=1.

If

C=A+B,C=A+B,

then CC is true whenever at least one of AA or BB is true.

Truth Table of OR

AABBC=A+BC=A+B
000
011
101
111

Therefore,

A+BA+B

is read as

A OR B.

Notice that Boolean addition is different from ordinary arithmetic addition because

1+1=11+1=1

in Boolean algebra.


Logical Multiplication: AND Operation

Logical multiplication corresponds to the AND operation.

It may be written as

A⋅BA\cdot B

or simply

AB.AB.

The operation is defined by

0⋅0=00\cdot0=0 0⋅1=00\cdot1=0 1⋅0=01\cdot0=0 1⋅1=1.1\cdot1=1.

If

C=AB,C=AB,

then CC is 11 only when both AA and BB are 11.

Truth Table of AND

AABBC=ABC=AB
000
010
100
111

Thus,

ABAB

is read as

A AND B.


Complementation: NOT Operation

Complementation reverses the Boolean value of a variable.

If

A=0,A=0,

then

A′=1.A'=1.

If

A=1,A=1,

then

A′=0.A'=0.

Therefore,

0′=10'=1

and

1′=0.1'=0.

The expression

A′A'

is read as

NOT A.

Truth Table of NOT

AAA′A'
01
10

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

+⟷⋅+\longleftrightarrow\cdot

and

0⟷1.0\longleftrightarrow1.

Variables and their complements remain unchanged.

For example, consider

a+0=a.a+0=a.

Replacing OR with AND and 00 with 11 gives

a⋅1=a.a\cdot1=a.

Thus these two identity laws are duals of one another.

Similarly,

a+1=1a+1=1

has the dual

a⋅0=0.a\cdot0=0.

Another example is

a+ab=a.a+ab=a.

Its dual is

a(a+b)=a.a(a+b)=a.

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

F=(a⋅1)(0+a′).F=(a\cdot1)(0+a').

To obtain the dual, interchange

⋅↔+\cdot\leftrightarrow+

and

0↔1.0\leftrightarrow1.

Therefore,

FD=(a+0)+(1⋅a′).F^D=(a+0)+(1\cdot a').

The variables themselves remain unchanged.


De Morgan's Theorems

De Morgan's theorems describe how complementation interacts with OR and AND.

They are

(x+y)′=x′y′(x+y)'=x'y'

and

(xy)′=x′+y′.(xy)'=x'+y'.

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

xxyyx′x'y′y'x+yx+y(x+y)′(x+y)'x′y′x'y'
0011011
0110100
1001100
1100100

The final two columns are identical. Therefore,

(x+y)′=x′y′\boxed{(x+y)'=x'y'}

Similarly:

xxyyxyxy(xy)′(xy)'x′+y′x'+y'
00011
01011
10011
11100

Therefore,

(xy)′=x′+y′.\boxed{(xy)'=x'+y'}.

De Morgan's Theorem for More Than Two Variables

De Morgan's laws can be extended to any number of Boolean variables.

For example,

(x+y+z)′.(x+y+z)'.

Let

A=x+y.A=x+y.

Then

(x+y+z)′=(A+z)′.(x+y+z)'=(A+z)'.

Using De Morgan's theorem,

(A+z)′=A′z′.(A+z)'=A'z'.

Since

A′=(x+y)′=x′y′,A'=(x+y)'=x'y',

we obtain

(x+y+z)′=x′y′z′.(x+y+z)'=x'y'z'.

Therefore,

(x+y+z)′=x′y′z′.\boxed{(x+y+z)'=x'y'z'}.

Similarly,

(xyz)′=x′+y′+z′.\boxed{(xyz)'=x'+y'+z'}.

Applying De Morgan's Theorem to Expressions

The variables in De Morgan's theorem may themselves be compound Boolean expressions.

Consider

(AB′+C)′.(AB'+C)'.

Using De Morgan's theorem,

(AB′+C)′=(AB′)′C′.(AB'+C)'=(AB')'C'.

Now,

(AB′)′=A′+(B′)′.(AB')'=A'+(B')'.

Using the involution law,

(B′)′=B.(B')'=B.

Therefore,

(AB′)′=A′+B.(AB')' = A'+B.

Hence,

(AB′+C)′=(A′+B)C′.(AB'+C)'=(A'+B)C'.

Distributing C′C' gives

A′C′+BC′.\boxed{A'C'+BC'}.

A General Rule for Complementing Boolean Expressions

To complement a Boolean expression, perform the following transformations simultaneously:

  • replace 00 with 11,
  • replace 11 with 00,
  • replace ++ with ⋅\cdot,
  • replace ⋅\cdot 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:

0or1.0\quad\text{or}\quad1.

OR Gate

An OR gate performs Boolean addition.

For two inputs AA and BB,

F=A+B.F=A+B.

The output is 11 when at least one input is 11.

An OR gate symbolically represented as

Loading image…

Two-Input OR Truth Table

AABBF=A+BF=A+B
000
011
101
111

The OR operation can also be extended to more than two inputs.

For three inputs,

F=A+B+C.F=A+B+C.

Loading image…

Three-Input OR Truth Table

AABBCCF=A+B+CF=A+B+C
0000
0011
0101
0111
1001
1011
1101
1111

AND Gate

An AND gate performs Boolean multiplication.

For two inputs,

F=AB.F=AB.

Loading image…

The output is 11 only when both inputs are 11.

AABBF=ABF=AB
000
010
100
111

The same principle applies to an AND gate containing more than two inputs.

For example,

F=ABCF=ABC

is 11 only when

A=B=C=1.A=B=C=1.

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.

F=A′F=A'

It is symbolically represented as

Loading image…

AAF=A′F=A'
01
10

NAND Gate

A NAND gate is an AND operation followed by complementation.

Therefore,

F=(AB)′.F=(AB)'.

Using De Morgan's theorem,

F=A′+B′.F=A'+B'.

It is symbolically represented as

Loading image…

Its truth table is

AABBF=(AB)′F=(AB)'
001
011
101
110

Thus, a NAND gate produces 00 only when both inputs are 11.


NOR Gate

A NOR gate is an OR operation followed by complementation.

Therefore,

F=(A+B)′.F=(A+B)'.

Using De Morgan's theorem,

F=A′B′.F=A'B'.

It is symbolically represented as

Loading image…

Its truth table is

AABBF=(A+B)′F=(A+B)'
001
010
100
110

A NOR gate therefore produces 11 only when both inputs are 00.


Exclusive OR: XOR Gate

The ordinary OR operation is sometimes called inclusive OR, because it produces 11 even when both inputs are 11.

The Exclusive OR, or XOR, behaves differently.

It produces 11 when the two inputs are different.

The XOR operation is represented by

⊕.\oplus.

Thus,

F=A⊕B.F=A\oplus B.

Its Boolean expression is

A⊕B=A′B+AB′.\boxed{A\oplus B=A'B+AB'}.

It is symbolically represented as

Loading image…

XOR Truth Table

AABBA⊕BA\oplus B
000
011
101
110

Thus, XOR produces 11 when exactly one of the two inputs is 11.


Exclusive NOR: XNOR Gate

An XNOR gate is the complement of an XOR gate.

Therefore,

F=(A⊕B)′.F=(A\oplus B)'.

Its Boolean expression is

F=AB+A′B′.\boxed{F=AB+A'B'}.

The output is 11 when both input values are equal.

It is symbolically represented as

Loading image…

XNOR Truth Table

AABBFF
001
010
100
111

Thus,

F=AB+A′B′F=AB+A'B'

can also be written as

F=AXNOR⁡BF=A\operatorname{XNOR}B

or

F=(A⊕B)′.F=(A\oplus B)'.

Logic Gates at a Glance

GateBoolean ExpressionOutput Condition
ANDF=ABF=AB11 when both inputs are 11
ORF=A+BF=A+B11 when at least one input is 11
NOTF=A′F=A'Complement of the input
NANDF=(AB)′F=(AB)'Complement of AND
NORF=(A+B)′F=(A+B)'Complement of OR
XORF=A′B+AB′F=A'B+AB'11 when inputs are different
XNORF=AB+A′B′F=AB+A'B'11 when inputs are equal

Combined Truth Table of Two-Input Gates

The behavior of the major two-input gates can be compared directly.

AABBANDORNANDNORXORXNOR
00001101
01011010
10011010
11110001

The NOT gate is not included in this table because it has only one input.

Its truth table is simply

AANOT AA
01
10

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

X=ABX=AB

and another operation

F=X+C.F=X+C.

Substituting the expression for XX gives

F=AB+C.F=AB+C.

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

OR,AND,NOT\boxed{\text{OR},\quad \text{AND},\quad \text{NOT}}

represented respectively by

+,⋅,′.+,\qquad \cdot,\qquad '.

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

+↔⋅+\leftrightarrow\cdot

and

0↔1.0\leftrightarrow1.

De Morgan's theorems,

(x+y)′=x′y′(x+y)'=x'y'

and

(xy)′=x′+y′,(xy)'=x'+y',

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?

boolean algebraBoolean LawsDe Morgan's LawsLogic Gates

Continue the conversation

Share a question, an insight, or a different perspective.

Discussion loads when you reach this section.

Follow the idea

Keep reading