0% found this document useful (0 votes)
19 views39 pages

Boolean Algebra and K-Map

Uploaded by

jatinwork379
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views39 pages

Boolean Algebra and K-Map

Uploaded by

jatinwork379
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 39

POS, SOP & Karnaugh

Maps for Simplification

1
Canonical and Standard Forms of
Boolean Expression
• We need to consider formal techniques for the
simplification of Boolean functions.
– Sum-of-Minterms and Product-of- Maxterms or
– Sum-of-Products (SOP) and Product-of-Sums (POS)

2024.11.23 Boolean Algebra PJF - 2


Definitions
• Literal: A variable or its complement
• Product term: literals connected by •
• Sum term: literals connected by +
• Minterm: a product term in which all the variables
appear exactly once, either complemented or
uncomplemented
• Maxterm: a sum term in which all the variables
appear exactly once, either complemented or
uncomplemented

2024.11.23 Boolean Algebra PJF - 3


Minterm
• Represents exactly one combination in the truth table.
• Denoted by mj, where j is the decimal equivalent of
the minterm’s corresponding binary combination (bj).
• A variable in mj is complemented if its value in bj is 0,
otherwise is uncomplemented.
• Example: Assume 3 variables (A,B,C). If bj = 011 then
its corresponding minterm is denoted by m3 = A’BC

2024.11.23 Boolean Algebra PJF - 4


Maxterm
• Represents exactly one combination in the truth table.
• Denoted by Mj, where j is the decimal equivalent of
the maxterm’s corresponding binary combination (bj).
• A variable in Mj is complemented if its value in bj is 1,
otherwise is uncomplemented.
• Example: Assume 3 variables (A,B,C). If bj = 011, then
its corresponding maxterm is denoted by M3 =
A+B’+C’

2024.11.23 Boolean Algebra PJF - 5


Truth Table notation for Minterms and
Maxterms
• Minterms and x y z Minterm Maxterm
Maxterms are easy 0 0 0 x’y’z’ = x+y+z = M0
m0
to denote using a
0 0 1 x’y’z = m1 x+y+z’ = M1
truth table.
0 1 0 x’yz’ = m2 x+y’+z = M2
• Example: 0 1 1 x’yz = m3 x+y’+z’= M3
Assume 3 variables1 0 0 xy’z’ = m4 x’+y+z = M4
x,y,z 1 0 1 xy’z = m5 x’+y+z’ =
(order is fixed) M5
1 1 0 xyz’ = m6 x’+y’+z =
M6
2024.11.23 1 1 1
Boolean Algebra xyz = m7 x’+y’+z’PJF=- 6
Canonical Forms (Unique)
• Any Boolean function F( ) can be expressed as a
unique sum of minterms and a unique product
of maxterms (under a fixed variable ordering).
• In other words, every function F() has two
canonical forms:
– Canonical Sum-Of-Products (sum of minterms)
– Canonical Product-Of-Sums (product of
maxterms)

2024.11.23 Boolean Algebra PJF - 7


Canonical Forms (cont.)
• Canonical Sum-Of-Products:
The minterms included are those mj such that
F( ) = 1 in row j of the truth table for F( ).
• Canonical Product-Of-Sums:
The maxterms included are those Mj such that
F( ) = 0 in row j of the truth table for F( ).

2024.11.23 Boolean Algebra PJF - 8


Example
• Truth table for f1(a,b,c) at right
a b c f1
• The canonical sum-of-products form for f1 is
f1(a,b,c) = m1 + m2 + m4 + m6 00 0 0
= a’b’c + a’bc’ + ab’c’ + abc’ 00 1 1
• The canonical product-of-sums form for f1 is 01 0 1
f1(a,b,c) = M0 • M3 • M5 • M7
01 1 0
= (a+b+c)•(a+b’+c’)•
(a’+b+c’)•(a’+b’+c’). 10 0 1
• Observe that: mj = Mj’ 10 1 0
1 1 0 1
1 1 1 0
2024.11.23 Boolean Algebra PJF - 9
Shorthand: ∑ and ∏
• f1(a,b,c) = ∑ m(1,2,4,6), where ∑ indicates that this is
a sum-of-products form, and m(1,2,4,6) indicates
that the minterms to be included are m1, m2, m4, and
m6.
• f1(a,b,c) = ∏ M(0,3,5,7), where ∏ indicates that this is
a product-of-sums form, and M(0,3,5,7) indicates
that the maxterms to be included are M0, M3, M5,
and M7.
• Since mj = Mj’ for any j,
∑ m(1,2,4,6) = ∏ M(0,3,5,7) = f1(a,b,c)

2024.11.23 Boolean Algebra PJF - 10


Conversion Between Canonical Forms

• Replace ∑ with ∏ (or vice versa) and replace those j’s that
appeared in the original form with those that do not.
• Example:
f1(a,b,c) = a’b’c + a’bc’ + ab’c’ + abc’
= m1 + m 2 + m 4 + m 6
= ∑(1,2,4,6)
= ∏(0,3,5,7)
= (a+b+c)•(a+b’+c’)•(a’+b+c’)•(a’+b’+c’)

2024.11.23 Boolean Algebra PJF - 11


Standard Forms (NOT Unique)
• Standard forms are “like” canonical forms,
except that not all variables need appear in
the individual product (SOP) or sum (POS)
terms.
• Example:
f1(a,b,c) = a’b’c + bc’ + ac’
is a standard sum-of-products form
• f1(a,b,c) = (a+b+c)•(b’+c’)•(a’+c’)
is a standard product-of-sums form.

2024.11.23 Boolean Algebra PJF - 12


Conversion of SOP from standard to
canonical form
• Expand non-canonical terms by inserting
equivalent of 1 in each missing variable x:
(x + x’) = 1
• Remove duplicate minterms
• f1(a,b,c) = a’b’c + bc’ + ac’
= a’b’c + (a+a’)bc’ + a(b+b’)c’
= a’b’c + abc’ + a’bc’ + abc’ + ab’c’
= a’b’c + abc’ + a’bc’ + ab’c’

2024.11.23 Boolean Algebra PJF - 13


Conversion of SOP from standard to
canonical form (example)

AB C  A B  ABC D

AB C  AB C ( D  D )  AB CD  AB CD

A B  A B (C  C )  A B C  A B C
A B C ( D  D )  A B C ( D  D )  A B CD  A B CD  A B C D  A B C D

AB C  A B  ABC D  AB CD  AB CD  A B CD  A B CD  A B C D  A B C D  ABC D


Conversion of POS from standard to
canonical form
• Expand noncanonical terms by adding 0 in terms of
missing variables (e.g., xx’ = 0) and using the
distributive law
• Remove duplicate maxterms

2024.11.23 Boolean Algebra PJF - 15


Conversion of SOP from standard to
canonical form(example)

( A  B  C )( B  C  D )( A  B  C  D)

A  B  C  A  B  C  DD ( A  B  C  D )( A  B  C  D )

B  C  D B  C  D  AA ( A  B  C  D )( A  B  C  D )

( A  B  C )( B  C  D )( A  B  C  D) 
( A  B  C  D)( A  B  C  D )( A  B  C  D )( A  B  C  D )( A  B  C  D )
Conversion of POS from standard to
canonical form (example)
• f1(a,b,c) = (a+b+c)•(b’+c’)•(a’+c’)
= (a+b+c)•(aa’+b’+c’)•(a’+bb’+c’)
= (a+b+c)•(a+b’+c’)•(a’+b’+c’)•
(a’+b+c’)•(a’+b’+c’)
= (a+b+c)•(a+b’+c’)•(a’+b’+c’)•(a’+b+c’)

2024.11.23 Boolean Algebra PJF - 17


The Karnaugh Map
The Karnaugh Map
• Feel a little difficult using Boolean algebra
laws, rules, and theorems to simplify logic?
• A K-map provides a systematic method for
simplifying Boolean expressions and, if
properly used, will produce the simplest SOP
or POS expression possible, known as the
minimum expression.
What is K-Map
• It’s similar to truth table; instead of being organized
(i/p and o/p) into columns and rows,
• the K-map is an array of cells in which each cell
represents a binary value of the input variables.
• The cells are arranged in a way so that simplification
of a given expression is simply a matter of properly
grouping the cells.
• K-maps can be used for expressions with 2, 3, 4, and
5 variables.
– 2, 3 and 4 variables will be discussed to illustrate the
principles.
Two-Variable Map
x2 x1
x1 0 1 x2 0 1
0 1 0 2
0 m0 m1
OR 0 m0 m2
2 3 1 3
1 m2 m3 1 m1 m3

NOTE: ordering of variables is


IMPORTANT for f(x1,x2), x1 is the row, x2 is
the column.
Cell 0 represents x1’x2’; Cell 1 represents
x1’x2; etc. If a minterm is present in the
function, then a 1Boolean
2024.11.23
is placed
Algebra
in the PJF - 21
Re-arranging the Truth Table
• A two-variable function has four possible minterms. We can re-
arrange
these minterms into a Karnaugh map
x y minterm Y
0 0 x’y’ 0 1
0 1 x’y 0 x’y’ x’y
1 0 xy’ X
1 xy’ xy
1 1 xy

• Now we can easily see which minterms contain common literals


– Minterms on the Yleft and right sides contain y’ and y
respectively
0 1 Y’ Y
– Minterms 0in the top and bottom rows contain x’ and x
x’y’ x’y X’ x’y’ x’y
respectively
X
1 xy’ xy X xy’ xy

22
Two-Variable Map (cont.)
• Any two adjacent cells in the map differ by
ONLY one variable, which appears
complemented in one cell and
uncomplemented in the other.
• Example:
m0 (=x1’x2’) is adjacent to m1 (=x1’x2) and m2
(=x1x2’) but NOT m3 (=x1x2)

2024.11.23 Boolean Algebra PJF - 23


2-Variable Map -- Example
• f(x1,x2) = x1’x2’+ x1’x2 + x1x2’
= m0 + m 1 + m 2
= x1 ’ + x 2 ’ x2
• 1s placed in K-map for specified
minterms m0, m1, m2 x1 0 1
• Grouping (ORing) of 1s allows 0 1
simplification
• What (simpler) function is 0 1 1
represented by each dashed 2 3
rectangle?
– x1 ’ = m 0 + m 1 1 1 0
– x2 ’ = m 0 + m 2
• Note m0 covered twice
2024.11.23 Boolean Algebra PJF - 24
Three Variable Map
There are 2N = 23 = 8 squares.

The minterms are arranged so that only one variable


changes from 0 to 1 or from 1 to 0 as you move from
square to square in the vertical or horizontal direction.

For any two adjacent squares, only one literal changes


from complemented to non-complemented (normal).
From this property the left and right ends of the map
are “adjacent.”
Three-Variable Map
yz
x 00 01 11 10
0 1 3 2

0 m0 m1 m3 m2
4 5 7 6

1 m4 m5 m7 m6

-Note: variable ordering is (x,y,z); yz specifies


column, x specifies row.
-Each cell is adjacent to three other cells (left or
right or top or bottom or edge wrap)
2024.11.23 Boolean Algebra PJF - 26
Three-variable Map Simplification
• One square represents a minterm of 3 literals.
• A rectangle of 2 adjacent squares represents a
product term of 2 literals.
• A rectangle of 4 squares represents a product term of
1 literals.
• A rectangle of 8 squares produces a function that is
equal to logic 1.

2024.11.23 Boolean Algebra PJF - 27


Three-Variable Map (cont.)
minterm

The types of structures


that are either minterms
or are generated by
repeated application of
the minimization theorem
on a three variable map
are shown at right.
Groups of 1, 2, 4, 8 are
possible. group of 2 terms

group of 4 terms
2024.11.23 Boolean Algebra PJF - 28
Simplification
• Enter minterms of the Boolean function into
the map, then group terms
• Example: f(a,b,c) = a’c + abc + bc’
• Result: f(a,b,c) = a’c+ b
abc
1 1 1
1 1
1 1 1
1 1

2024.11.23 Boolean Algebra PJF - 29


More Examples
yz
X 00 01 11 10

• f1(x, y, z) = ∑ m(2,3,5,7) 0 1 1
1 1 1
 f1(x, y, z) = x’y + xz

• f2(x, y, z) = ∑ m (0,1,2,3,6)
1 1 1 1
f (x, y, z) = x’+yz’
2
1

2024.11.23 Boolean Algebra PJF - 30


Four Variable K Map
There are 2N = 24 = 16 squares.

The minterms are arranged so that only one variable


changes from 0 to 1 or from 1 to 0 as you move from
square to square in the vertical or horizontal direction.

For any two adjacent squares, only one literal changes


from complemented to non-complemented (normal).
From this property the left and right ends of the map
are “adjacent.”
The 4-Variable K-Map
Binary
MINTERM
(ABCD)
0000 A’B’C’D’ m0
CD 0001 A’B’C’D m1
00 01 11 10
AB 0010
0011
A’B’CD’
A’B’CD
m2
m3
0100 A’BC’D’ m4
00 ABCD ABCD A B CD A B CD
0101 A’BC’D m5
0110 A’BCD’ m6
01 A BC D A BC D A BCD A BCD 0111 A’BCD m7
1000 AB’C’D’ m8
1001 A’BCD’ m9
11 ABC D ABC D ABCD ABCD
1010 AB’CD’ m10
1011 AB’C’D’ m11
10 AB C D AB C D AB CD AB CD 1100
1101
ABC’D’
ABC’D
m12
m13
1110 ABCD’ m14
1111 ABCD m15
Four-Variable Maps
YZ

00 01 11 10
WX

00 m0 m1 m3 m2

01 m4 m5 m7 m6

11 m12 m13 m15 m14

10 m8 m9 m11 m10

• Top cells are adjacent to bottom cells. Left-edge cells


are adjacent to right-edge cells.
• Note variable ordering (WXYZ).

2024.11.23 Boolean Algebra PJF - 33


Cell Adjacency

CD 00 01 11 10
AB
00
01
11
10
Four-variable Map Simplification
• One square represents a minterm of 4 literals.
• A rectangle of 2 adjacent squares represents a
product term of 3 literals.
• A rectangle of 4 squares represents a product term of
2 literals.
• A rectangle of 8 squares represents a product term of
1 literal.
• A rectangle of 16 squares produces a function that is
equal to logic 1.

2024.11.23 Boolean Algebra PJF - 35


Grouping the 1s (rules)
1. A group must contain either 1,2,4,8,or 16 cells
(depending on number of variables in the
expression)
2. Each cell in a group must be adjacent to one or
more cells in that same group, but all cells in the
group do not have to be adjacent to each other.
3. Always include the largest possible number of 1s in
a group in accordance with rule 1.
4. Each 1 on the map must be included in at least one
group. The 1s already in a group can be included in
another group as long as the overlapping groups
include noncommon 1s.
Example
• Simplify the following Boolean function (A,B,C,D) =
∑m(0,1,2,4,5,7,8,9,10,12,13).
• First put the function g( ) into the map, and then
group as many 1s as possible.
ab cd
1 1 1 1 1 1

1 1 1 1 1 1

1 1 1 1

1 1 1 1 1 1

g(A,B,C,D) = c’+b’d’+a’bd
2024.11.23 Boolean Algebra PJF - 37
Determining the Minimum SOP
Expression from the Map (example)

CD
00 01 11 10 B  A C  AC D
AB
00 1 1 AC
01 1 1 1 1 B
11 1 1 1 1
AC D
10 1
Determining the Minimum SOP
Expression from the Map (exercises)
CD CD
AB 00 01 11 10 AB 00 01 11 10

00 1 1 00 1 1

01 1 1 1 1 01 1 1 1

11 11 1 1 1

10 1 1 10 1 1 1
A B  A C  AB D D  AB C  BC

You might also like