You are on page 1of 14

K Map

Electronics

Saurabh Khandelwal
Sum-of-products form (SOP)
 First the product (AND)
 Then these are summed (OR)
 Example: ABC + DEF + GHI

Here the product terms are defined by using the AND operation and the sum term is defined by
using OR operation.

Product-of-sum form (POS)


 first the sum (OR)
 then the products are taken (AND)
 Example: (A+B+C) (D+E+F) (G+H+I)

Here the sum terms are defined by using the OR operation and the product term is defined by
using AND operation.

“It is possible to convert between these two forms using Boolean


algebra (DeMorgan’s)”
DeMorgan s’ Theorems:
Theorem 1:
The complement of the sum of two or more variables is equal to the product of the complement of
the variables.
Theorem 2:
The complement of the product of two or more variables is equal to the sum of the complement of
the variables.

For the two variable A and B,


𝑨 + 𝑩 = 𝑨.𝑩
𝑨. 𝑩 = 𝑨 + 𝑩

Saurabh Khandelwal Page 2


𝑨 + 𝑩 = 𝑨.𝑩

𝑨. 𝑩 = 𝑨 + 𝑩
Canonical Form:
In an expression in canonical form, every variable appears in every term.
f (A, B, C, D) = AB𝐶 D + A𝐵CD + A𝐵C𝐷
An SOP expression can be forced into canonical form by ANDing the incomplete terms with
terms of the form X +𝑋, where X is the name of the missing variable.
Example: f (A, B, C) = AB + BC
= AB (C + 𝐶 ) + (A + 𝐴) BC
= ABC + AB𝐶 + ABC + 𝐴BC
= ABC + AB𝐶 + 𝐴BC
The product term in a canonical SOP expression is called a 'minterm'

Saurabh Khandelwal Page 3


Minterm:
 A product term in which all the variables appear exactly once, either complemented or
uncomplemented, is called a minterm.
 A minterm represents exactly one combination of the binary variables in a truth table (true or
inverted; but not both). It has the value of 1 for that combination and 0 for the others.

A minterm, denoted as mi, where 0 ≤ i < 2n , is a product (AND) of the n variables in which each variable
is complemented if the value assigned to it is 0, and uncomplemented if it is 1.

Sum of Minterm:

A Boolean function can be represented algebraically from a given truth table by forming the logical sum
of all the minterms that produce a 1 in the function. This expression is called a sum of minterms.

1-minterms = minterms for which the function F = 1.

0-minterms = minterms for which the function F = 0.

A shorthand notation:.

F (list of variables) = Σ (list of 1-minterm indices)


Or
F'(list of variables) = Σ (list of 0-minterm indices)

Maxterm:

 A sum term in which all the variables appear exactly once, either complemented or
uncomplemented, is called a maxterm.
 A maxterm represents exactly one combination of the binary variables in a truth table (true or
inverted; but not both). It has the value of 0 for that combination and 1 for the others.

A maxterm, denoted as Mi, where 0 ≤ i < 2n, is a sum (OR) of the n variables (literals) in which each variable is
complemented if the value assigned to it is 1, and uncomplemented if it is 0.

Product of Maxterms:

A Boolean function can be represented algebraically from a given truth table by forming the logical product of all the
maxterms that produce a 0 in the function. This expression is called a product of maxterms.

Saurabh Khandelwal Page 4


1-maxterms = maxterms for which the function F = 1.
0-maxterms = maxterms for which the function F = 0.

F (list of variables) = Π (list of 0-maxterm indices)

Or
F’ (list of variables) = Π (list of 1-maxterm indices)

Canonical Sum of Products Form:

There are 2 steps to derive the Canonical Sum of Products Form from its truth table.

1. A Minterm is a product (AND) term containing all input variables of the function in either
true or complemented form. A variable appears in complemented form 𝐴 if it is a 0 in the
row of the truth-table, and as a true form A if it appears as a 1 in the row.

2. The canonical form is obtained by taking the sum (OR) of the minterm of the rows where a
1 appears in the output.

Z = 𝑨B𝑪 + 𝑨BC + A𝑩C + ABC

TRUTH TABLE:
A B C Z Minterm
Assume all i/p = 1; 𝐴 = 𝐵 = 𝐶 = 0
0 0 0 0

0 0 1 0

0 1 0 1 𝑨B𝑪

0 1 1 1 𝑨BC

1 0 0 0

1 0 1 1 A𝑩C

1 1 0 0

1 1 1 1 ABC

Saurabh Khandelwal Page 5


Re-arranging the Truth Table:

A two-variable function has four possible minterms. We can re-arrange these minterms into a Karnaugh
map.

Karnaugh Map:
A K – map is a modified form of a truth table in which arrangement of combinations is particularly convent
for minimization. A graphical technique for simplifying an expression into a minimal sum of products
(MSP) form:

 There are a minimal number of product terms in the expression.


 Each term has a minimal number of literals.
 The function value associated with a particular combination is entered in the corresponding cell.

The K-map can be easily used for circuits with 2, 3, or 4 inputs. It consists of an array of cells, each
representing a possible combination of inputs.

 The cells are arranged to that each cell’s input combination differs from adjacent cells by only a
single bit.
 This is called Gray code ordering – it ensures that physical neighbors are the arrays are logical
neighbors as well. (In other words, neighboring bit patterns are nearly the same, differing by only 1
bit).

Consider the following arrangements of cells:

Saurabh Khandelwal Page 6


Location of Min-terms in K-maps:

a) 2 - Variables input:

b) 3 – Variables input:

c) 4 – Variables input:

AB
CD 00 01 11 10

00 0 4 12 8

01 1 5 13 9

11 3 7 15 11

10 2 6 14 10

If there are two neighboring 1's in the grid, it means that the input bit change between the two cells
has no effect on the output, and thus there is redundancy. This leads to a basic strategy.

Saurabh Khandelwal Page 7


Rules for grouping:

1. Groups may not include any cell containing a ZERO.

2. Group may be horizontal or vertical, but not diagonal.

3. Group must contain 2n cells. i.e. 1, 2, 4, 8 etc cells.

4. Each group should be as large as possible resulting in as few groups as possible.

5. Each cell containing a ONE must be part of a group if possible.

Saurabh Khandelwal Page 8


6. Group my overlap.

7. Group may wrap around the table. The leftmost cell in a row may be grouped with the rightmost
cell and the top cell in a column may be grouped with the bottom cell.

Obtaining Product Terms

 If A is a variable that has value 0 in all of the squares in the grouping, then the complemented
form A is in the product term. (that means 𝐴)
 If A is a variable that has value 1 in all of the squares in the grouping, then the true form A is in the
product term.
 If A is a variable that has value 0 for some squares in the grouping and value 1 for others, then it is
not in the product term.

Saurabh Khandelwal Page 9


Applying this to the multiplexer example:

So, we write out Boolean expressions for each group, leaving out the redundant elements. The
multiplexer example, with two groups, gives us two terms,

Example 1: Simplify the following expression using K – map for 4 – variables w, x, y and z.
f (w, x, y z) = ∑(0, 4, 6, 7, 8, 9, 14, 15)

Solution:
Step 1: Construct a truth table, in which output of table is 1 at given number. Here total number of
variable is 4 so possible numbers of cells is 24 = 16 cells.

w x y z f For simplification we can write


0 0 0 0 1 binary number of given cell also that
0 0 0 1 0 means binary number of,
4 = 0100;
0 0 1 0 0 7 = 0111;
0 0 1 1 0 15 = 1111
0 1 0 0 1
0 1 0 1 0
0 1 1 0 1
0 1 1 1 1 Remember
1 0 0 0 1 Only given cell number
1 0 0 1 1 output is 1 other
output is 0.
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 0
1 1 1 0 1
1 1 1 1 1

Saurabh Khandelwal Page 10


Step 2: Draw the K – map cells.

wx Hint
00 01 11 10
yz Our function is in wxyz parameter,
00 1 1 0 1 wx = 00 and yz = 00 means 1
wx = 10 and yz = 00 means 1
wx = 11 and yz = 10 means 1
01 0 0 0 1
Similarly construct this K – map; other
parameter is 0.
11 0 1 1 0
OR
Remember the location of cell (mention
10 0 1 1 0 above)

Step 3: Mark grouping for simplification (remember the rules of grouping)

wx 00 10
01 11
yz
1 1
00 1 0
0
01 0 0 1 Group 3

11 0 1 1 0
1
10 0 1 0

Group 1 Group 2

Step 4: Evaluate each group individual. Check which variable is not changing in group and write it,
if variable is change then leave this variable.

In group 1 yz value is 0 and this value is not change so we write 𝑦𝑧 and value of w is 0 (first 00 and
01 means w is not change) and its value is not change but value of x is change from 0 to 1 so we
use only 𝑤 .

So group 1 is 𝒘𝒚𝒛
Similarly in group 2; in column value of x is does not change and its value is 1; so we write x here
(value of w is change from 0 to 1 so leave it) and in row value of y is does not change and its value
is 1 so we write y here (value of z change from 1 to 0 so leave it.

So group 2 is xy

Saurabh Khandelwal Page 11


Similarly for group 3; wx value is 10 and its not change so we use w𝑥 and value of y is not change
and its value is 0 so we use 𝑦.

So group 3 is w𝒙𝒚
wx 00 10
01 11
yz
1 1
00 1 0
0
01 0 0 1
w𝒙𝒚
11 0 1 1 0
1
10 0 1 0

𝒘𝒚𝒛 xy

Step 5: Add all the value and write final expression for answer.

f (w, x, y, z) = 𝒘𝒚𝒛 + xy + w𝒙𝒚

Example 2: Simplify the following expression using K – map for 4 – variables w, x, y and z.
f (w, x, y z) = ∑(1, 5, 6, 7, 11, 12, 13, 15)

Solution:
Group 4 Total number of group is
5.
wx 11 Group 5 is cover by all
00 01 10 other groups.
yz
00 0 0 1 0
Group 1
1 1 1
01 0
1 Group 5
11 0 1 1

1 Group 2
10 0 0 0

Group 3

Saurabh Khandelwal Page 12


wx 11
00 01 10
yz
00 0 0 1 0 wx𝑦
1 1 1
01 0
𝑥𝑧
1 1
11 0 1
1 wyz
10 0 0 0

𝑤xy

𝑤 𝑦z

f (w, x, y, z) = xz + 𝒘𝒚z + wx𝒚 + 𝒘xy + wyz

Example 3:

Saurabh Khandelwal Page 13


Example 4:

Binary Number System: (Remember)

Decimal
pattern
0 1 2 3 4 5 6 7

Binary
number
0000 0001 0010 0011 0100 0101 0110 0111

Decimal
pattern
8 9 10 11 12 13 14 15

Binary
number
1000 1001 1010 1011 1100 1101 1110 1111

Saurabh Khandelwal Page 14

You might also like