1
CHAPTER 13 - BOOLEAN ALGEBRA
In 1854, George Boole developed Boolean algebra.
Combination of Boolean variables/constants with logical operators is called as Boolean algebra.
Since Boolean algebra deals with binary values, we also call it as switching algebra.
Binary decision
The decision which results in either ‘yes’ or ‘no’ is called Binary addition
Algebraic Expressions
Variables combined with the help of mathematical operators like +, -, *, / form algebraic
expressions.
Logical statements
Statements that are determined to be true or false are called logical statements.
Statements that are combined with the help of logical operators like AND, OR and NOT is also
called a logical statement or logical functions.
Logical statements are also called as truth functions
True or false values are called truth values.
Logical operators are used to combine logical variables or logical constants.
Combination of logical variables, constants and operators is called a logical expression.
Ex: X AND Y OR Z
Truth Table
Truth table is a table with all possible combinations of input values along with its results.
In truth table, 1 denotes TRUE and 0 denotes FALSE.
Tautology
If the result of any logical statement or expression is always true or 1, it is called tautology.
Fallacy
If the result of any logical statement or expression is always false or 0, it is called fallacy.
Logical operators
NOT
OR
AND
NOT operator
This operator operates on a single variable. So it is a unary operation.
Operation performed by NOT is called complementation.
Symbol used is bar [ x = complement of x]
Complement of 0 is 1 [0 =1]
Complement of 1 is 0 [ 1 = 0 ]
Truth table of NOT is
X X
0 1
1 0
Venn diagram of X is,
X X
OR OPERATOR
This operator denotes logic addition
Symbol used is +
For ‘n’ input variables, there will be 2n possible combinations of inputs.
If any one input is true, then the output of OR operation will be true.
2
Truth table is,
X Y X+Y
0 0 0
0 1 1
1 0 1
1 1 1
Venn diagram of X+Y is,
AND Operation
This operator denotes logical multiplication
Symbol used is dot (.)
If any one input is false, output will be false.
Truth table is
X Y X.Y
0 0 0
0 1 0
1 0 0
1 1 1
Venn diagram of X.Y is,
Boolean expression
Logical variables + logical operator = Boolean expression
Ex: X+Y.Z+Y
Boolean expression can be evaluated using truth tables
Precedence order for evaluating Boolean expression is
NOT
AND
OR
If there is parenthesis, the expression in parenthesis is evaluated first.
Ex-1: X + YZ
X Y Z Z Y.Z X+YZ
0 0 0 1 0 0
0 0 1 0 0 0
0 1 0 1 1 1
0 1 1 0 0 0
1 0 0 1 0 1
1 0 1 0 0 1
1 1 0 1 1 1
1 1 1 0 0 1
3
EX-2: Evaluate X(Y+Z)+XY using truth table
X Y Z Y Z Y+Z X(Y+Z) XY X(Y+Z)+ XY
0 0 0 1 1 1 0 0 0
0 0 1 1 0 1 0 0 0
0 1 0 0 1 1 0 0 0
0 1 1 0 0 0 0 0 0
1 0 0 1 1 1 1 1 1
1 0 1 1 0 1 1 1 1
1 1 0 0 1 1 1 0 1
1 1 1 0 0 1 1 0 1
Logic Gate
Logic gate is an electronic circuit that operates on one or more input signals to produce an output
signal.
Gates are 2-state digital circuits because the input and output signals are either low or high voltage.
There are 3 types of logic gates
NOT gate
OR gate
AND gate
NOT Gate
It’s a gate with only 1input signal and one output signal
Output state is always opposite to the input state. So we also call NOT gate as an inverter
Truth table of NOT gate is,
X X
True False
False True
Symbol of NOT gate is,
OR Gate
It’s a gate with 2 or more input signals & only 1 output signal.
If any of the input signals are high, then the output signal is high.
If all inputs are low, only then the output is low.
Truth Table is
X Y X+Y
0 0 0
0 1 1
1 0 1
1 1 1
(2 Inputs)
X Y Z X+Y+Z
False False False False
False False True True
False True False True
False True True True
True False False True
True False True True
True True False True
True True True True
(3 Inputs)
4
Symbol of OR gate is
=A+B
AND Gate
It’s a gate with 2 or more inputs and only 1 output.
Only when all the inputs are high, output will be high.
If any one input is low, then the output will be low.
Truth Table is
X Y X.Y
0 0 0
0 1 0
1 0 0
1 1 1
(2 Inputs)
X Y Z X.Y.Z
False False False False
False False True False
False True False False
False True True False
True False False False
True False True False
True True False False
True True True True
(3 Inputs)
Symbol of AND gate is
=A.B
POSTULATES of Boolean Algebra
The fundamental laws of Boolean algebra are known as the basic postulates of Boolean algebra
Postulates are,
1. If x ≠ 0, x = 1 & if x ≠ 1, x = 0
2. OR relations (Logical Addition)
0+0=0
0+1=1
1+0=1
1+1=1
3. AND Relations (Logical Multiplication)
0.0=0
0.1=0
1.0=0
1.1=1
4. Complement Rules
0=1
1=0
Principal of duality
A Boolean relation can be derived from another Boolean relation by,
Changing each OR sign to AND
Changing each AND sign to OR
Replacing each 0 by 1 and 1 by 0
The relation that is derived using duality principal is called dual of original expression
Ex: Derive a relation from 0+1=1 using duality principal
5
Ans: 0 + 1 = 1
1.0=0
Basic theorems of Boolean algebra
Boolean postulates are used for defining Boolean algebra theorems
Boolean algebra theorems are used for manipulating Boolean expressions
1. Properties of 0 & 1
a) 0+X=X
Proof using Truth Table
0 X Result
0 0 0
0 1 1
b) 1+X=1
Proof using Truth Table
1 X Result
1 0 1
1 1 1
It’s a tautology
c) 0.X=0
Proof using Truth Table
0 X Result
0 0 0 It’s a fallacy
0 1 0
d) 1.X=X
Proof using Truth Table
1 X Result
1 0 1
1 1 1
2. Indempotence Law
a) X+X=X
Proof using Truth Table
X X Result 0+0=0
0 0 0 1+1=1 As per postulate II
1 1 1 So X+X=X
b) X.X=X
Proof using Truth Table
X X Result 0.0=0
0 0 0 1.1=1 As per postulate III
1 1 1 So X.X=X
3. Involution
X =X
X X X
0 1 0
1 0 1
This is also known as double inversion rule
6
4. Complementarity law
a) X+X =1
Proof using Truth Table
X X Result
0 1 1 0+1=1
1 0 1 1+0=1 As per postulate II
It’s a tautology
b) X.X=0
0.1=0
X X Result =0 As per postulate III
0 1 0
1 0 0
It’s a fallacy
5. Commutative Law
a) X+Y =Y+X
X Y X+Y Y+X
0 0 0 0
0 1 1 1
1 0 1 1
1 1 1 1
b) X.Y=Y.X
X Y X.Y Y.X
0 0 0 0
0 1 0 0
1 0 0 0
1 1 1 1
6. Associative Law
a) X+(Y+Z) = (X+Y) + Z
X Y Z Y+Z X+(Y+Z) X+Y (X+Y)+Z
0 0 0 0 0 0 0
0 0 1 1 1 0 1
0 1 0 1 1 1 1
0 1 1 1 1 1 1
1 0 0 0 1 1 1
1 0 1 1 1 1 1
1 1 0 1 1 1 1
1 1 1 1 1 1 1
7
b) X(YZ)=(XY)Z
Proof same as above
7. Distributive Law
a) X(Y+Z)=XY+XZ
Proof Using TRUTH TABLE
b) X+YZ=(X+Y)(X+Z)
Algebraic Proof
R.H.S = (X+Y)(X+Z)
=XX+XZ+XY+YZ
=X+XZ+XY+YZ [As X.X=X]
=X(1+Z)+XY+YZ
=X.1+XY+YZ [As 1+Z=1]
=X+XY+YZ[As X.1=X]
=X(1+Y)+YZ
=X.1+YZ [1+Y=1]
=X+YZ [As X.1=X]
=L.H.S
Truth table can also be used for proving
8. Absorption Law
a) X+XY=X
Algebraic Proof is,
L.H.S=X+XY
=X(1+Y)
=X.1 [As 1+y=1]
=X [As X.1=X]
=R.H.S
Truth Table Proof
X Y XY X+XY
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
b) X(X+Y)=X
Algebraic Proof is,
L.H.S=X(X+Y)
=XX+XY
8
=X+XY [As X.X=X]
=X(1+Y)
=X.1 [As 1+Y=1]
=X [As X.1=X]
=R.H.S
9. X+XY = X+Y - Third Distributive Law
Algebraic Proof is,
L.H.S= X+XY
=X.1+XY [As X=X.1]
=X(1+Y)+XY [As 1=1+Y]
= X+XY+XY
=X+Y.1 [AS X+X=1]
=X+Y [AS Y.1=Y]
= R.H.S
Demorgan’s Theorem
It is derived by Augustus DeMorgan
DeMorgan’s First Theorem
X+Y = X Y
It states that the complement of the sum of two variables is equal to the product of the complement of
individual variables.
Proof
To prove this we need the complementarity laws X+X = 1 & X.X=0
Suppose P=X+Y, then according to complementarity laws
P+P=1 & P.P=0
So we need to prove P+P=1 & P.P=0
P=X+Y
So P = X.Y
To prove the first part i.e P+P=1
(X+Y) + ( X.Y)
=((X+Y)+X)((X+Y)+Y)
= (X+X+Y) (X+Y+Y)
=(1+Y)(X+1) [As X+X=1 & Y+Y=1]
1
To prove the second part i.e. P.P=0
(X+Y). (X.Y)
= XXY + XYY
0+0=0
Therefore demorgans first theorem is proved
DeMorgan’s Second Theorem
X.Y = X+Y
9
Proof Suppose
P=X.Y, then P= X.Y=X+Y Here also
we need to prove P+P=1 & P.P=0
P+P=1
(X.Y) + (X+Y)
= (X+Y)+ (X.Y)
= (X+Y+X)(X+Y+Y) [As X+YZ=(X+Y)(X+Z)]
=(1+Y)(X+1)
= 1.1=1
P.P = 0
(X.Y)(X+Y)
=X.Y.X + X.Y.Y = 0.0=0
Therefore DeMorgans second theorem is proved.
Minterm
A minterm is the product of all variables in the logic system with or without bar.
Ex: If X & Y are the variables in the logic system, then XY+XY is the sum of products of all the
variables within the system. Since each term contains the product of all variables with or without
bar, each term is considered as the minterm
Here 0 denotes bar Minterm
If X=0 and Y=1, then the minterm will be XY Is product of all variables
Minterm expansion of expression 0 denotes bar
Steps are,
Convert the given expression into sum of products form
In each term multiply missing term + missing term
Expand the expression
Remove all duplicate terms
Ex: convert X + Y to minterms
X.(Y+Y) + Y.(X+X)
XY+XY+XY+XY
XY+ XY+XY
Shorthand notation
Minterm is denoted using ‘m’
Write the binary equivalent of each minterm (0 denotes bar & 1 denotes variable without bar)
Write the decimal equivalent of each binary as the subscript of ‘m’.
Ex: Shorthand notation of XYZ+XYZ+XYZ is
F(X, Y, Z)= m7 + m5 + m1
OR
F(X, Y, Z)= ∑(7, 5, 1)
Maxterm
A Maxterm is the sum of all the variables within the logic system with or without bar.
Ex: If X, Y & Z are the variables in the logic system, then (X+Y+Z)(X+Y+Z) is the product of the
sum of all the variables within the system. Since each term contains the sum of all variables with
or without bar, each term is considered as the Maxterm
Here 1 denotes bar Maxterm
Is the sum of all variables
If X=0 and Y=1, then the maxterm will be X+Y
1 denotes bar
10
Shorthand notation
Maxterm is denoted using ‘M’
Write the binary equivalent of each maxterm (1denotes bar & 0 denotes variable without bar)
Write the decimal equivalent of each binary as the subscript of ‘M’.
Ex: Shorthand notation of (X+Y+Z)(X+Y+Z)(X+Y+Z) is
F(X, Y, Z)= M0.M2.M1 OR F(X, Y, Z)= π(0.2.1.)
Canonical expression
A Boolean expression composed entirely either of minterms or of maxterms is referred to as
canonical expression.
Canonical expression can be represented in two forms
1. S.O.P form
2. P.O.S form
Canonical S.O.P Form
A Boolean expression represented completely as the sum of minterms is said to be in canonical
sum of products form.
Example 1
A logical network has two inputs X & Y and an output Z. the relationship between inputs and output is as
follows
When X=0 and Y=0, Z=1
When X=0 and Y=1, Z=0
When X=1 and Y=0, Z=1
When X=1 and Y=1, Z=1
Express this in canonical sum of products form
Answer:
Draw the truth table with inputs and outputs and add a column for minterms
X Y Z Minterm
0 0 1 XY
0 1 0 XY
1 0 1 XY
1 1 1 XY
Add all the minterms with output 1
XY+XY+XY
Example 2
Convert the following three input function F denoted by the expression F=∑(0, 1, 2, 5) into its canonical
sum of products form
Answer
X Y Z Output Minterm
0 0 0 1 XYZ
0 0 1 1 XYZ
0 1 0 1 XYZ
0 1 1 0 XYZ
1 0 0 0 XYZ
11
1 0 1 1 XYZ
1 1 0 0 XYZ
1 1 1 0 XYZ
X Y Z+X Y Z+X Y Z+X Y Z
Canonical P.O.S Form
A Boolean expression represented completely as the product of maxterms is said to be in canonical
product of sums form.
There are two methods for transforming a Boolean expression into canonical product of sums form
1. Truth Table method
2. Algebraic method
Truth table method
Prepare a truth table of inputs and outputs
Add a column for maxterms
Multiply the maxterms with output 0
Example 1
Consider the truth table given below and express the Boolean function in product of sums form.
X Y Z Output
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1
Answer
Add a new column for maxterms
X Y Z Output Maxterms
0 0 0 1 X+Y+Z
0 0 1 0 X+Y+Z
0 1 0 1 X+Y+Z
0 1 1 0 X+Y+Z
1 0 0 1 X+Y+Z
1 0 1 0 X+Y+Z
1 1 0 1 X+Y+Z
1 1 1 1 X+Y+Z
Multiply the maxterms with output 0
(X+Y+Z) (X+Y+Z) (X+Y+Z)
12
Algebraic method
1. Simplify the expression using Boolean theorems
2. Convert into P.O.S form using X+YZ=(X+Y)(X+Z)
3. In each sum term add missing variable . missing variable
4. Keep on expanding using X+YZ=(X+Y)(X+Z) to get maxterms
5. Remove all duplicate terms
Example
Express XY+Y(Z(Z+Y)) into canonical P.O.S form
Refer the following example from textbook 13.15
Sum term Vs Maxterm
Sum term just means sum of the variables. It’s not necessary that all the variables must be included
in a sum term. But maxterm is the sum term with all the variables
Product term Vs minterm
Product term just means the product of the variables. It’s not necessary that all the variables must
be included in a product term. But minterm is the product of all the variables
Canonical SOP Vs SOP expression
SOP expression is the one with sum of products and is not necessary that the products are
minterms. But in a canonical SOP expression each product term will be a minterm
Canonical POS Vs POS expression
POS expression is the one with product of sums and is not necessary that the sums are maxterms.
But in a canonical POS expression each sum term will be a maxterm
Minimizing Boolean expression
There are two methods
1. Algebraic method
2. K-Map method
Algebraic method
Refer the following examples from textbook 13.17, 13.18, 13.19 and 13.20
K-Map method
It stands for Karnaugh Map
It is also called Veitch diagrams
K-Map is a rectangle made up of certain number of squares, each square representing a maxterm or
minterm.
For ‘n’ variables, 2n squares will be there in K-Map
Binary numbers in K-Map differ only by one place. It is done so that only one variable changes its
state. So circuit designing becomes easy.
The binary code in which each successive number differs only in one place is called gray code
Sum Of Products reduction using K-Map
Two variable K-Map
13
Three variable K-Map
Four variable K-Map
Reduction using K-Map
Steps are,
Prepare the truth table for the given function
Draw an empty K-Map for the function
Enter 1’s in the corresponding squares for the output 1’s in the truth table
Enter 0’s in all the left out squares
Group adjacent 1’s in form of octets, quads and pairs
Write the reduced expression for all the groups and + them
Rules
Groups may not include any cell containing a zero
Groups may be horizontal or vertical, but not diagonal.
Groups must contain 1, 2, 4, 8, or in general 2n cells.
Groups should be as large as possible.
Every 1 must be in at least one group.
Overlapping allowed.
Wrap around allowed.
Fewest numbers of groups possible.
Grouping
Pairs
It’s a group of 2 one’s that are horizontally or vertically adjacent.
Pair eliminates a variable and its complement.
14
Quad
It’s a group of 4 one's that are horizontally or vertically adjacent.
A quad eliminates two variables and their complements.
X=AC
Octet
It’s a group of 8 one's that are horizontally or vertically adjacent.
An octet eliminates three variables and their complements.
15
Map Rolling: Map rolling means rolling the map as if its left edges are touching the right edges and top
edges are touching bottom edges.
Overlapping Groups: Overlapping means same 1 can be encircled more than once. Overlapping always
leads to simpler expressions.
Redundant Group: It is a group whose all 1's are overlapped by other groups. Redundant groups must be
removed. Removal of redundant group leads to much simpler expression.
Few examples of grouping
Ex_1:
Ex_2: Ex_3:
16
Ex_4: Ex_5:
Ex_6: Ex_7:
Ex_8:
Product Of Sums reduction using K-Map
2 variable K-Map using Maxterms
A+B A+B’
A’+B A’+B’
17
3 variable K-Map using maxterms
4 variable K-Map using maxterms
Steps are,
Prepare the truth table for the given function
Draw an empty K-Map for the function
Enter 0’s in the corresponding squares for the output 0’s in the truth table
Enter 1’s in all the left out squares
Group adjacent 0’s in form of octets, quads and pairs
Write the reduced expression for all the groups and multiply them
More about gates
NOR
NAND
XOR
XNOR
NOR Gate
It’s a gate with 2 or more input signals and one output signal
It’s an inverted OR gate. That is NOR gate is a combination OR gate followed by an inverter
18
NAND Gate
It’s a gate with 2 or more input signals and one output signal
It’s an inverted AND gate. That is NAND gate is a combination AND gate followed by an inverter
XOR Gate
It stands for Exclusive OR gate
It’s a gate with 2 or more input signals and one output signal
Here odd number of input1’s produce output 1
XNOR Gate
It stands for Exclusive NOR gate
It’s an inverted XOR gate
Ic
Universal gates
NAND and NOR gates are the universal gates as any other gate can be made using NAND and
NOR.
NAND TO NAND Logic
NOT using NAND
A NAND A = A.A = A
19
AND using NAND
A NAND B = A B = A + B
(A + B) NAND (A + B) = (A+B). (A+B) = (A.B) + (A.B) = A.B
OR using NAND
(A NAND A) NAND (B NAND B)
= A.A NAND B.B
= A NAND B = A . B = A + B
NOR TO NOR Logic
NOT using NOR gate
A NOR A = A+A = A
OR using NOR gate
A NOR B = A+B
A+B NOR A+B = A+B + A+B = A+B = A+B
AND using NOR gate
(A NOR A) NOR (B NOR B)
= A+A NOR B+B
= A NOR B = A + B = A.B
20
Designing circuits using NAND gate
Derive simplified sum of products expression
Draw a circuit diagram using AND, OR, NOT gates
Replace all basic gates with NAND gates
Refer the examples 13.30, 31, 32, 33 & 34 in page 683, 684, 685
Simplification using K-MAP – Solved Examples
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36