0% found this document useful (0 votes)
14 views

Boolean

Boolean

Uploaded by

shreyas19052006
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Boolean

Boolean

Uploaded by

shreyas19052006
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

Boolean Algebra

Introduction to Boolean Algebra


In the previous course, we have seen that computers normally use binary
numbers. In this chapter, you will learn about an algebra that deals with the
binary number system. This algebra, known as Boolean algebra, is very useful
in designing logic circuits used by the processors of computer systems. In addition
to this, you will also learn about the elementary logic gates that are used to
build up circuits of different types to perform the necessary arithmetic operations.
These logic gates are the building blocks of all the circuits in a computer. Finally,
in this chapter, we will also learn how to use Boolean Algebra to design simple
logic circuits frequently used by the arithmetic logic unit of almost all computers.
Long ago Aristotle constructed a complete system of formal logic and wrote
six famous works on the subject, contributing greatly to the organization of
man’s reasoning. For centuries afterward, mathematicians kept on trying to
solve these logic problems using conventional algebra but only George Boole
could manipulate these symbols successfully to arrive at a solution with his own
mathematical system of logic. Boole’s revolutionary paper ‘An Investigation of
the laws of the thought’ was published in 1854 which led to the development of
new system, the algebra of logic, ‘BOOLEAN ALGEBRA’.
Boole’s work remained confined to papers only until 1938 when Claude
E. Shannon wrote a paper titled A Symbolic Analysis of Relay Switching Circuits.
In this paper he applied Boolean Algebra to solve relay problems. As logic problems
are binary decisions and Boolean Algebra effectively deals with these binary
values. Thus it is also called ‘Switching Algebra’.
Binary Valued Quantities - Variable and Constants
Everyday we have to make logic decisions. For example, consider the
following questions:
“Should I carry the book or not?”
“Should I use calculator or not?”
“should I miss TV programme or not?”
Each of these questions requires the answer YES or NO. These are the
only two possible answers.
Therefore, each of the above mentioned is a binary decision. Binary decision
making also applies to formal logic.
A variable used in an algebraic formula is generally assumed that the
variable may take any numerical value through the entire field of real numbers.
However a variable used in Boolean Algebra or Boolean equation can have only
one of two possible values. The two values are FALSE (or 0) and TRUE (or 1).
Thus, sentences which can be determined to be TRUE or FALSE are called logical
statements or truth functions and the results TRUE or FALSE are called truth
Boolean Algebra

values. The truth values are depicted by logical constants TRUE and FALSE or 1
and 0 respectively. 1 means TRUE and 0 means FALSE. The variables which can
store these truth values are called logical variables or binary valued variables as
these can store one of the two values 1 or 0 (TRUE or FALSE).
The decision which results into either YES (TRUE or 1) or NO (FALSE or 0)
is called a Binary Decision.
Also, if an equation describing logical circuitry has several variables, it is
still understood that each of the variables can assume only the values 0 and 1. For
instance, in the equation A + B = C , each of the variables A , B and C may have
only the values 0 or 1.

LOGICAL OPERATIONS
There are some specific operations that can be applied on truth functions.
Before learning about these operations, you must know about compound logical
functions and logical operations.

Logical Function or Compound Statement


Algebraic variables like a, b, c or x, y, z etc. are combined with the help of
mathematical operators like +, -, x, / to form algebraic expressions.
For example, 2 x A + 3 x B – 6 = (10 x Z) /2 x Y i.e., 2A + 3B – 6C = 10Z/2Y
Similarly, logic statements or truth functions are combined with the help of
Logical Operators like AND, OR and NOT to form a compound statement or logical
function.
These logical operators are also used to combine logical variables and logical
constants to form logical expressions.
For example, assuming that x, y and z are logical variables, the logical
expressions are
X NOT Y OR Z
Y AND X OR Z
Logical Operators
Truth Table is a table which represents all the possible values of logical
variables/statements along with all the possible results for the given combinations
of values.
Boolean Algebra

Before we start discussion about logical operators, let us first understand


what a Truth Table is ?. Logical statements can have only one of the two values
TRUE (YES or 1) or FALSE (NO or 1).
For example, if X and Y are the logical statements and R is the result,
then the truth table can be written as follows:
If result of any logical statement or expression
X Y R
is always TRUE or 1, it is called Tautology and if the
0 0 0 result is always FALSE or 0 it is called Fallacy.
0 1 0
1 0 0 1 represents TRUE value and 0 represents
1 1 1 FALSE value.
This is a truth table i.e., table of truth values of
Table 1.1 truth functions.
Now let us proceed with our discussion about logical operators. There are
three logical operators: NOT, OR and AND Operators.

NOT Operator
This operator operates on single variable and operation performed by NOT
operator is called complementation and the symbol we use for it is (bar). Thus
X means complement of X and YZ means complement of YZ. As we know, the
variables used in Boolean equations have a unique characteristic that they may
assume only one of two possible values 0 and 1, where 0 denotes FALSE and 1
denotes TRUE value. Thus the complement operation can be defined quite simply.
0=1 or NOT (FALSE) = TRUE and
1=0 or NOT (TRUE) = FALSE and
The truth table for the NOT operator is
X X Several other symbols like ‘~’ are also used for the
0 1 complementation symbol. If ~ is used then ~X is read as ‘negation
of X’ and if symbol ’ is used then X’ is read as complement of X.
1 0

Table 1.2 Truth Table for NOT operator

NOT operation is singular or unary operation as it operates


x x on single variable.
Venn diagram for x is given above where shaded area
depicts x.

Figure 1.3. Venn diagram for x


Boolean Algebra

OR operator
A second important operator in Boolean algebra is OR operator which
denotes operation called logical addition and the symbol we use for it is +. The
+ symbol, therefore, does not mean arithmetic addition, but is a logical addition
or logical OR symbol. Thus, X + Y can be read as X OR Y. For OR operation,
the possible input and output combinations are as follows :
0+0=1
0+1=1
1+0=1
1+1=1
The truth table of OR operator is given below:
X Y X+Y Note that when any one or both X and Y is 1, X + Y is 1.
0 0 0
0 1 1 and both X and Y is 0, X+Y is 0
1 0 1
1 1 1
Table 1.4 : Truth Table for OR operator

To avoid ambiguity, there are other symbols e.g.,  and  have been
recommended as replacements for the + sign. Computer people still use the + sign,
however, which was the symbol originally proposed by Boole.
Venn diagram for X + Y is given below where the shaded area depicts X + Y.

Shaded portion shows X + Y

Figure 1.2 : Venn diagram for X+Y

AND Operator
AND operator performs another important operation of Boolean Algebra
called logical multiplication and the symbol for AND operation is ‘.’ (dot). Thus
X.Y will be read as X AND Y. The rules for AND operation are :
0.0 = 0
0.1 = 0
1.0 = 0
1.1 = 1
Boolean Algebra

And the truth table for AND is as follows :


X Y X.Y
0 0 0 X Y
0 1 0
1 0 0
1 1 1

Table 1.10 : Truth Table for AND operator FIGURE 1.3 : Venn Diagram for (X.Y)

Note that only when both X and Y are 1’s, X.Y has the result 1. If any one
of X and Y is 0, XY result 0. Venn diagram for X.Y is given in the figure above where
the shaded area depicts X.Y
Evaluation of Boolean Expressions Using Truth Table
Logical variables are combined by means of logical operators AND, OR
and NOT to form a Boolean expression. For example, X+Y.Z+Z is a Boolean
expression.
It is often convenient to shorten X.Y.Z to XYZ and using this convention,
above expression can be written as X+YZ+Z
To study a Boolean expression, it is very useful to construct a table of values
for the variables and then to evaluate the expression for each of the possible
combinations of variables in turn. Consider the expression X+YZ. Here three
variables X, Y, Z are forming the expression. Each variable can assume the value
0 or 1. The possible combinations of values may be arranged in ascending order
as in Table 1.11

X Y Z Since X, Y, and Z are the three (3) variables in total. A truth


table involving 3 input variables will have 2 3 = 8 rows or
0 0 0 combinations in total. The left most column will have half of
0 0 1 total entries (4 entries) as zeroes and half as 1’s (in total 8).
0 1 0 The next column will have number of 0’s and 1’s halved than
0 1 1 first column completing 8 rows and so on. That is why, first
1 0 0 column has four 0’s and four 1’s, next column has two 0’s
1 0 1 followed by two 1’s completing 8 rows in total and the last
1 1 0 column has one 0 followed by one 1 completing 8 rows in
1 1 1 total.

Table 1.11 Possible Combinations of X, Y and Z


Boolean Algebra

So a column is added to list Y.Z (Table 1.12)


X Y Z Y.Z
0 0 0 0
0 0 1 0
0 1 0 0 AND operation is applied only on columns Y and Z.
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1

Table 1.12 Truth Table for (Y.Z)

One more column is now added to list the values of YZ (Table 1.13)
X Y Z Y.Z YZ
0 0 0 0 1
0 0 1 0 1
0 1 0 0 1 Note that YZ contains complemented values of YZ.
0 1 1 1 0
1 0 0 0 1
1 0 1 0 1
1 1 0 0 1
1 1 1 1 0

Table 1.13 truth table for Y Z and YZ

Now values of X are ORed (logical addition) to the values of YZ and the
resultant values are contained in the last column (Table 1.14).

X Y Z Y.Z YZ X+YZ
0 0 0 0 1 1 Now observe the expression X+YZ, after
0 0 1 0 1 1 ANDing Y and Z, the result has been
0 1 0 0 1 1 complemented and then ORed with X. Here
0 1 1 1 0 0 the result is 0 only when both the columns
1 0 0 0 1 1 X and YZ have 0, otherwise if there is 1 in
1 0 1 0 1 1 any of the two columns X and YZ , the result
1 1 0 0 1 1 is 1.
1 1 1 1 0 1

Table 1.14 Truth Table for X + YZ.


Boolean Algebra

A Boolean expression will be evaluated using precedence rules. The order of


evaluation of an expression is called as precedence. The precedence is, firstly
NOT, then AND and then OR. If there is parenthesis, then the expression in
parenthesis is evaluated first.

Example 1.13: In the Boolean algebra, verify using truth table that X+XY = X for
each X, Y in 0 and 1.
As the expression X+XY=X is a two variable expression, so we require
four possible combinations of values of X, Y. Truth Table will be as follows:
X Y XY X+XY
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1

Comparing the columns X+XY and X, we find, contents of both the columns
are identical, hence verified.
Example: In the Boolean Algebra, verify using truth table that
X+Y = X . Y in 0 and 1.
Solution: As it is a 2-variable expression, truth table will be as follows:
X Y X+Y X+Y X Y X.Y
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0

Comparing the columns X+Y and X . Y both the columns are identical, hence
verified.
Example: Prepare a table of combinations for the following Boolean algebra
expressions:
(a) X Y + X Y (b) XY Z + X Y Z (c) X Y Z + X Y
Boolean Algebra

Solution: (a) As X Y + XY is a 2-variable expression, its truth table is as


follows:

X Y X Y XY XY XY+XY
0 0 1 1 1 0 1
0 1 1 0 0 1 1
1 0 0 1 0 0 0
1 1 0 0 0 0 0

(b) Truth table for this 3 variable expression is as follows :

X Y Z X Y Z XYZ X YZ XYZ+XYZ
0 0 0 1 1 1 0 0 0
0 0 1 1 1 0 0 1 1
0 1 0 1 0 1 0 0 0
0 1 1 1 0 0 0 0 0
1 0 0 0 1 1 0 0 0
1 0 1 0 1 0 0 0 0
1 1 0 0 0 1 1 0 1
1 1 1 0 0 0 0 0 0

(a) Truth table for XYZ + XY is as follows:

X Y Z X Y Z XYZ XY XYZ+XY
0 0 0 1 1 1 0 0 0
0 0 1 1 1 0 0 0 0
0 1 0 1 0 1 1 0 1
0 1 1 1 0 0 0 0 0
1 0 0 0 1 1 0 1 1
1 0 1 0 1 0 0 1 1
1 1 0 0 0 1 0 0 0
1 1 1 0 0 0 0 0 0

Example:Prepare truth table for the following Boolean algebra


expressions:

(a) X(Y+Z) +X Y (b) XY (Z+YZ)+Z (c) A[(B+C)+C]


Boolean Algebra

Solution (a) Truth table for X(+) +X is as follows :

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 0 0 0 0

(b) Truth table for XY (Z+Y)+ is as follows:

X Y Z Y Z YZ Z+YZ XY XY(Z+YZ) XY(Z+YZ)+Z


0 0 0 1 1 0 0 0 0 1
0 0 1 1 0 0 1 0 0 0
0 1 0 0 1 1 1 0 0 1
0 1 1 0 0 0 1 0 0 0
1 0 0 1 1 0 0 1 0 1
1 0 1 1 0 0 1 1 1 1
1 1 0 0 1 1 1 0 0 1
1 1 1 0 0 0 1 0 0 0

(c) Truth table for A[(B+C)+C] is as follows :

A B C B C (B+C) (B+C)+C A[(B+C)+C]


0 0 0 1 1 1 1 0
0 0 1 1 0 1 1 0
0 1 0 0 1 0 1 0
0 1 1 0 0 1 1 0
1 0 0 1 1 1 1 1
1 0 1 1 0 1 1 1
1 1 0 0 1 0 1 1
1 1 1 0 0 1 1 1
Boolean Algebra

BASIC LOGIC GATES


After Shannon applied Boolean algebra in telephone switching circuits,
engineers realized that Boolean algebra could be applied to computer electronics
as well.
In the computers, these Boolean operations are performed by logic gates.

What is a Logic Gate?


Gates are digital (two-state) circuits because the input and output signals
are either low voltage (denotes 0) or high voltage (denotes 1). Gates are often
called logic circuits because they can be analyzed with Boolean algebra.

A Gate is simply an electronic circuit which operates on one or more input


signals to produce an output signal.

There are three types of logic gates:


 NOT gate or Inverter
 OR gate
 AND gate

Inverter (NOT Gate)


An inverter (NOT Gate) is a gate with only one input signal and one output
signal. The output state is always the opposite of the input state.
An inverter is also called a NOT gate because the output is not the same
as the input. The output is complement (opposite) of the input. Following tables
summarizes the operation:
X X X X
Low High 0 1
High Low 1 0

Table 1.15 Truth Table for NOT gate Table 1.16 Alternative truth table for NOT gate

A low input or 0 produces high output or 1 and vice versa. The symbol for inverter
is given in adjacent Fig. 1.4.
X X
Fig. 1.4. Not gate symbol
Boolean Algebra

NOT Gate is a gate or an electronic circuit that accepts only one input and
produces one output signal. The output state is always the complement of
the input state.

OR Gate
The OR Gate has two or more input signals, but only one output signal. This
gate gives the logical addition of the inputs. If any of the input signals or both is 1
(high), the output signal is 1 (high). The output will be low if all the inputs are low.
An OR gate can have as many inputs as desired. No matter how many
inputs are there, the action of OR gate is the same.
The OR gate has two or more input signals, but only one output signal. The
out will be the logical addition of the inputs.
Following tables show OR action
X Y F X Y Z F
0 0 0 0 0 0 0
0 1 1 0 0 1 1
1 0 1 0 1 0 1
1 1 1 0 1 1 1
1 0 0 1
Table : F=X+Y
1 0 1 1
1 1 0 1
1 1 1 1
Table : F=X+Y+Z
The symbol for OR gate is given below:
A A F A F
F B B
B C C
D
a) 2 input OR gate b) 3 input OR gate c) 4 input OR
gate Figure 1.5

AND gate
The AND Gate can have two or more than two input signals and produce
an output signal. When all the inputs are 1 or high only then the output is 1,
otherwise output is 0 only.
If any one or all the inputs is 0, the output is 0. To obtain output as 1, all
inputs must be 1.
An AND gate can have as many inputs as desired.

The AND Gate has two or more input signals, but only one output signal.
The out will be the logical multiplication of the inputs.
Boolean Algebra

Following tables illustrate AND action.


X Y Z X.Y.Z
X Y A.B 0 0 0 0
0 0 0 0 0 1 0
0 1 0 0 1 0 0
1 0 0 0 1 1 0
1 1 1 1 0 0 0
1 0 1 0
Table 1.19 Two input AND gate
1 1 0 0
1 1 1 1

Table 1.20 Three input AND gate


The symbol for AND is
A A A
F F B F
B
B C
C D
Figure 1.6 (a) 2-input AND gate (b) 3-input AND gate (c) 4 input AND gate

BASIC POSTULATES OF BOOLEAN ALGEBRA


Boolean algebra is a system of mathematics and consists of fundamental
laws. These fundamental laws are used to build a workable, cohesive framework
upon which are based the theorems of Boolean algebra. These fundamental laws
are known as Basic Postulates of Boolean algebra. These postulates state the
basic relations in Boolean algebra:

The fundamental laws of the Boolean algebra are called as the postulates
of Boolean algebra

The Boolean postulates are:


I. If X  0 then X = 1; and If X  1 then X = 0
II. OR Relations (Logical Addition)
0+0=0 0 0
OR
0

0+1=1 0
OR 1
1
1 1
1+0=1 OR
0

1 1
1+1=1 OR
1
Boolean Algebra

III AND Relations (Logical Multiplication)

0.0 = 0

0.1 = 0

1.0 = 0

1.1 = 1

IV Complement Rules

0=1 0 1

1=0 1 0

PRINCIPLE OF DUALITY
This is a very important principle used in Boolean algebra. This states
that starting with a Boolean relation another Boolean relation can be derived by
i. Changing each OR sign (+) to an AND sign (.)
ii. Changing each AND sign (.) to an OR sign (+)
iii. Changing each 0 by 1 and each 1 by 0.
The derived relation using duality principle is called dual of original
expression.
For instance, we take postulates of OR relation, which states that
(a) 0+0=0 (b) 0 + 1 = 1 (c) 1 + 0 = 1 (d) 1 + 1 = 1
Now working according to above guidelines, '+' is changed to '.' 0's are replaced by
1’s and 1’s are replaced by 0’s, these equations become
(i) 1.1=1 (ii) 1.0=0 (iii) 0.1=0 (iv) 0.0=0
These are nothing but postulate III related to AND relations. We’ll be applying
this duality principle in the theorems of Boolean algebra.
Boolean Algebra

Basic theorems of Boolean algebra


Basic postulates of Boolean algebra are used to define basic theorems of
Boolean algebra that provide all the tools necessary for manipulating Boolean
expressions. Although simple in appearance, these theorems may be used to
construct the Boolean algebra expressions.
Boolean theorems can be proved by substituting all possible values of the
variables that are 0 and 1. This technique of proving theorems is called as proof
by perfect induction. Boolean theorems can also be proved using truth table
also.

Proof by perfect induction is a method of proving Boolean theorems by


substituting all possible values of the variables.

Properties of 0 and 1
a) 0+X=X 0 X (gate representation of (a))
OR
X
1
b) 1+X=1 OR 1 (gate representation of (b))
X
0
c) 0.X=0 AND 0 (gate representation of (c))
X
1
d) 1.X=X AND X (gate representation of (d))
X

Proof a) 0+x = x
If x = 0, then LHS =0+x
=0+0
=0 { By OR relation }
=x
= RHS
If x = 1, then LHS =0+x
=0+1
=1 { By OR relation }
=x
= RHS
Boolean Algebra

Thus, for every value of x, 0 + x = x always.


O x R=0+x Truth table for above expression is given in table 1.21,
0 0 0 where R signifies the output.
0 1 1

Table Truth Table for 0 + x = x


As X can have values either 0 or 1 (postulate 1) both the values ORed with
0 produce the same output as that of X. hence proved.

(a) 1+x=1
Proof: If x = 0, LHS =1+x
=1+0
=1 { By OR relation }
If x = 1, LHS =1+x (

=1+1
=1 { By OR relation }
Thus, for every value of x, 1 + x = 1 always.
Truth table for above expression is given below in Table 1.21, where R signifies
the output or result.
1 x 1+x
1 0 1
1 1 1

Table Truth Table for 1 + x = 1


Again x can have values 0 or 1. Both the values (0 and 1) ORed with 1
produce the output as 1. Therefore 1+X=1 is a tautology.
(a) 0.X = 0
Proof: If x = 0, LHS = 0.x
= 0.0
=0 { By AND relation }
= RHS
Boolean Algebra

If x = 1, LHS = 0.x
= 0.1
=0 { By AND relation }
= RHS
Thus, for every value of x, 0.x = 0 always.

As both the possible values of X (0 and 1) are to be ANDed with 0,


produce the output as 0. The truth table for this expression is as follows:
0 X R=0.X
0 0 0
0 1 0
Table 1.23 Truth Table for 0.X = 0
Both the values of X(0 and 1), when ANDed with, produce the output as
0. Hence proved. Therefore, 0.X=0 is a fallacy.

(d) 1.X = X
Proof: If x = 0, LHS = 1.x
= 1.0
=0 { By AND relation }
=x
=RHS
If x = 1, LHS = 1.x
= 1.1
=1 { By AND relation }
=y
=RHS
Thus, for every value of x, 1.x = x always.

Now both the possible values of X (0 and 1) are to be ANDed with 1 to


produce the output R. Thus the truth table for it will be as follows :
Boolean Algebra

1 X 1.X
1 0 0
1 1 1

Table: Truth Table for 1.X=X


Now observe both the values (0 and 1) when ANDed with 1 produce the
same output as that of X. Hence proved.
Indempotence Law
This law states that when a variable is combines with itself using OR or
AND operator, the output is the same variable.

X
a) X + X = X OR X (gate representation for (a))
X

X
AND X
b) X . X = X X (gate representation for (b))

Proof :
(a) X+X=X
If x = 0, consider LHS = x + x
=0+0
=0 { By OR relation }
=x
=RHS
If x = 1, consider LHS = x + x
=1+1
=1 { By OR relation }
=x
=RHS
Thus, for every value of x, x + x = x always.
To prove this law, we will make truth table for above expression. As X is to
be OR ed with itself only, we will prepare truth table with the two possible
valuesof X (0 and 1).
Boolean Algebra

X X X+X
0 0 0
1 1 1
Table 1.25 Truth Table for x + x = x
(b) X.X = X
Here X if ANDed with itself.
Proof: If x = 0, consider LHS = x.x
= 0.0
=0 { By AND relation }
=x
=RHS
If x = 1, LHS = x.x
= 1.1
=1 { By AND relation }
=x
=RHS
Thus, for every value of x, x + x = x always.
x x x.x
0 0 0
1 1 1
Table 1.26 Truth Table for X.X = X

Involution
This law states that the complement of a variable is complemented again,
we get the same variable.
X
(X) = X ie., X X=X

Proof: If x = 0, then x =1 and (x) = 1 = 0 = x


If x = 1, then x = 0 and (x) = 0 = 1 = x
Thus, if a variable is complemented twice, we get the same variable.
We’ll prepare truth table which is given below:
Boolean Algebra

X X X
0 1 0
1 0 1

Table 1.27 Truth Table for X=X

First column represents possible values of X, second column represents


complement of X (i.e., X) and the third column represents complement of X (i.e.,X)
which is same as that of X. Hence proved.
This law is also called double-inversion rule.

Complementarity Laws
Here, we will combine a variable with its complement.
i. These laws states that
a) X + X = 1 X (gate representation of (a))
X OR X+X=1
b) X.X = 0
X
X AND X.X=0

Proof: If x = 0, LHS = x + x
=0+1 (x = 1)
=1 { By OR relation }
= RHS
If x = 1, LHS = x + x
=1+0
=1 { By OR relation }
= RHS
Thus, for every value of x, x + x = 1 always.

We will prove x + x=1 with the help of truth table which is given below :
Boolean Algebra

X X X+X
0 1 1
1 0 1

Table Truth Table for X + X =1


Here, in the first column possible values of X have been taken, second column
consists of X values (complement values of X), X and X values are ORed and the
output is shown in third column. As the equation holds true for both possible
values of X, it is a tautology.
(b) X.X = 0
Proof: If x = 0, LHS = x . x
= 0 . 1 ( x = 1)
=0 { By AND relation }
If x = 1, LHS =x.x
= 1 . 0 ( x = 0)
=0 { By AND relation }
Thus, for every value of x, x . x = 0 always.
Truth table for the expression is as follows:
X X X.X
0 1 0
1 0 0
Table Truth table for X . X = 0

The equations X.X = 0 as it holds true for both the values of X. Hence
proved. Observe that X.X=0. It is a fallacy. It is the dual of X+X=1.

Commutative Law
These laws state that a) x + y = y + x and b) x . y = y .x
X
X
OR
R
=
Y
OR
R
AND R = Y AND
R
Y X Y X

(R signifies the output)


Boolean Algebra

If x = 0 then LHS = x + y
=0+y
=y
RHS = y + x
=y+0
=y
Therefore, for x = 0, x+y=y+x
If x = 1 then LHS = x + y
=1+y
=1
RHS = y + x
=y+1
=1
Therefore, for x = 1, x + y = y + x. Hence the proof.
X Y X+Y Y+X
0 0 0 0
0 1 1 1
1 0 1 1
1 1 1 1

Table Truth Table for X + Y = Y +X

Compare the columns X + Y and Y +X, both of these are identical. Hence also
proved by truth table.
(b) Truth Table for X . Y = Y . X is given below:
Proof: If x = 0 then LHS = x . y
=0.y
=0
RHS = y . x
=y.0
=0
Therefore, for x = 0, x+y=y+x
If x = 1 then LHS = x . y
Boolean Algebra

=1.y
=y
Therefore, for x = 1, x + y = y + x. Hence the proof.
X Y X.Y Y.X
0 0 0 0
0 1 0 0
1 0 0 0
1 1 1 1

Table 1.31 Truth Table for X . Y = Y . X

Both of the columns X . Y and Y . X are identical, hence proved.


Associative Law
These laws state that
(a) X + (Y + Z) = (X + Y) + Z (associative Law of addition)
X X+Y
X R R
= Y
Y Z
Z Y+Z

(b) X (Y Z) = (X Y) . Z (associative Law of multiplication)


X XY
X R = Y R
Y
Z
Z YZ

a) X+(Y+Z) = (X+Y)+Z
Proof: If X = 0 the LHS = X + (Y + Z)
= 0 + (Y+ Z)
= Y+Z
RHS = (X+Y)+Z
= (0+Y)+Z
= Y+Z
Therefore for X=0, X+(Y+Z) = (X+Y)+Z
If X=1, then LHS =X+(Y+Z) RHS = (X+Y)+Z
=1+(Y+Z) =1+(Y+Z)
=1 =1+Z
Therefore X=1, X+(Y+Z) = (X+Y)+Z =1
Boolean Algebra

Proof. (a) Truth table for X + (Y + Z) = (X + Y) + Z is given below :

X Y Z Y+Z X+Y X+(Y+Z) (X+Y)+Z


0 0 0 0 0 0 0
0 0 1 1 0 1 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
(a) Table 1.32 Truth Table for X + (Y + Z) = (X + Y) + Z

Compare the columns X+(Y+Z) and (X+Y)+Z, both of these are identical.
Hence proved. Note : Give proof with table for rule (b). Since rule (b) is a dual of
rule (a), hence it is also proved.

Distributive Law
This law states that
(a) X (Y + Z) = XY+XZ X X+Y
Y
X R OR R
Y AND =
OR X
Z Y+Z X+Z
Z

(a) X + YZ = (X+Y) (X+Z)


X X+Y
Y
Y X R = R
AND OR Z AND
Z X
YZ
Z
Proof: a) X(Y+Z) = XY + XZ
If X=0, LHS = X(Y+Z) RHS = XY + XZ
= 0(Y+Z) = 0.Y + 0.Z
=0 =0+0
=0
If X=1, LHS = X(Y+Z) RHS = XY + XZ
= 1(Y+Z) = 1.Y + 1.Z
= Y+Z =Y+Z
Boolean Algebra

Therefore, for every value of x, LHS = RHS. i.e., x(y+z) = xz + yz


Truth Table for X (Y + Z) = XY+XZ is given below:
Table Truth table for X (Y + Z) = XY+XZ
X Y Z Y+Z XY XZ X(Y+Z) XY+XZ
0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 0 1 1 1
1 1 0 1 1 0 1 1
1 1 1 1 1 1 1 1

Both the columns X(Y+Z) and XY+XZ are identical, hence proved.
Note : Since rule (b) is dual of rule (a), hence it is also proved
(b) X + YZ = (X+Y) (X+Z)
Proof: RHS = (X+Y) (X+Z)
= XX + XZ +XY + YZ
= X+XZ+XY+YZ (XX=X)
= X(1 + Z + Y) + YZ
= X + YZ (1 + z + y = 1)
= LHS Hence the proof
Truth table for X+YZ = (X+Y)(X+Z) is given below
Absorption Law
According to this law
c) X+XY=X b) X(X+Y)=X
X X
X
XY OR X+Y AND
AND OR
Y Y
Logic diagram (a) Logic diagram (b)
Proof: a) X+XY = X
LHS = x + xy
= x(1 + y)
= x.1 (1+Y=1)
= x (X.1=X)
= RHS
Boolean Algebra

Truth Table for X+XY = X is given below:


X Y XY X+XY
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1

Table: Truth Table for X+XY = X


Column X and X+XY are identical. Hence proved
(b) Since rule (b) is dual of rule (a), it is also proved. However, we are giving the
algebraic proof of this law.
L.H.S.= X(X+Y) = X.X + XY
= X.X + XY
= X + XY (X.X = X Indempotence Law)
= X(1+Y)
= X.1 (using 1 + Y = 1 properties of 0, 1)
=X (X . 1 = X using property of 0, 1)
= RHS
Truth table for X(X+Y)=X

X Y X+Y X(X+Y)
0 0 0 0
0 1 1 0
1 0 1 1
1 1 1 1

Some Other Rules of Boolean Algebra


There are some more rules of Boolean algebra which are given below:
X+XY=X+Y (This is the third distributive law)
This rule can easily be proved by truth tables. As you are quite familiar with
truth tables now, truth table proof is left for you as exercise, the other proofs of
these rules are being given here:
X+XY=X+Y
X
X
R = X R=X+Y
XY Y
Y
Boolean Algebra

Proof : LHS = X + XY
= (x+x)(x+y) { x+x= 1}
= 1.(x+y)
= x+y
= RHS
All the theorems of Boolean algebra, which we have been covered so far, are
summarized in the following table:
Table 1.35 Boolean algebra rules
1 0+X=X Properties of 0
2 0.X = 0
3 1+X=1 Properties of 1
4 1.X = X
5 X+X=X Indempotence law
6 X.X=X
7 X =X Involution
8 X+X=1 Complementarity law
9 X. X = 0
10 X+Y=Y+X Commutative law
11 X . Y = Y. X
12 X + (Y + Z) = (X+Y)+Z Associative law
13 X(YZ) = (XY) Z
14 X (Y+Z) = XY+XZ Distributive law
15 X+YZ=(X+Y) (X+Z)
16 X+XY=X Absorption law
17 X . (X+Y) = X
18 X+XY=X+Y

De Morgan’s theorems
One of the most powerful identities used in Boolean algebra is De Morgan’s
theorem. Augustus De Morgan had paved the way to Boolean algebra by
discovering these two important theorems. This section introduces these two
theorems of De Morgan.
De Morgan’s First Theorem
It states that X+Y = XY
X X
X R
= R
Y
Y Y
Boolean Algebra

Proof: To prove this theorem, we need to recall complementarity laws, which


state that X+X=1 and X . X = 0 i.e., a logical variable/expression when added with
its complement produces the output 1 and when multiplied with its complement
produces the output 0.
Now to prove De Morgan’s first theorem, we will use complementarity laws.
Let us assume that P=X+Y where, P, X, Y are logical variables. Then, according
to complementation law P + P = 1 and P.P = 0.
That means, if P, X, Y are Boolean variables then this complementarity law must
hold for variable P. i.e., P = X+Y = XY
Therefore P+P=(X+Y)+XY
(X+Y) + X Y must be equal to 1. (As X+X = 1)
And, (X+Y). X Y must be equal to 0 (As X. X = 0)
Let us first prove the first part, i.e., (X + Y) + (XY) = 1
(X + Y) + (XY) = ((X + Y) + X) . ((X + Y)+Y) (ref. X+YZ=(X+Y)(X+Z))
= (X + X + Y) . (X + Y + Y)
= (1 + Y) . (X + 1)
= 1.1 (ref. X + X = 1)
=1 (ref. 1 + X = 1)
Now, let us prove the second part. i.e., (X + Y) . (XY) = 0
(X + Y) . (XY) = XY. (X + Y) (ref. X(YZ)=((XY)Z)
= XXY + XYY
= 0.Y + X.0
= 0+0=0 (ref. X . X = 0)
De Morgan’s Second Theorem
This theorem states that: (X.Y) = X + Y

X X
X X.Y R
= R
Y Y
Y

Proof: Again to prove this theorem, we will make use of complementarity law i.e.,
X + X = 1 and X.X = 0
If XY’s complement is X + Y then it must be true that
(a) X Y + (X + Y) =1 and (b) X Y (X + Y) = 0
Boolean Algebra

To prove the first part

L.H.S. = XY + (X + Y)
= (X + Y) + XY
= (X + Y + X) . (X + Y + Y)
= (X + X + Y) . (X + Y + Y)
= (1 + Y) . (X + 1) (ref. X + X = 1)
= 1.1 (ref. 1 + X = 1)
= 1 = R.H.S.
Now, the second part. i.e., XY . (X + Y) = 0
L.H.S. = XY. (X + Y) (ref. X(Y+Z)=XY+XZ)
= XYX + XYY
= XXY + XYY
= 0.Y + X.0 (ref. X . X = 0)
= 0+0
=0
= RHS
XY.(X + Y) = 0 and XY(X + Y) = 1
Thus, X.Y = X+Y Hence the theorem.

Although the identities above represent De Morgan’s theorem, the transformation


is more easily performed by following these steps:
(i) Complement the entire function
(ii) Change all the ANDs (.) to ORs (+) and all the ORs (+) to ANDs (.)
(iii) Complement each of the individual variables.
This process is called De Morganization.
‘Break the line, change the sign’ to De Morganize a Boolean expression.
Boolean Algebra

a) Solve using De Morgan's Theorem

AB+A+AB = AB + A + AB (AB=A+B; Demorgan's 2nd theorem)


=
= AB . A . AB ((X+Y=X.Y) Demorgan's law)
= ABA(A+B)
= ABAA + ABAB
= AB(AA+AB)
= AB(0+AB)
=AB.0+ABAB
=0+0
=0

Applications of De Morgan's Theorem


1. De Morgan's theorem useful in the implementation of the basic gate
operations with alternative gates, particularly with NAND and NOR gates which
are readily available in IC form.
2. De Morgan's theorem is used in the simplification of Boolean expressions.
3. De Morgan's laws commonly apply to text searching using Boolean
operators AND, OR and NOT. Consider a set of documents containing the words
"cars" or "trucks". De Morgan's laws hold that these two searches will return the
same set of documents.
4. De Morgan's laws are an example of a more general concept of mathematical
duality.

Basic Duality of Boolean algebra


We already have talked about duality principle. If you observe all the theorems
and rules covered so far, you’ll find a basic duality which underlines all
Boolean algebra. The postulates and theorems which have been presented can
all be divided into pairs.
For example, X+X.Y = X
Its dual will be X.(X+Y) = X
(Remember, change . to + and vice versa; complement 0 and 1.)
Similarly, (X+Y)+Z = X+(Y+Z) is the dual of (X.Y).Z=X.(Y.Z)
and X+0 = X is dual of X.1 = X
Boolean Algebra

In proving the theorems or rules of Boolean algebra, it is then necessary to prove


only one theorem, and the dual of the theorem follows necessarily.
In effect, all Boolean algebra is predicated on this two-for-one basis.
Example: Give the dual of following result in Boolean algebra:
XX = 0 for each X.
Solution: Using duality principle, dual of X.X=0 is X+X=1 (By changing (.) to
(+) and vice versa and by replacing 1’s by 0’s and vice versa).
Example: Give the dual of X+0=X for each X.
Solution: Using duality principle, dual of X+0=X is X.1=X
Example: State the principle of duality in Boolean algebra and give the dual of
the Boolean expression: (X+Y).(X+Z).(Y+Z)
Solution: Principle of duality states that from every Boolean relation, another
Boolean relation can be derived by
(i) Changing each OR sign (+) to an AND (.) sign
(ii) Changing each AND (.) sign to an OR ( +) sign
(iii) Replacing each 1 by 0 each 0 by 1
The new derived relation is known as the dual of the original relation.
Dual of (X+Y).(X+Z).(Y+Z) will be
(X.Y) + (X.Z) + (Y.Z) = XY +XZ + YZ
DERIVATION OF BOOLEAN EXPRESSION
Boolean expressions which consist of a single variable or its complement
e.g., X or Y or Z are known as literals.
Now before starting derivation of Boolean expression, first we will talk about
two very important terms. These are (i) Minterms (ii)Maxterms
Minterms
Minterm is a product of all the literals (with or without the bar) within the
logic system.
One of the most powerful theorems within Boolean algebra states that any Boolean
function can be expressed as the sum of products of all the variables within the
system. For example, X+Y can be expressed as the sum of several products, each
of the product containing letters X and Y. These products are called Minterms and
each product contains all the literals with or without the bar.
Also when values are given for different variables, minterm can easily be
formed. E.g., if X=0, Y=1, Z=0 then minterm will be XYZ i.e., for variable with a
value 0, take its complement and the one with value 1, multiply it as it is. Similarly
for X=1, Y=0, Z=0, minterm will be XYZ.
Boolean Algebra

Steps involved in minterm expansion of expression


1. First convert the given expression in sum of products form.
2. In each term, if any variable is missing (e.g., in the following example Y is
missing in first term and X is missing in second term), multiply that term with
(missing term+missing term) factor, (e.g., if Y is missing multiply with Y+Y).
3. Expand the expression.
4. Remove all duplicate terms and we will have minterm form of an expression.
Example 1.20: Convert X+Y to minterms.
Solution: X+Y=X.1+Y.1

=X.(Y+Y)+Y(X+X) (X+X=1 complementary law)


=XY+XY+XY+XY
=XY+XY+XY+XY
=XY + XY + XY (XY + XY = XY Indempotent law)
Note that each term in the above example contains all the letters used: X
and Y. The terms XY, X and Y are therefore minterms. This process is called
expansion of expression.
Other procedure for expansion could be
1. Write down all the terms
2. Put X’s where letters much be inserted to convert the term to a product
term.
3. Use all combinations of X’s in each term to generate minterms.
4. Drop out duplicate terms.
Example: Find the minterms for AB+C.
Solution: It is a 3 variable expression, so a product term must have all three
letters, A, B and C.
1. Write down all terms AB+C
2. Insert X’s where letters are missing ABX+XXC
3. Write all the combinations of X’s in first term ABC, ABC
Write all the combinations of X’s in second term ABC, ABC, ABC, ABC
4. Add all of them. Therefore, AB+C= ABC+ABC+ABC+ABC+ABC+ABC
5. Now remove all duplicate terms. ABC+ABC+ABC+ABC+ABC
Now to verify, we will prove vice versa
ABC+ABC+ABC+ABC = AB + C
LHS = ABC+ABC+ABC+ABC+ABC
= ABC+ABC+ABC+ABC+ABC
= AC(B + B) +ABC+AB(C + C)
= AC.1 + ABC+ AB.1
Boolean Algebra

= AC.1 + ABC+ AB.1


= AC + AB + ABC
= AC + A(B + BC)
= AC + A(B + C) (B+BC=B+C Absorption law)
= AC + AB + AC
= AC + AC + AB
= C(A+A) + AB
= C.1 + AB
= C + AB
= AB + C
= RHS
Shorthand minterm Notation
Since all the letters (2 in case of 2 variable expression, 3 in case of 3
variable expressions) must appear in every product, a shorthand notation has
been developed that saves actually writing down the letters themselves. To form
this notation, following steps are to be followed:
1. First of all, copy original terms.
2. Substitute 0’s for barred letters and 1’s for non-barred letters
3. Express the decimal equivalent of binary word as a subscript of m.
Example 1.22: To find the minterm designation of XYZ
Solution: 1. Copy original form = XYZ
2. Substitute 1’s for non-barred and 0’s for barred letters.
Binary equivalent = 100
3. Decimal equivalent of 100 = 1x22 + 0x21 + 0x20 = 4 + 0 + 0 = 4
4. Express as decimal subscript of
Thus XYZ = m4
Similarly, minterm designation of ABCD would be
Copy Original Term ABCD
Binary equivalent = 1010
Decimal equivalent = 1x23 + 0x22 + 1x21 + 0x20 = 8 + 0 + 2 + 0 = 10
Express as subscript of m = m10
Boolean Algebra

Maxterms
A maxterm is a sum of all the literals (with or without the bar) within the
logic system.
Trying to be logical about logic, if there is something called minterm, there
surely must be one called maxterm and there is.
If the value of a variable is 1, then its complement is added otherwise the
variable is added as it is.
Example: If the values of variables are X=0, Y=1 and Z=1 then its Maxterm will
be X + Y + Z(Y and Z are 1’s, so their complements are taken; X= 0, so it is taken
as it is).
Similarly if the given values are X=1, Y=0, Z =0 and W=1 then its Maxterm is
X + Y + Z + W.
Maxterms can also be written as M (Capital M) with a subscript which is
decimal equivalent of given input combination e.g., above mentioned Maxterm
X+Y+Z+W whose input combination is 1001 can be written as M 9 as decimal
equivalent of 1001 is 9.
2.5.2 Canonical Expression
Canonical expression can be represented in following two forms:
(i) Sum-of-Products (SOP)
(ii) Product-of-sums (POS)

Boolean Expression composed entirely either of minterms or maxterms is


referred to as Canonical Expression.

Sum-of-Products (SOP)
A logical expression is derived from two sets of known values:
 Various possible input values
 The desired output values for each of the input combinations.
Let us consider a specific problem.
A logical network has two inputs X and Y and an output Z. The relationship
between inputs and outputs is to be as follows:
(i) When X=0 and Y=0 then Z=1
(ii) When X =0 and Y=1 then Z=0
(iii) When X =1 and Y=0, then Z=1
Boolean Algebra

(iv) When X=1 and Y=1, then Z=1

We can prepare a truth table from the above relations as follows:


X Y Z Product Terms
0 0 1 XY
0 1 0 XY
1 0 1 XY
1 1 1 XY

Table truth table for product terms (2-input)

Here, we have added one more column to the table consisting list of product
terms or minterms. Adding all the terms for which the output is 1. i.e., Z=1 we get
following expression:
XY + XY + XY = Z
Now see, it is an expression containing only minterms. This type of expression
is called minterm canonical form of Boolean expression or canonical sum-of-
products form of expression.

When a Boolean expression is represented purely as sum of minterms, it


said to be in canonical SOP form.

Example: A Boolean function F defined on three input variables X, Y and Z is 1 if


and only if number of 1(one) inputs is odd (e.g., F is 1 if X=1, Y=0,Z=0), Draw the
truth table for the above function and express it in canonical sum of products
from.
Solution: The output is 1, only if one of the inputs is odd. All the possible
combinations when one of inputs is odd are
X=1. Y=0, Z=0
X=0, Y=1, Z=0
X=0, Y=0, Z=1
X=1, Y=1, Z=1
For these combinations output is 1, otherwise output is 0. Preparing the truth
table for it we get the following truth table.
Boolean Algebra

X Y Z F Product Terms/
Minterms
0 0 0 0 XYZ
0 0 1 1 XYZ
0 1 0 1 XYZ
0 1 1 0 XYZ
1 0 0 1 XYZ
1 0 1 0 XYZ
1 1 0 0 XYZ
1 1 1 1 XYZ

Table truth table for product terms (3-input)


Adding all the minterms (product terms) for which output is 1, get
XYZ + XYZ + XYZ + XYZ
This is the desired Canonical SOP from
So, deriving SOP expression from truth table can be summarized as follows:
1. For a given expression, prepare a truth table for all possible combinations
of inputs.
2. Add a new column for minterms and list the minterms for all the combinations.
3. Add all the minterms for which there is output as 1. This gives you the
desired canonical S-O-P expression.
Another method of deriving canonical SOP expression is algebraic method.
This is just the same as above. We will take another example here.
Example 1.24: Convert XY + XZ into canonical SOP from.
Solution: Rule 1: Simplify the given expression using appropriate theorems/
rules.
(XY) + (XZ) = (X + Y) (X + Z) using demorgan's law
= X + YZ (Using Distributive law)
Since it is a 3 variable expression, a product term must have all 3 variables.
Rule 2: Wherever a literal is missing, multiply that term with
missing variable + missing variable
X + YZ = X(Y + Y) (Z + Z) + (X + X) YZ
Boolean Algebra

(Y, Z are missing in first term, x is missing in second term)


= (XY + XY)(Z + Z) + XYZ + XYZ
= Z(XY + XY) + Z(XY + XY) + XYZ + XYZ
= XYZ + XYZ + XYZ + XYZ + XYZ + XYZ
Rule 3: By removing the duplicate terms, we get XYZ + XYZ + XYZ + XYZ + XYZ
This is the desired Canonical SOP from.
Above Canonical SOP expression can also be represented by following
shorthand notation. Here F is a variable function and m is a notation for minterm.
This specifies that output F is sum of 1st, 4th, 5th, 6th and 7th minterms.
i.e., F = m1 + m4 + m5 + m6 + m7 or F=(1,4,5,6,7)
Converting Shorthand notation to minterms
We already have learnt how to represent minterm into shorthand notation.
Now we will learn how to convert vice versa.
Rule1: Find binary equivalent of decimal subscript e.g., for m 6 subscript is
6, binary equivalent of 6 is 110.
Rule2: For every 1’s write the variable as it is and for 0’s write variable’s
complemented form i.e., for 110 it is XYZ . XYZ is the required minterm for m6.
Example: Convert the following three input function F denoted by the
expression into its canonical SOP form.
Solution: If three inputs are X, Y and Z then
F = m0 + m 1 + m 2 + m5
m0=000  XYZ
m1=001  XYZ
m2=010  XYZ
m5=101  XYZ
Canonical SOP form of the expression is
X Y Z + X Y Z +X Y Z +X Y Z
Product-of-sum form (POS)
When a Boolean expression is represented purely as product of Maxterms,
it is said to be in canonical Product-of-Sum form.
This form of expression is also referred to as Maxterm canonical form of
Boolean expression.
Boolean Algebra

Just as any Boolean expression can be transformed into a sum of minterms, it


can also be represented as a product of Maxterms.
(a) Truth table method
The truth Table method for arriving at the desired expression is as follows:
1. Prepare a table of inputs and outputs
2. Add one additional column of sum terms. For each row of the table,
a sum term is formed by adding all the variables in complemented
or uncomplemented form. i.e., if input value for a given variable is 1,
variable is complemented and if 0, not complemented.
Example: If X=0, Y=1, Z=1 then Sum term will be X + Y + Z
Now the desired expression is product of the sums from the rows in which the
output is 0.
Example 1.26: Express in the product of sums from the Boolean function F(X,
Y, Z) and the truth table for which is given below:
X Y Z F
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

Solution: Add a new column containing Maxterms. Now the table is as follow:

X Y Z F 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
Boolean Algebra

Now by multiplying maxterms for the output 0’s, we get the desired product
of sums expression which is (X + Y + Z) (X + Y + Z) (X + Y + Z)

(b) Algebraic Method


We will explain this method with the help of an example.
Example Express X Y + Y( Z (Z + Y)) into canonical product-of-sums form.
Solution: Rule 1: Simplify the given expression using appropriate theorems/rules:
X Y + Y (Z (Z + Y)) = XY + Y(Z Z + Y Z) { X(Y+Z) = XY+XZ }
= XY + Y (Z + YZ ) (Z . Z = Z as X . X = X)
= XY + Y.Z(1 + Y)
=XY+YZ.1 {1 + Y = 1}
=XY+YZ
Rule 2: To convert into product of sums form, apply the Boolean algebra rule
which states that X + YZ = (X + Y) (X + Z)
XY + YZ = (X Y + Y) (X Y + Z) (X + Y = Y + X)
= (Y + X Y) (Z + X Y)
= (Y + X) (Y + Y) (Z + X) (Z + Y)
= (X + Y) Y (X + Z) (Y + Z) (X + Y = Y)
Now, this is in product of sums form but not in canonical product of sums
form (In Canonical expression all the sum terms are Maxterms.)
Rule 3: After converting into product of sum terms, in a sum term for a missing
variable add (Missing variable . missing variable.) e.g., if variable Y is missing add
YY.
(X + Y) (Y)(X + Z)(Y + Z) = (X + Y + ZZ) (X X + Y + ZZ) (X + Y Y + Z) (X X + Y + Z)
Rule 4: Keep on simplifying the expression (using the rule, X+YZ=(X+Y)(X+Z))
until you get product of sum terms which are maxterms.
(X + Y + ZZ) = (X + Y + Z) (X + Y + Z) = M4. M5
( X X + Y + ZZ) = (XX + Y + Z) (XX + Y + Z)
= (X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z) =M0.M4.M1.M5
(X + YY + Z) = (X + Y + Z) (X + Y + Z)= M5.M7
( X X + Y + Z ) = (X + Y + Z) (X + Y + Z) =M1.M5
(X + Y) (Y) (X+Z) (Y+Z) = (X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z)
(X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z)
Boolean Algebra

Short hand = M4, M5, M0, M4, M1, M5, M5, M7, M1, M5 = M(0, 4, 5, 7)
Rule 5: Removing all the duplicate terms, we get
(X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z)
This is the desired canonical product of sums form of expression.
Shorthand maxterm notation
Shorthand notation of the above given canonical product of sums expression is
F=  (0,1,4,5,7) or F =  M(0,1,4,5,7)
This specifies that output F is product 0th, 1st, 4th and 7th Maxterms
i.e., F = M0.M1.M5.M5.M7
Here, M0 means Maxterm for Binary equivalent of 0 i.e., 000 ie., X=0, Y=0, Z=0
And, Maxterm will be (X+Y+Z) (Complemented variable is 1 and uncomplemented
variable is 0)
Similarly, M1 Means 0 0 1 X+Y+ Z
AS F = M0 .M1 .M4. M5 .M7
and M0 = 000 X+Y+Z
M1 = 001 X+Y+Z
M4 =100 X+Y+Z
M5 = 101 X+Y+Z
M7 = 111 X+Y+Z
F = (X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z)
Example 1.28: Convert the following function into canonical product of sums
form: F(X, Y, Z) = M(0, 2, 4, 5)
Note: To convert an expression from shorthand SOP form to shorthand POS
form, just create truth table from given expression. From the created truth table,
derive other form of expression. For example, from truth table, you can convert
an expression F(X, Y,Z)= (0,1,3,5) to  M(2,4,6,7)
Solution: F (X, Y, Z) =  M(0, 2,4,5) = M0 . M2 .M4 .M5
M0 = 000 X + Y + Z
M2 = 010 X+ Y +Z
M4 = 100 X+ Y +Z
M5 = 101 X+Y+Z
 F = (X + Y + Z) (X + Y + Z) (X + Y + Z) (X + Y + Z)
Boolean Algebra

Sum term V/s Maxterm and product term V/s minterm


Sum term means sum of the variables. It does not necessarily mean that
all the variables must be included whereas Maxterm means a sum-term having
the entire variables.
For Example, for 3 Variables F(X, Y, Z) functions X + Y, X + Z, Y + Z etc. are
sum terms whereas X + Y + Z, X + Y + Z, X + Y + Z etc. are Maxterms.
Similarly, product term means product of the variables, not necessarily all
the variables, whereas minterm means product of all the variables.
For A 3 variable (a, b, c) function abc, abc, abc etc. are minterms whereas
ab, bc, bc, ac etc. are product terms only.
Same is the difference between Canonical SOP or POS expression. A
Canonical SOP or POS expression must have all the Minterms or Maxterms
respectively, whereas a simple SOP or POS expression can just have product
terms or sum terms respectively.
Minimization of Boolean expression
After obtaining an SOP or POS expression, the next thing to do is to
simplify the Boolean expression, because Boolean operations are practically
implemented in the form of gates. A minimized Boolean expression means less
number of gates which means simplified circuitry. This section deals with two
methods simplification of Boolean expression.
Algebraic Method
This method makes use of Boolean postulates, rules and theorems to
simplify the expressions.
Example 1.29 simplify ABCD + ABCD + ABCD + ABCD
Solution: ABCD + ABCD + ABCD + ABCD
ABC(D + D) + ABC(D + D) = ABC.1 + ABC.1 (D + D = 1)
= AC(B+B) = AC
Example: Reduce the expression XY + X + XY
Solution: XY + X + XY

= (X + Y) + X + XY (using Demorgan’s 2nd theorem i.e., )

= X + X + XY + Y
= X + XY + Y {X + X = X as X + X = X}
= (X + X) (X + Y) + Y (Putting X + X = 1
=X+Y+Y {Y + Y = 1}
=X+1 {Putting Y + Y = 1)
=1 {putting X + 1 = 1 as 1 + X =1}
Boolean Algebra

Example: Minimize AB + AC + ABC (AB + C)


Solution AB + AC + ABC (AB + C) = AB + AC + ABCAB + ABCC
= AB + AC + AABBC + ABCC
= AB + AC + ABC {BB = 0 and CC = C}
= AB + A + C + ABC {AC = A + C}
= A + AB + C + ABC {rearranging the terms}
= A + B + C + ABC {A + AB = A + B because X + XY = X + Y}
= A + C + B + ACB (B + BAC = B + AC because X + XY = X + Y)
= A + C + B + AC (C + CA = C + A)
= A + B + C + AC
=A+ B + C +A
=A+A+ B + C
=1+B+C {A + A = 1}
=1 (1 + X = 1)

Example: Reduce X Y Z + X Y Z + X Y Z + X Y Z
Solution. X Y Z + X Y Z + X Y Z + X Y Z = X (Y Z + Y Z) + X ( Y Z + Y Z)
= (X + X) (YZ + YZ)

= Z(Y+Y)
=Z

Simplification using Karnaugh Maps


Truth tables provide a nice, natural way to list all values of a function.
There are several other ways to represent function values. One of the way is
Karnaugh Map (in short K-Map) named after its originator Maurice Karnaugh.
These maps are sometimes also called Veitch diagrams.
Boolean Algebra

Karnaugh Map or K-Map is a graphical display of the fundamental


product in a truth table.
Karnaugh map is nothing but a rectangle made up of certain number of
squares, each square representing a Maxterm or Minterm.
Sum of products Reduction using Karnaugh Map
In S-O-P reduction each square of K-Map represents a minterm of the
given function. Thus, for a function of n variables, there would be a map of 2 n
squares, each representing a minterm (refer to Fig. 1.7). Given a K-map, for SOP
reduction the map is filled in by placing in squares whose minterms lead to a 1
output.
Following are 2,3,4 variable K-maps for SOP reduction. (see fig. 1.7)
Note in every square a number is written. These subscripted numbers
denote that this square corresponds to that number’s minterm. For example, in
3 variable map X Y Z box has been given number 2 which means this square
corresponds to M2. Similarly, box number 7 means it corresponds to m 7 and so
on.
Please notice the numbering scheme here, it is 0, 1, 3, 2 then 4, 5, 7, 6
and so on, always squares are marked using this scheme while making a K-map.

(0)Y (1)Y (0)Y (1)Y

(0)X XY XY (0)X

0 1 0 1

(1)X XY XY (1)X
2 3 2 3

(a) (a)

(00)YZ (01)YZ (11)YZ (10)YZ (00)YZ (01)YZ (11)YZ (10)YZ

(0) X XYZ XYZ XYZ XYZ


0 1 3 2 (0) X 0 1 3 2

(1) X XYZ XYZ XYZ XYZ (1) X


4 5 7 6 4 5 7 6
(c) (d)
Boolean Algebra

(00)YZ (01)YZ (11)YZ (10)YZ (00)YZ (01)YZ (11)YZ (10)YZ

(00)WX WXYZ WXYZ WXYZ WXYZ (00)WX


0 1 3 2 0 1 3 2

(01)WX WXYZ WXYZ WXYZ WXYZ (01)WX


4 5 7 6 4 5 7 6

(11)WX WXYZ WXYZ WXYZ WXYZ (11)WX


12 13 15 14 12 13 15 14

(10)WX WXYZ WXYZ WXYZ WXYZ (10)WX


8 9 11 10 8 9 11 10

4-variable K Map representing minterms.

Observe carefully above given K-map. See the binary numbers at the top
of K-map. These do not follow binary progression, instead they differ by only one
place when moving from left to right : 00, 01, 11, 10. It is done so that only one
variable changes from complemented to un complemented form or vice versa.
The terms are A B . A B, AB, A B
This binary code 00, 01, 11, 10 is called Gray code. Gray Code is the
binary code in which each successive number differs only in one place. That is
why box numbering scheme follows above order only.
How to Map in K-Map?
We’ll take an example of 2 variable map to be illustrated, with the following
truth table for mapping (Table 1.38)
Table
A B F
0 0 0
0 1 0
1 0 1
1 1 1
Canonical S-O-P expression for this table is F=AB + AB or F =  (2,3).
To map this function first we’ll draw an empty 2-variable K-map as shown in Fig.
1.8(a)
Boolean Algebra

(0) (1) (0) (1) (0) (1)

(0) (0) (0) 0 0

(1) (1) 1 1 (1) 1 1

(a) (b) (c)


Now look for output 1 in the given truth table (1.38) for a given truth
table,.
For minterms M2 and M3 the output is 1. Thus mark 1 in the squares for
m2 and m3 i.e., square numbered as 2 and the one numbered as 3. Now our K-
map will look like fig 1.8 (b)
After entering 1’s for all 1 outputs, enter 0’s in all blank squares. K-map
will now look like Fig 1.8 same is the method for mapping 3-variable and 4-
varible maps i.e., enter 1’s for all 1 outputs in the corresponding squares and
then enter 0’s in the rest of the squares.

How to reduce Boolean expression in S-O-P form using K-map?


For reducing the expression, first we have to mark pairs, quads and octets.
To reduce an expression, adjacent 1’s are encircled. If 2 adjacent 1’s are
encircled, it makes a pair; if 4 adjacent 1’s are encircled, it makes a quad; and if 8
adjacent 1’s are encircled, it makes an octet.
While encircling groups of 1’s, firstly search for octets and mark them, then
for quads and lastly go for pairs. This is because a bigger group removes more
variables thereby making the resultant expression simpler.
Reduction of a pair : In the K-map in fig. 1.9, after mapping a given
function F(W, X, Y, Z) two pairs have been marked. Pair-1 is m0+m4 (group of 0th
minterm and 4th minterm as these numbers tell us minterm’s subscript). Pair-2
is m14+m15.
Observe that Pair-1 is a vertical pair. Moving vertically in pair-1, see one
variable X is changing its state from X to X as m 0 is W X YZ and m4 is W X YZ.
Compare the two and we see W X YZ changes to W X YZ . So, the variable X can
be removed.
Boolean Algebra

(00)YZ (01)YZ (11)YZ (10)YZ (00)YZ (01)YZ (11)YZ (10)YZ

(00)WX 1 0 0 0 (00)WX 1 0 0 0
0 1 3 2 0 1 3 2

(01)WX 1 0 0 0 (01)WX 1 0 1 1
4 5 7 6 4 5 7 6

(11)WX 0 0 1 1 (11)WX 1 0 1 1
12 13 15 14 12 13 15 14

(10)WX 0 0 0 0 (10)WX 1 0 0 0
8 9 11 10 8 9 11 10

Pair Reduction Rule


Remove the variable which changes its state from complemented to
uncomplemented or vice versa. Pair removes one variable only.
Thus reduced expression for Pair-1 is W Y Z as W X Y Z (m0) changes to W X Y Z
(m4)
We can prove the same algebraically also as follows :
Pair-1= m0 + m4 = W X Y Z + W X Y Z
= W Y Z ( X + X)
=WYZ.1 (X + X = 1)
=WYZ

Similarly, reduced expression for Pair-2 (m14+m15) will be WXY as WXYZ


(m14) changes to WXYZ (m15). Z will be removed as it is changing its state from
to Z.
Reduction of a quad
If we are given with the K-map shown in fig. 1.10 in which two quads have
been marked.
Quad-1 is m0 + m4 + m12 + m8 and Quad-2 is m7+m6+m15+m14. When we
move across quad-1, two variables change their states i.e., W and X are changing
their states, so these two variables will be removed.
Quad, Reduction Rule
Remove the two variables which change their states. A Quad removes two
variables. Thus reduced expression for quad-1 is Y Z as W and X (both) are
removed.
Boolean Algebra

Similarly, in Quad -2 (m7+m6+m15+m14), horizontally moving, variable Z is


removed as W X Y Z (m7) changes to W X Y Z (m6) and vertically moving, variable
W is removed as (m7) changes to WXYZ. Thus reduced expression for quad-2 is (by
removing W and Z) XY. XY+YZ
Reduction of an octet
Suppose, we have K-map with an octet marked as shown in Fig. 1.11.

(00)YZ (01)YZ (11)YZ (10)YZ

0 0 0 0
(00) WX
0 1 3 2

(01) WX 0 0 0 0
4 5 7 6

(11)WX 1 1 1 1
12 13 15 14

(10) WX 1 1 1 1
8 9 11 10

While moving horizontally in the octet two variables Y and Z are removed
and moving vertically one variable x is removed. Thus eliminating X, Y and Z, the
reduced expression for the octet is W only.
Octet Reduction Rule
Remove the three variables which change their states. An octet removes 3-
variables. But after marking pairs, quads and octets, there are certain other things
to be taken care of before arriving at the final expression. These are map rolling,
overlapping groups and redundant groups.

Map Rolling
Map Rolling means roll the map i.e., consider the map as if its left edges are
touching the right edges and top edges are touching the bottom edges. This is a
special property of Karnaugh maps that its opposite edges squares and corner
squares are considered contiguous (Just as the world map is treated contiguous
at its opposite ends). As in opposite edges squares and in corner squares only one
variable changes its state from complemented to uncomplemented state or vice
versa. Therefore, while making the pairs, quads and octets, map must be rolled.
Following pairs, quads and octets are marking after rolling the map.
Boolean Algebra

(00)CD (01)CD (11)CD (10)CD (00)CD (01)CD (11)CD (10)CD

1 1 1
(00)AB (00)AB
0 1 3 2 0 1 3 2

(01)AB 1 1 (01)AB 1 1
4 5 7 6 4 5 7 6

(11)AB (11)AB 1 1
12 13 15 14 12 13 15 14

(10)AB (10)AB
1 1
8 9 1 11 10 8 9 11 10

ABD+BCD BD+BD
Overlapping Groups
Overlapping means same 1 can be encircled more than once. For example,
if the following K-map is given:

(00)CD (01)CD (11)CD (10)CD

(00) AB
0 1 3 2

(01) AB 1 1 1
4 5 7 6

(11) AB
1 1
12 13 15 14

(10) AB 1
8 9 11 10

Observe that 1 for m7 has been encircled twice. Once for Pair-1(m5+m7)
and again for Quad (m7+m6+m15+m14). Also 1 for m14 has been encircled twice.
For the Quad and for Pair-2 (m14+m10).
Here, reduced expression for Pair-1 is ABD
Reduced expression for Quad is BC
Reduced expression for Pair-2 is ACD
Thus final reduced expression for this map is ABD + BC + ACD
Boolean Algebra

Thus reduced expression for entire K-map is sum of all reduced expressions
in the very K-map.
But before writing the final expression we must take care of redundant
Groups.

Redundant Groups
Reduntant group is a group whose all 1’s are overlapped by other groups
(i.e., pairs, quads, octets). Here is an example, given below.

(00)CD (01)CD (11)CD (10)CD (00)CD (01)CD (11)CD (10)CD

(00) AB (00)AB
0 1 3 2 0 1 3 2

(01) AB 1 1 (01)AB 1 1
4 5 7 6 4 5 7 6

(11) AB 1 1 (11)AB 1 1
12 13 15 14 12 13 15 14

(10) AB (10)AB
8 9 11 10 8 9 11 10

Fig. 1.14(a) has a redundant group. There are three pairs : Pair-1 (m4+m5),
Pair-2 (m5+m13), Pair-3 (m13+m15). But Pair-2 is a redundant group as its all 1’s
are marked by other groups.
With this reduntant group, the reduced expression will be ABC+BD+ABD.
For a simpler expression, Redundant Groups must be removed. After removing
the redundant group, we get the K-map shown in fig. 1.14 (b).
The reduced expression, for K-map in fig. 1.14 (b), will be
ABC + ABD
Which is much simpler expression .
Thus removal of redundant group leads to much simpler expression.

Summary of all the rules for S-O-P reduction using K-map


1. Prepare the truth table for given function.
2. Draw an empty K-map for the given function (i.e., 2 variable K-map for 2
variable function; 3 variable K-map for 3 variable function, and so on).
Boolean Algebra

3. Map the given function by entering 1’s for the outputs as 1 in the
corresponding squares.
4. Enter 0’s in all left out empty squares.
5. Encircle adjacent 1’s in form of octets, quads and pairs. Do not forget to
roll the map and overlap.
6. Remove redundant groups, if any.
7. Write the reduced expressions for all the groups and OR (+) them.
Example 1.33 Reduce F (a, b, c, d) = m (0,2,7,8,10,15) using Karnaugh map.
Solution: Given F (a, b, c, d) = m (0,2,7,8,10,15)
= m0 + m2 + m7 + m8 + m10 + m15
m0 = 0000 = A B C D m2 = 0010 = A B C D
m7 = 0111 = A B C D m8 = 1000 = A B C D
m10 = 1010 = A B C D m15 = 1111 = A B C D

Truth table for the given Mapping the given function in a K-map
function is as follows : we get
A B C D F
0 0 0 0 1
0 0 0 1 (00)CD (01)CD (11)CD (10)CD
0 0 1 0 1
(00)AB 1 0 0 1
0 0 1 1
0 1 3 2
0 1 0 0
(01) 0 1 0 1 AB 0 0 1 0
0 1 1 0 4 5 7 6
0 1 1 1 1
(11) AB
1 0 0 0 1 0 0 1 0
1 0 0 1 12 13 15 14

(10)
1 0 1 0 1 AB
1 0 1 1 1 0 1 1
8 9 11 10
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1 1

In the above K-map two groups have been marked, one Pair and One Quad.
Pair is m7 + m15
Boolean Algebra

And Quad is m0 + m2 + m8 + m10


Reduced expression for pair (m7 + m15) is BCD as A is removed. Reduced
expression for quad (m 0 + m2 + m8 + m10) is BD as for horizontal corners C is
removed and for vertical corners A is removed.
Thus final reduced expression is BCD + BD
Example: What is the simplified Boolean equation for the function?
F(A,B,C,D) = (7,9,10,11,12,13,14,15)
Solution: Completing the given Karnaugh map by entering 0’s in the empty
squares, by numbering the squares with their minterm’s subscripts and then
by encircling all possible groups, we get the following K-map.
There is one pair, three quads
(00)CD (01)CD (11)CD (10)CD
Pair-1= m7 + m15
(00)AB 0 0 0 0
Quad-1 = m12 + m13 + m14 + m15
0 1 3 2
Quad-2 = m13 + m15+m9 +m11
(01)AB 0 0 1 0
Quad-3 = m15 + m11 +m14 + m10 4 5 7 6

(11)AB 1 1 1 1
12 13 15 14

(10)AB
0 1 1 1
8 9 11 10

Reduced expression for pair-1 (m7 + m15) is BCD, as ABCD (m7) changes to
ABCD (m15) eliminating A.
Reduced expression for Quad-1 (m12 + m13 + m14) is AB, as while moving
across the Quad, C and D both are removed because both are changing their
states from complemented to uncomplemented or vice-versa.
Reduced expression for Quad 2 (m13 + m15+m9 +m11) is AD, as moving
horizontally, C is removed and moving vertically, B is removed.
Reduced expression of Quad-3 (m15 + m11 +m14 + m10) is AC as horizontal
movement removes D and vertical movement removes B.
Thus, Pair-1 = BCD, Quad-1 = AB, Quad-2 = AD, Quad-3 = AC
Hence final reduced expression will be BCD+AB+AD+AC.
Example: Obtain a simplified expression for a Boolean function F (X, Y,
A) the Karnaugh map for which is given below:
Boolean Algebra

[00] [01] [11] [10]

[1] [1]
[0]
0 1 3 2

[1] [1] [1]


4 5 7 6

Solution: Completing the given K-map.


We have 1 group which is a Quad i.e.,
m1 + m3 +m5 + m7
Reduced expression for this Quad is Z, as (00)YZ (01)YZ (11)YZ (10)YZ
moving horizontally from X Y Z (m1) to
X Y Z (m3), Y is removed (Y changing from (0) X 0 1 1 0
0 1 3 2
Y to Y) and moving vertically from m1 to
m5 or m3 to m7, X changes to X, thus X (1) X 0 1 1 0
is removed. 4 5 7 6

(c)

Example: Minimize the following


function using a Karnaugh map:
F (W, X, Y, Z) =  (0,4,8,12)
Solution: Given function F (W, X, Y, Z) =  (0,4,8,12)
F = m0 + m4 + m8 + m12
(00)YZ (01)YZ (11)YZ (10)YZ
m0 = 0000 = W X Y Z
m4 = 0100 = W X Y Z (00) W 1 0 0 0
X 0 1 3 2
m8 = 1000 = W X Y Z
m = 1100 = W X Y Z (01) WX 1 0 0 0
12 4 5 7
6
(11) WX 1 0 0 0

12 13 15
14 0
(10)WX 1 0 0
Boolean Algebra

Maping the given function on a K-Map, we get (m0 + m4 + m8)


Reduced expression for this quad is YZ as while moving across the Quad
W and X are removed. Because these are changing their states from
complemented to uncomplemented or vice versa.
Thus, final reduced expression is YZ.
Example: Using the Karnaugh technique obtain the simplified expression as
sum products for the following map:

(00) (01) (11) (10)

(0) 1 1

(1) 1 1

(d)

Solution: Completing the given K- map, we get one group which is a Quad has
been marked.
Quad reduces two variables.
Moving horizontally, Z is removed as it (00)YZ (01)YZ (11)YZ (10)YZ
changes from Z to Z and moving
(0)X 0 0 1 1
vertically, X is removed as it changes 0 1 3 2
from X to X. Thus only one variable Y
(1)X 0 0 1 1
is left. Hence Reduced S-O-P 4 5 7 6
expression is Y. Thus F=Y assuming F
is the given function.

Product-of-Sum Reduction using Karnaugh Map


In POS reduction each square of K-map represents a Maxterm. Karnaugh
map is just the same as that of the used in S-O-P reduction. For a function of n
variables, map would represent 2n squares, each representing a maxterm.
For POS reduction map is filled by placing 0’s in squares whose Maxterms
lead to output 0.Following are 2, 3 4 variable K-Maps for POS reduction.
Boolean Algebra

(0) Y (1) Y (0) Y (1) Y

(0) X (0) X (X + Y) (X + Y)
0 1 0 1

(1) X (1) X (X + Y) (X + Y)
2 3 2 3

(a) (b)

2- variable K-Map representing Maxterms.

(00)Y+Z (01)Y+Z (11)Y+Z (10)Y+Z (00)Y+Z (01)Y+Z (11)Y+Z (10) Y+Z

(0) X (0) X X+Y+Z X+Y+Z X+Y+Z X+Y+Z


0 1 3 2 0 1 3 2

(1) X (1) X X+Y+Z X+Y+Z X+Y+Z X+Y+Z

4 5 7 6 4 5 7 6
(c) (d)

3-variable K-Map representing Maxterms


(00)Y+Z (01)Y+Z (11)Y+Z (10)Y+Z

(00) (01) (11) (10) [00] W+X W + X + Y + Z W + X + Y + Z W + X + Y + Z W + X + Y + Z


[00] 0 1 3 2 0 1 3 2
[00] 4 5 7 6 W+X+Y+Z W+X+Y+Z W+X+Y+Z W+X+Y+Z
[01] W+X
[00] 12 13 15 14
4 5 7 6
[00]
8 9 11 10
[11] W+X W + X + Y + Z W + X + Y + Z W + X + Y + Z W + X + Y + Z
(e)
12 13 15 14

[10] W+X W + X + Y + Z W + X + Y + Z W + X + Y + Z W + X + Y + Z

8 9 11 10
(f)
4 varible K–Map representing Minterms
Figure: 2,3,4 variable K-Maps of POS expression.
Boolean Algebra

Again the numbers in the squares represent Maxterm subscripts. Box


with number 1 represent M1, Number 6 represent, M6, and so on. Also notice
box numbering scheme is the same i.e., 0, 1, 3, 2 ; 4, 5, 7, 6 ; 12, 13, 15, 14 ; 8,
9, 11, 10.
One more similarity in SOP K-map and POS K-map is that they are binary
progression in gray code only. So, here also some Gray Code appears at the top.
But one major difference is that in POS K-Map, complemented letters
represent 1’s uncomplemented letters represent 0’s, whereas it is just the opposite
in SOP K-Map. Thus in the fig 1.15 (b), (d), (f) for 0’s uncomplemented letters
appear and for 1’s complemented letters appear.
How to derive POS Boolean expression using K-Map?
Rules for deriving expression are the same except for the thing i.e., POS
expression adjacent 0’s are encircled in the form of pairs, quads and octets.
Therefore, rules for deriving POS Boolean expression can be summarized as follows:
1. Prepare the truth table for a given function.
2. Draw an empty K-map for given function (i.e., 2-variable K-map for 2 variable
function; 3 variable K-map for 3 variable function and so on).
3. Map the given function by entering 0’s then squares numbered 5 and 13
will be having 0’s)
4. Enter 1’s in all left out empty squares.
5. Encircle adjacent 0’s in the form of octets, quads, and pair. Do not forget to
role the map and overlap.
6. Remove redundant groups, if any.
7. Write the reduced expressions for all the groups and AND (.) them.
Example: Reduce the following Karnaugh map in Product of sums form:

(00) (01) (11) (10)

(0) 0 0 0 1

(1) 0 1 1 1

Solution: To reach at POS expression, we’ll have to encircle all possible groups
of adjacent 0’s encircling we get the following K-map.
Boolean Algebra

There are 3 pairs which are;

[00]B+C [01]B+C [11] B+C B+C

[0]A 0 0 0
0 1 3 2
[1]A
0 0 0
4 5 7 6

Pair1: M0 . M1;
Pair 2: M0 .M4;
Pair 3: M1 . M3;

But there is one redundant group also i.e., Pair-1 (it’s all 0’s are encircled
by other groups). Thus removing this redundant pair-1, we have only two groups
now.
Reduced POS expression for Pair-2 is (B+C), as while moving across pair-2,
A changes its state from A to A, thus A is removed.
Reduced POS expression for Pair 3 is (A+C), as while moving across Pair 3
B changes to B, hence eliminated.
Final POS expression will be (B+C).(A+C)
Example: Find the minimum POS expression of
Y(A, B, C, D) = (0, 1, 3, 5, 6, 7 10, 14, 15).
Solution: As the given function is 4 variable function, we’ll draw 4 variable K-
Map and then put 0’s for the given Maxterms. i.e., in the squares whose numbers
are 0, 1, 3, 5, 6, 7, 10, 14, 15 as each square number represents its Maxterm.
So, K-map will be
(00)C+D (01)C+D (11)C+D (10)C+D

(00)A+B 0 0 0 1
0 1 3 2

(01)A+B 1 0 0 0
4 5 7 6

(11)A+B 1 1 0 0
12 13 15 14

(10)A+B 1 1 1 0
8 9 11 10
Boolean Algebra

Encircling adjacent 0’s we have following groups:

Pair-1 = M0. M1; Pair -2= M14. M10;


Quad = M1 .M3. M5. M7; Quad-2 = M7. M6. M15. M14;
Reduced expressions are the following:
For Pair -1, (A+B+C) (as D is eliminated: D changes to D)
For pair-2, (A+C+D) (B Changes to B; hence eliminated)
For Quad-1, (A+D) (Horizontally C and vertically B is eliminated
as C, B are changing their states)
For Quad-2, (B+C) (horizontally D and vertically A is
eliminated)
Hence final POS expression will be
Y(A, B, C, D) = (A+B+C) (A+C+D+) (A+D) (B+C)
Logic gates

LOGIC GATES
Introduction
After Shannon applied Boolean algebra in telephone switching circuits,
engineers realized that Boolean algebra could be applied to computer electronics
as well.
In the computers, these Boolean operations are performed by logic gates.

Elementary logic gates


Gates are digital (two-state) circuits because the input and output signals are
either low voltage (denotes 0) or high voltage (denotes 1). Gates are often called
logic circuits, because they can be analyzed with Boolean algebra.

A gate is simply an electronic circuit which operates on one or more


signals and always produces an output signal.

Gates are classified into two types.


(a) Basic gates
(b) Derived gates
(a) Basic gates
There are three basic logic gates:
1. NOT gate (inverter)
2. OR gate
3. AND gate
(b) Derived gates
There are four derived gates:
1. NOR gate
2. NAND gate
3. XOR gate (Exclusive OR gate)
4. XNOR gate (Exclusive NOR gate)
Inverter (NOT gate)
An inverter is also called a NOT gate, because the output is not the same
as the input. The output is sometimes called the complement (opposite) of the
input.
Logic gates

An Inverter is a gate with only one input signal and one output
signal; the output state is always the opposite of the input state.

X X

X X
X X
0 1
Low High
1 0
High Low

A low input i.e., 0 produces high output i.e., 1 and vice versa. NOT operation
is symbolized as or i.e., NOT X is written as X1 or X.
OR Gate
The OR gate has two or more input signals but only one output signal. If
one or more input signals are 1 (high), the output signal is 1 (high).
An OR gate can have as many inputs as desired. No matter how many
inputs are there, the action of OR gate is the same.

The OR gate has two or more input signals but only one output
signal. If any of the input signals is 1 (high), the output signal is 1
(high).

Following tables show OR action:


X Y Z F=X+Y+Z
0 0 0 0
X Y F=X+Y
0 0 1 1
0 0 0
0 1 0 1
0 1 1
0 1 1 1
1 0 1
1 0 0 1
1 1 1
1 0 1 1
Table 3.3 Truth table for 1 1 0 1
1 1 1 1
2-input OR gatea
Table 3.4 Truth Table for three input OR gate
Logic gates
The symbol for OR gate is given below:

A A A
F B F B F
B C
C D

OR operation is symbolized as + i.e., X or Y is written as X+Y.


AND gate
This gate also can have two or more inputs and always gives single output.
If any input is 0, the output is 0. To obtain output as 1, all inputs must be 1.
Thus, the AND represents the logical multiplication.

The AND Gate can have two or more input signals and produce one
output signal. When all the inputs are high then the output is
high. Otherwise, the output is low.

X Y F=X.Y
0 0 0
0 1 0
1 0 0
1 1 1
Table 3.5: 2- input AND gate

X Y Z F=X.Y.Z
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1

Table 3.6: 3-input AND gate


Logic gates

The symbol for AND is

A A
A
F B F B
B F
C
C D

AND operation is symbolized as X AND Y is written as X.Y


Derived gates
NOR Gate
NOR gate is nothing but NOT OR gate or inverted OR gate. This means, an
OR gate is always followed by a NOT gate to give NOR gate.
This gate also accepts two or more than two inputs and always produces
single output. If either of the two inputs is 1 (high), the output will be 0 (low).
Also, if all the inputs are low, then the output is high.

The NOR gate has two or more input signals but only one output
signal. If all the inputs are 0 (low), then the output signal is 1
(high).

X Y F = X+Y
0 0 1
0 1 0
1 0 0
1 1 0
Table 3.7: 2-input NOR gate

X Y Z F=X+Y+Z
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 0

Table 3.8: 3-input NOR gate


Logic gates
NOR operation is symbolized as i.e., X NOR Y is written as X + Y.

(a)

(b) (c) (d)


NAND Gate
NAND gate is NOT AND gate or inverted AND gate. This means, an AND
gate is always followed by a NOT gate to give NAND gate.
NAND gate can also have two or more inputs. This gate produces 0 (low)
for all 1 (high) inputs and produces 1 (high) for other input combinations.

The NAND Gate has two or more input signals but only one output
signal. If all of the inputs are 1 (high), then the output produced is
0 (low).
NAND action is illustrated in following Truth Tables (2.9 and 2.10)
X Y F = XY
X Y Z F = XYZ
0 0 1
0 0 0 1
0 1 1
0 0 1 1
1 0 1
0 1 0 1
1 1 0 0 1 1 1
1 0 0 1
Table 3.9: Truth table of 2-input NAND gate 1 0 1 1
1 1 0 1
1 1 1 0
Table 3.10 Truth table of 3-input NAND gate

The logical meaning of NAND gate can be shown as follows:


NAND operation is symbolized as i.e., X NAND Y is written as X.Y.
XOR Gate or Exclusive-OR Gate
The XOR Gate can also have two or more inputs, but produces one output
signal. Exclusive–OR gate is different from OR gate. OR gate produces output 1
for any input combination having one or more 1’s, but XOR gate produces output
1 for only those input combinations that have odd number of 1’s.
Logic gates

 Accepts two or more inputs and produces single output.


 The output is 0 if there are even number of 1’s in the inputs.
 The output is 1 if there are odd number of 1’s in the inputs.

In Boolean algebra,  sign stands for XOR operation. Thus, A XOR B can
be written as AB.
Following Truth Tables (2.11 and 2.12) illustrates XOR operation.

No. of 1’s X Y Z = AB


Even/odd
Even 0 0 0
Odd 0 1 1
Odd 1 0 1
Even 1 1 0

Table 3.11 Truth table of 2-input XOR gate

No. of 1’s X Y Z F
Even 0 0 0 0
Odd 0 0 1 1
Odd 0 1 0 1
Even 0 1 1 0
Odd 1 0 0 1
Even 1 0 1 0
Even 1 1 0 0
Odd 1 1 1 1

Table 3 input XOR gate

The symbols of XOR gates are given below:

XOR addition can be summarized as following:


0 0 = 0; 0  1 = 1; 1 0 = 1; 1 1 = 0
The operation representing XOR may be written as F = xy = x y + xy
Logic gates
XNOR Gate or Exclusive NOR Gate
An XOR gate is followed by a NOT gate (inventor) becomes XNOR gate.
Thus, The XNOR Gate is logically equivalent to an inverted XOR gate. Thus
XNOR produces 1 (high) as output when the input combination has even number
of 1’s or when all the inputs are 0’s.
Following truth tables 2.13 and 2.14 illustrate XNOR action.
No. of 1’s X Y F
Even/odd
Even 0 0 1
Odd 0 1 0
Odd 1 0 0
Even 1 1 1
Table 3.13 2 input XNOR gate

No. of 1’s X Y Z F
Even 0 0 0 1
Odd 0 0 1 0
Odd 0 1 0 0
Even 0 1 1 1
Odd 1 0 0 0
Even 1 0 1 1
Even 1 1 0 1
Odd 1 1 1 0

Table 3.14 3 input XNOR gate

Following are the XNOR gate symbols:


The bubble (small circle), on the output of NAND, NOR, XNOR gates
represents complementation.
The expression representing XNOR may be written as
F = (X+Y) . (X+Y)
The XNOR operation is symbolized as  i.e. X NOR Y is written as XY.
Now that you are familiar with logic gates, you can use them in designing
logic circuits.
Logic gates

Circuit diagrams
Boolean algebra is useless unless it can be translated into hardware, in
the form of gates. This translation of Boolean algebra in the gates’ form is known
as logic circuits. A logic circuit can be represented diagrammatically using the
traditional symbols of gates. Let us see how this is done, in the following
examples.
Example 2.1: Design a circuit to realize the following:
F(A, B, C) = AB + AC + BAC
Solution: The given Boolean expression can also be written as follows
F(A, B, C) = A . B + A . C + B . A . C
or F(A, B, C) = (A AND B) OR (A AND (NOT C)) OR ((NOT B) AND (NOT A) AND C)
Now these logical operators can easily be implemented in form of logic
gates. Thus circuit diagram for above expression will be as follows:
A AB
B

A AC F
C
AB+AC+BAC

B BAC
A
C
Example 2.2 Draw the diagram of digital circuit for the function:
F(X, Y, Z) = (X + Y) . (X + Z) . (Y + Z)
Solution: Above expression can also be written as
F(X, Y, Z) = (X OR Y) AND ((NOT X) OR (NOT Z)) AND (Y OR Z)
Thus circuit diagram will be
Logic gates

X X+Y
Y

X X+Z F
Z
(X+Y).(X+Z).(Y+Z)

Y Y+Z
Z

NAND, NOR as Universal Gates


We can design circuits using AND, OR and NOT gates as we have done so
far. But NAND and NOR gates are more popular as these are less expensive and
easier to design. Also, The basic gates AND, OR and NOT can easily be
implemented using NAND/NOR gates. Thus NAND, NOR gates are also referred
to as Universal Gates.

Universal gate is a gate using which all the basic gates can be
designed. NAND and NOR gates are called as the universal gates.

NAND–to-NOT logic
Not Operation

X X

NOT X = X NAND X
= X.X {De Morgan's Second Theorem}
=X+X {De Morgan's Second Theorem}
=X

NAND–to-AND logic
AND and OR operations from NAND gates are shown below:
Logic gates
AND operation

X X.Y X.Y
Y

AND operation using NAND is


X . Y = (X NAND Y) NAND (X NAND Y)
Proof: X NAND Y = X.Y
=X+Y (De Morgan’s Second Theorem)
(X NAND Y) NAND (X NAND Y)
= (X + Y) NAND (X + Y)
= (X + Y) . (X + Y) (De Morgan’s Second Theorem)
= X.Y + X.Y (De Morgan’s First Theorem)
=X.Y+X.Y (X = X)
= XY (X + X = X)
OR Operation
X.X
X

X+Y

Y
Y.Y

X + Y = (X NAND X) NAND (Y NAND Y)


Proof : X NAND X = X.X {De Morgan’s Second Theorem}
=X+X {De Morgan’s Second Theorem}
=X {X+X=X }
Similarly, Y NAND Y = Y
Therefore, (X NAND X) NAND (Y NAND Y) = X NAND Y
= (X . Y)
=X+Y {X = X, Y = Y}
=X+Y
Logic gates
NAND-to-NAND logic is best suited for Boolean expression in Sum-of-
Products form.

Design rule for NAND-TO-NAND logic Network (only for two-level-circuits)


1 Derive simplified sum-of products expression.
2 Draw a circuit diagram using AND, OR and NOT gates.
3 Just replace AND, OR and NOT gates with NAND gates
For example, XYZ + XZ can be drawn as follows, assuming that inputs and
their complements are available:

X X
Y Y
Z Z
=
Z XYZ+ZX XYZ+ZX
Z
X X

Example: Draw the diagram of a digital circuit for the function F(X, Y,
Z) = YZ + XZ using NAND gates only.
Solution : F(X, Y, Z) = YZ + XZ can be written as
= (Y NAND Z) NAND (X NAND Z)
Thus logic circuit diagram is

Y
Z Y.Z
X.Z YZ+ZX
X
Z
Example 2.4: Draw the diagram of digital circuit:
F (A, B, C) = AB + BC + CD using NAND-to-NAND logic.
Solution: F(A, B, C) = AB + BC + CD
= (A NAND B) NAND (B NAND C) NAND (C NAND D)
Logic gates
Thus logic circuit is

A A.B
B

B B.C
C AB+BC+CD

C C.D
D

Example 2.5: Draw the circuit diagram for


F = ABC + CB using NAND-to-NAND LOGIC ONLY.
Solution: F = ABC + CB
= ((A NAND (NOT B) NAND C) NAND ((NOT C) NAND B))
Circuit Diagram is

A
B
C

ABC+CB
C
B

NOR-to-NOT logic
NOT, AND and OR operations can be implemented in NOR-to-NOR form
as shown on below.

A A

NOT X = X NOR X
= X+X
= X.X
=X
Logic gates
NOR to OR Operation
A + B = (A NOR B) NOR (A NOR B)

A A+B
A+B
B

NOR to AND Operation


A . B = (A NOR A) NOR (B NOR B)

A
A

A.B
B
B

NOR-to-NOR logic is best suited for Boolean expression in Product-of-sum form.


Design rule for NOR-to-NOR logic network (only for two-level-circuits):
1 Derive a simplified product-of-sums form of the expression.
2 Draw a circuit diagram using NOT, OR and AND gates.
3 Finally substitute NOR gates tor NOT, OR and AND gates.
Example 2.6: Represent (X + Y) (Y + Z) (Z + X) in NOR-to-NOR form.
Solution: (X + Y) (Y + Z) (Z + X) = (X NOR Y) NOR (Y NOR Z) NOR (Z NOR X)

A A.B
B

B B.C
C AB+BC+CD

C C.D
D

You might also like