You are on page 1of 14

“Learn from yesterday, live for today, hope for tomorrow.


... Albert Einstein

1
2
CHAPTER

Boolean Algebra and


Karnaugh Maps
Learning Objectives
After reading this chapter, you will know:
1. Postulates
2. Properties
3. K-Maps
4. Minimization of Boolean Functions
5. Min term
6. Max term
7. SOP
8. POS

Boolean Algebra

Important Points
 Boolean algebra works with binary variables.
 A Boolean algebra is an algebraic system consisting of the set {0, 1}, the binary operations called
OR, AND, NOT denoted by the symbols “+”, “.”, and “ ′ ” [prime] respectively.
 Boolean algebra enables the logic designer to simplify the circuit used, achieving economy of
construction and reliability of operation.
 Boolean algebra suggests the economic and straightforward way of describing the circuitry used
in any computer system.
 Boolean algebra is unique in the way that it takes only two different values either 0 or 1. It does
not have negative number. It does not have fraction number.

The Basic Boolean Postulates


Logical Multiplications based on AND function.
1. 0.0 = 0
2. 0.1 = 0
3. 1.0 = 0
4. 1.1 = 1
L
A B

V
Switches in Series – Logic AND

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 26


Boolean algebra and Karnaugh maps

Note:
‘0’→ Switch is Off
‘1’→ Switch is On
Logical Additions based on OR Function
(a) 0 + 0 = 0
(b) 0 + 1 = 1
(c) 1 + 0 = 1
(d) 1 + 1 = 1
A

B L

Switches in Parallel – Logic OR

Complement based on NOT Function


(a) 0′ = 1
(b) 1′ = 0

Boolean Properties
(a) Properties of AND Function
X. 0 = 0
0. X = 0
X. 1 = X
1. X = X
(b) Properties of OR Function
X+0=X
0+X=X
X+1=1
1+X=1
(c) Combining a Variable with itself or its Complement
X . X′ = 0
X.X=X
X+X=X
X + X′ = 1
(X′)′ = X
(d) Commutative Laws
x. y = y. x
x+y=y+x
(e) Distributive Laws
x(y + z) = x. y + x. z
x + y. z = (x + y)(x + z)

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 27


Boolean algebra and Karnaugh maps

(f) Associative Laws


x(y. z) = (x. y) z
x + ( y + z) = (x + y) + z
(g) Absorption Laws
x + xy = x
x(x + y) = x
x + x′y = x + y
x(x ′ + y) = xy
(h) Demorgan’s Laws
(x + y)′ = x′. y′
(x. y)′ = x ′ + y′
 In Boolean algebra ‘1’ is called ‘multiplicative identity’ and ‘0’ is called ‘additive identity’.
 Literal: A primed or unprimed Boolean variable is called Literal. Each variable can have
maximum of two literals.
E.g.: x is a variable which can have two literals x and x′.

Proof for Some Important Properties:


(a) x + yz = (x + y)(x + z)
(x + y)(x + z) = x. x + x. z + x. y + y. z
= x + xz + xy + yz
= x( 1 + z) + xy + yz
= x + xy + yzsince (1 + z) = 1
= x( 1 + y) + yz = x + yz since (1 + y) = 1

(b) x + x y = x + y
x + x ′ y = (x + x ′ )(x + y) = x + y
x(x ′ + y ) = xy
x(x ′ + y) = xx ′ + xy = 0 + xy = xy

Example: Simplify the Boolean Function


(a) x y z + xy z + xy
= xz( y + y) + xy
= xz + xy
(b) xy + xz + yz
= xy + xz + yz(x + x)
= xy + xz + xyz + xyz
= xy(1 + z) + xz(1 + y)
= xy + xz

 Logic Circuits can be simplified by simplifying the Boolean equation using any one of the following
methods:
(a) Applying Boolean properties.
(b) Karnaugh – Map method of simplification.
(c) Tabulation method.

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 28


Boolean algebra and Karnaugh maps

 Boolean properties can be applied successively to minimize the given Boolean equations. But
there is no guarantee that we always get minimal equation in this method.
 2, 3 and 4 variable equations can be simplified to minimal value quickly using K – map method.
 Tabulation method is used to minimize the equations with high order variables.
 The properties of Boolean algebra are useful for the simplification of Boolean equation leading to
minimal gate structure.

Example: Simplify the Boolean equation z = xy + x′


Solution: xy + x ′ (x + y) = xy + x ′ x + x ′ y = xy + x ′ y
= (x + x′)y = y
n
 Number of Boolean function can be formed by n variable are 22

Duality Principle
The important property of Boolean algebra is the duality principle. “It states that every algebraic
expression deducible from theorems of Boolean algebra remains valid if the operators and identify
elements are interchanged.”
E.g.:
x+x=x x.x = x By Duality
x+1=1 x. 0 = 0 By Duality
x + xy = x x(x + y) = x By Duality
x+y=y+x xy = yx By Duality
x + (y + z) = (x + y) + z x(yz) = (xy)z By Duality

 The dual of the Exclusive – OR is equal to its complement.


 A simple procedure to find the complement of a function is to take the dual of the function and
complement each literal.
 To get dual of an algebraic expression, we simply interchange OR and AND operators and replace
1′s by 0′s and 0’s by 1′s.

Example: Find dual of F = ABC + A BC + ABC


Solution: It’s dual is Fdual = (A + B + C)(A + B + C)(A + B + C)

Complement of a Function
It can be obtained by two ways
1. By using De Morgan’s Theorem
2. Take dual of function and then complement each literal
Example: Find the complement of functions
F1 = x y z + x y z
F2 = xy (z̅ + x̅ z)
Solution:
(a) By De Morgan’s Theorem
F1′ = x y z + x y z
= (x y z) . (x y z)

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 29


Boolean algebra and Karnaugh maps

= (x + y + z)( x + y + z)
(b) Dual of F1 is F1dual = ( x + y + z) (x + y + z)
For complement of F1 , complement each literal of
F1dual ⇒ F1′ = (x + y + z)( x + y + z )

(I) F2′ = xy(z + xz)


= xy + (z + xz)
= ( x + y) + [z(xz)]
= ( x + y) + z( x + z)

(II) Dual of F2 = (x + y) + z( x + z)
Complement each literal F2′ = ( x + y) + z( x + z)
Operator Precedence:
The operator precedence for evaluating Boolean expression is
1. Parenthesis
2. NOT
3. AND
4. OR

Standard Product or a Minterm (m)


Consider two binary variables X and Y combined with an AND operation. Since each variable
appears in direct form or in its complement form there are four possible combinations. X′ Y′, X′ Y,
XY′ and XY. Each of these four AND terms is called a minterm or a standard product term.
X Y Minterm (m)
0 0 X′ Y′ m0
0 1 X′ Y m1
1 0 XY′ m2
1 1 XY m3

Standard Sum or Maxterm (M)


Two binary variables x and y combined with an OR operation we will get four possible combinations
X + Y, X + Y′, X′ + Y and X′ + Y′. Each of these four OR terms is called a Maxterm or a standard sum
term.
X′ Y Max term (M)
0 0 X′Y′ M0

0 1 XY M1

1 0 XY M2
1 1 XY M3

Maxterm is the complement of its corresponding minterm and vice versa.


E.g.: XY = Minterm.
The complement of minterm = (XY)′ = X′ + Y′ = Maxterm

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 30


Boolean algebra and Karnaugh maps

Canonical Form
Expressing the Boolean function in Standard Sum of Product form (SSOP) or Standard Product of
Sum form (SPOS) is called Canonical Form.
 A Boolean function may be expressed algebraically from a given truth table by forming a minterm
for each combination of the variables which produces ‘1’ in the function output and then taking
the OR of all those terms.
X Y F
0 0 0
0 1 1
1 0 1
1 1 0
F(X, Y) = XY′ + X′ Y = Σm (1, 2). This representation is called SSOP form.

 A Boolean function may be expressed algebraically from a given truth table by forming the
maxterms for each combination of the variables which produces ‘0’ in the function output and
then taking the AND of all those terms.
X Y F
0 0 0
0 1 1
1 0 1
1 1 0
F(X, Y) = (X + Y)(X ′ + Y ′ ) = ∏M (0, 3).
This representation is called SPOS form.

 If one canonical form is given it is possible to express other canonical form.


E.g.: The other canonical form of the function F(X, Y, Z) = ∏M (0, 2, 3, 6) is
F(X, Y, Z) = Σm(1, 4, 5, 7).

 Sum of all the minterms of a given Boolean function is equal to 1


E.g.: (X, Y, Z) = Σm(0, 1, 2, 3, 4, 5, 6, 7) = 1

 Product of all the maxterms of a given Boolean function is equal to 0.


E.g.: F(X, Y, Z) = ∏M(0, 1,2, 3, 4, 5, 6, 7) = 0

Example: Express the Boolean function F = A + BC in SOP, canonical form.


Solution: By multiplying each product term to addition of missing literal and its complement,
F = A + BC = A(B + B)(C + C) + BC(A + A)
= A(BC + BC + BC + B C) + ABC + A B C
= ABC + ABC + ABC + AB C + ABC + A B C
F = ABC + ABC + ABC + AB C + A BC
= F(A, B, C)

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 31


Boolean algebra and Karnaugh maps

= Σ(1, 4, 5, 6, 7)

Example: Express Boolean function F = xy + xz in POS canonical form.


Solution: First convert the function into sum terms using the Distributive law:
F = xy + xz = (xy + x)(xy + z)
= (x + x) ( x + y)(x + z)(y + z)
= ( x + y) (x + z) (y + z)
Each OR term is missing one literal so by adding each product term with product of
missing literal and its complement.
F = ( x + y + zz)(x + yy + z)(xx + y + z)
= ( x + y + z)(x + y + z)(x + y + z)(x + y + z)(x + y + z)( x + y + z)
F = (x, y, z) =  (0, 2, 4, 5)

Important Points
 Sum of products form can be implemented by using two-level Gate network, NAND- NAND logic.
 NAND – NAND realization is same as AND – OR.
 Product of sums form can be implemented by using two – level Gate network, NOR – NOR logic.
 NOR – NOR realization is same as OR – AND.
 If the signals are propagating through two stages of Gates, then it is called two level Gate network.

Degenerative Form: A two level Gate network is said to be Degenerative if it degenerates to a single
operation.
E.g.: AND – AND is equivalent to AND.

The Following Two Level Gate Networks are Degenerative Forms


AND – AND AND
OR - OR OR
OR – NOR NOR
AND – NAND NAND
NOR – NAND OR
NAND – NOR AND
NAND – OR NAND
NOR – AND NOR
Remaining 8 combinations are non-degenerative form.
AND – OR OR – AND NAND – NAND NOR – OR
AND – NOR OR – NAND NAND – AND NOR – NOR

Karnaugh Maps (K – maps)


 A map is a diagram made up of squares. Each square represents either a minterm or a maxterms.
 The number of squares in the Karnaugh map is given by 2n where n = Number of variable.
 Two variable K – map consists of 4 cells or 4 squares.

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 32


Boolean algebra and Karnaugh maps

 Three variable K – map consists of 8 squares or 8 cells.


 Four variables K – map consists of 16 squares or 16 cells.
 To maintain adjacency property Gray code sequence is used in K – map. (Any two adjacent
cells will differ by only one bit).
Two Variable K – Map
 Each cell represents a term of two literals.
 Grouping two adjacent (pair) square containing 1′s represents a term of one literal.
 Grouping four adjacent squares containing 1′s represent the function = 1.
x y 0 1
0 x ’y’ 0 x ’y’ 1

1 x y’ 3 x y’ 2

Three Variable K–Map


yz
x x 00 01 00 01
0
y 0 x′y′z′ x′y′z 1 x′yz x′yz′ 2
3
1 5
1 xy′z′ 4 xy′z 0
xyz 7 xyz′ 6
 Each cell represents a term of three literals.
 Grouping two adjacent cells containing 1′s (Pair) represent a term of two literals.
 Grouping four adjacent cells containing 1′s (Quad) represent a term of one literal.
 Grouping eight adjacent cells containing 1′s represents the function = 1.

Four Variables K–Map


yz
wx x 00 01 11 10
y00 w′x′y′z′ 0 w′x′y′z 1 w′x′yz 3 w′x′yz′ 2
01 w′xy′lz′ 4 w′xy′z 5 w′xyz 7 w′xyz′ 6
11 wxy′z′ 12 wxy′z 13 wxyz 15 wxyz′ 14
10 wx′y′z′ 8 wx′y′z 9 wx′yz′ 11 wx′y′z 10
 Each cell or square represents one minterm, giving a term of four literals.
 Grouping two adjacent squares containing 1′s represents a term of three literals.
 Grouping four adjacent squares containing 1′s represents a term of two literals.
 Grouping eight adjacent squares containing 1′s represents a term of one literals.
 Grouping sixteen adjacent squares containing 1’s represents the function = 1 (a term of zero
literals).

Rules to Simplify K – Maps


1. At the time of grouping the adjacent cells containing 1′s always use maximum possible group.
2. All the cells containing 1′s must be covered at least once in any group.
3. At the time of grouping don’t care (X) values can be taken as 1′s.
4. All don’t care values need not be covered.

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 33


Boolean algebra and Karnaugh maps

Tabulation Method
 Tabulation method is used to simplify Boolean expression when there are more than 5 variables.
 In an n-variable K-map combining 8 adjacent cells containing 1′s as a group will result a term of
(n−3) literals.
 In an n-variable K-map combining 8 adjacent cells containing 1′s as a group will eliminate 3
variables.
Number of No. of Cells Containing No. of Variables No. of Literals Present
Variables 𝟏′𝐬 Grouped Eliminated in the Resulting Term
4 2 0
2 2 1 1
1 0 2
8 3 0
4 2 1
3
2 1 2
1 0 3
16 4 0
8 3 1
4 4 2 2
2 1 3
1 0 4

 Sum of number of variables eliminated and number of literals present in the resulting term is
always equal to the number of variables in the K – map.

Example: Simplify the Boolean function


F = (x, y, z) =  (0, 2, 4, 5, 6)
Solution: From K-map of this function
yz
x x 00 01 11 10
y0 0 1 3 2
0 1 1 0
1 4 5 7 6
0 0 1 0
For SOP form cover 1 and make group
F = xz + yz
While writing in this form 0 is represented in x while 1 is represent as x.
For POS form cover 0 and make group.
yz
x x 00 01 11 10
y0 0 1 1 0
1 0 0 1 0
F = z(x + y)
While writing in this form 0 is represented in x and 1 is represent as x.

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 34


Boolean algebra and Karnaugh maps

Example: Simplify the Boolean function


F = A B C + B C D + A B C D + AB C
Solution:
CD
AB x 00 01 11 10
K‐ map y00
1 1 0 1 F = B D + B C + ACD
y
01 0 0 0 1
11 0 0 0 0
10 1 1 0 1

Comparator
Often in the evaluation of digital information it is important to compare two Binary strings (or)
Binary words to determine if they are exactly equal. This comparison process is performed by a
“Digital Comparator”.
The basic comparator evaluates two Binary strings bit by bit and output 1 if they are exactly equal.
An Exclusive-NOR Gate is the easiest way to compare the equality of bits. If both bits are equal
(0-0 or 1-1), the Ex-NOR puts out a ‘1’.
To compare more than just 2 bits, we need additional Ex − NORs and the output of all of them must
be 1.
For example, to design a comparator to evaluate two 4-bit number, we need four Ex - NOR. To
determine total equality, connect all four outputs into an AND Gate. That way, if all four outputs are
1′s, the AND Gate puts out a 1. Below Figure shows as comparator circuit built from Ex−NORs and
an AND Gate.
Each Ex-NOR
A0 check for
B0 equality

A1
B1
Out =1 If
A2 A 0 = B0
B2 A1 = B1
A 2 = B2
A3 A 3 = B3
B3
Binary Comparator for Comparing Two 4-bit Binary Strings

Decoder

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 35


Boolean algebra and Karnaugh maps

A Decoder is a combinational circuit that converts Binary information from n input lines to a max of
2n unique o/p lines. If the decoded information has unused or don’t care conditions then the o/p
will have less than 2n output lines.
The purpose of a decoder is to generate 2n or less minterms of n input variables.
xX D0
D1
D2
3×3 D3
yY
decoder
D D4
D5
D6
zZ D7

Truth Table of Decoder


Inputs Outputs
x y z D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 0 1 0 0 0 0 0 0 0
1 0 0 1 0 1 0 0 0 0 0 0
2 0 1 0 0 0 1 0 0 0 0 0
3 0 1 1 0 0 0 1 0 0 0 0
4 1 0 0 0 0 0 0 1 0 0 0
5 1 0 1 0 0 0 0 0 1 0 0
6 1 1 0 0 0 0 0 0 0 1 0
7 1 1 1 0 0 0 0 0 0 0 1
D0 = x̅ y̅ z̅
D1 = x̅ y̅ z
D2 = x̅ y z̅
D3 = x̅ y z
D4 = x y̅ z̅
D5 = x y̅ z
D6 = x y z̅
D7 = x y z
x y z

D0 (000)
(x̅ y̅ z̅)

D1 (000)
(x̅ y̅ z )

D2 (000)
(111) (x y z)

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 36


Boolean algebra and Karnaugh maps

Design a BCD to Decimal Decoder


w D0
w
x 4 x 10 D1
y Decoder
w
z D9
w

Inputs Outputs
w x y z D0 D1 D2 D3 D4 D5 D6 D7 D8 D9
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
1 0 0 0 1 0 1 0 0 0 0 0 0 0 0
2 0 0 1 0 0 0 1 0 0 0 0 0 0 0
3 0 0 1 1 0 0 0 1 0 0 0 0 0 0
4 0 1 0 0 0 0 0 0 1 0 0 0 0 0
5 0 1 0 1 0 0 0 0 0 1 0 0 0 0
6 0 1 1 0 0 0 0 0 0 0 1 0 0 0
7 0 1 1 1 0 0 0 0 0 0 0 1 0 0
8 1 0 0 0 0 0 0 0 0 0 0 0 1 0
9 1 0 0 1 0 0 0 0 0 0 0 0 0 1
Don’t care conditions = D10 D11 … . D15

Karnaugh Map
wx
yz 00 01 11 10
0 4 12 8
D8
00 D0 D4 d
1 5 13 9
01 D1 D5 d D9
3 7 15
D3 11
11 D7 d d
2 6 14 10
10 D2 D6 d
d

D0 = w̅ x̅ y̅ z̅
D1 = w̅ x̅ y̅ z
D2 = x̅ y z̅
D3 = x̅ y z
D4 = x y̅ z̅

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 37


Boolean algebra and Karnaugh maps

D5 = x y̅
D6 = x y z̅
D7 = x y z
D8 = w z̅
D9 = w z
w x y z

D0 (000)
(wx̅ y̅ z̅)
D8 (1000)
(w z̅)

D9 (1001)
(w z)

Full Subtractor

A B B1 D0 B0
0 0 0 0 0 0
1 0 0 1 1 1
2 0 1 0 1 1
3 0 1 1 0 1
4 1 0 0 1 0
5 1 0 1 0 0
6 1 1 0 0 0
7 1 1 1 1 1

D0 = f(A, B, B1 )
= Σ(1, 2, 4, 7)
B0 = Σ(1, 2, 3, 7)
0
A 1
2 D0
B 3×8 3
4
Ddecoder 5
B1
6 B0
7

A D0
B F. S.
C B0

Example: Realize using 3 × 8 decoder

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 38


Boolean algebra and Karnaugh maps

(a) Y1 = f(x, y, z) = x̅ y̅ + y̅ z̅
(b) Y2 = f(x, y, z)
= (x̅ + y̅)(x̅ + z̅)
Solution:
(a) Y1 = f(x, y, z) = x̅ y̅ + y̅ z̅
= x̅ y̅ (z + z̅) + y̅ z (x + x̅)
= x̅ y̅ z + x̅ y̅ z̅ + xyz + y̅ z x̅
= 001 000 100
= Σ(0, 1, 4)
(b) Y2 = f(x, y, z)
= (x̅ + y̅)(x̅ + 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̅)
↓ ↓ ↓
110 111 101
Y2 = f(x, y, z)
= π(5, 6, 7) … POS
= Σ(0, 1, 2, 3, 4, ) … SOP
0
x 1 Y2
2
y 3×8 3
4
Ddecoder 5
z Y1
6
7

info@thegateacademy.com ©Copyright reserved.Web:www.thegateacademy.com 39

You might also like