Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Karnaugh Maps / K-maps

clarified. These are as follows

by ANSHAY AGARWAL

Before going through the Karnaugh maps, some terms need to be

Literals
A literal is a single logic variable or its complement. For example X, Y, A, Z, X, etc. Minterms A minterm is the product of all the literals with or without complement involved in a logic system. For example AB, AB, AB, AB (for a problem containing only A and B), ABC, ABC, ABC (for a problem containing A, B and C) When the values of different variables are given, minterms can be easily formed asIf X=0, Y=0 minterm would be XY If X=1, Y=0, Z=1 minterm would be XYZ So, use the variable with value 1 as it is and variable with value 0 as complemented to find the minterm.

Maxterm A maxterm is the sum of all the literals with or without complement involved in a logic system. For example A+B, A+B, A+B, A+B (for problem containing only A and B) A+B+C, A+B+C, (for problem containing A, B and C) When the values of different variables are given, maxterms can be easily formed asIf X=0, Y=0 maxterm would be X+Y If X=1, Y=0, Z=1 maxterm would be X+Y+Z So use the variable with value 1 as complemented and variable with value 0 as it is to find the maxterm.

Canonical expressions
A Boolean expression containing entirely of minterms or maxterms is known as canonical expression. These are of two types

o Sum Of Product(SOP form)


It is the sum of all the minterms that result in a true value of the output variable. For example XY+XY+XY XYZ+XYZ+XYZ+XYZ AB+AB

o Product Of Sums(POS form)


It is the product of all the maxterms that result in a false value of the output variable. For example (X+Y)(X+Y)(X+Y) (X+Y+Z)(X+Y+Z)(X+Y+Z)(X+Y+Z) (A+B)(A+B) Shorthand notation The minterms and the maxterms can be represented by shorthand notation which makes it very easy and fast to write and work with. Shorthand notations can be obtained as followso For minterm
To represent a minterm as shorthand notation following steps are to be followed1. Write 0 for a complemented term and 1 for non-complemented term. This will give you a binary number. 2. The shorthand notation will be an m with the decimal equivalent of the binary number as subscript of m. Eg. The minterm XY is represented as10 m2 XYZ will be represented as XYZ --> 110 So m6

o For maxterm
To represent a maxterm as shorthand notation following steps are to be followed3. Write 1 for a complemented term and 0 for non-complemented term. This will give you a binary number. 4. The shorthand notation will be a capital M with the decimal equivalent of the binary number as subscript of M. Eg. The minterm X+Y is represented as01 M1 X+Y+Z will be represented as X+Y+Z --> 010 So M2

Minterm expansion of an expression


Any expression can be represented using minterms. To find the minterm expansion of an expression following steps have to be followed1. Write down all the terms in the expression 2. Put X where ever a literal is missing to convert the terms to minterms 3. Use all the combinations of Xs to find minterms 4. Remove the duplicate/repeated terms and write the terms together.

Lets consider an example Write AB+C using minterms only Follow the above steps as1. AB , C 2. ABX , XXC 3. ABX XXC ABC, ABC ABC, ABC, ABC, ABC

4. ABC+ABC+ABC+ABC+ABC-----------------answer Write AB+AC using minterms Follow the steps as1. AB, AC 2. ABX, AXC 3. ABX AXC ABC, ABC ABC, ABC -----------------------------answer

4. ABC+ABC+ABC

Exercise: write the expressions using minterms1) A+B 2) ABC+AD 3) AC+BD

Revisiting SOP and POS forms


Till now we have studied what the SOP and POS forms are. Now we will see how to expand a given function in the SOP or POS form. Lets consider a three input valued function F such that F is 1 if number of 1 inputs is odd and 0 otherwise.

SOP form
First make the truth table for the function. One special thing that we will do here is to write the minterms also in a separate column A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 F 0 1 1 0 1 0 0 1 MINTERMS ABC ABC ABC ABC ABC ABC ABC ABC

The SOP form of F is given by the sum of those minterms for which value of F is 1. F = ABC+ ABC+ ABC+ ABC See how simple it is!

Example: -----------Find SOP form of the function F = (0, 1, 3, 6, 7) (A function can also be represented in the above form. Here the numbers represent the subscript of the shorthand notation of minterms for which function has a TRUE value.) A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 F 1 1 0 1 0 0 1 1 MINTERMS ABC ABC ABC ABC ABC ABC ABC ABC

The SOP form isF = ABC + ABC + ABC + ABC + ABC -----------Find SOP form of the function F = AB + BC Draw the truth table A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 F 0 0 0 1 0 0 1 1 MINTERMS ABC ABC ABC ABC ABC ABC ABC ABC

SOP form is--

F = ABC + ABC + ABC

POS form
Make the truth table Write the Maxterms in a separate column A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 F 0 1 1 0 1 0 0 1 MAXTERMS A+B+C A+B+C A+B+C A+B+C A+B+C A+B+C A+B+C A+B+C

The POS form of F is given by the product of those maxterms for which value of F is 0. F = (A+B+C)(A+B+C)(A+B+C)(A+B+C)

Example: -----------Find POS form of the function F = (2, 4, 5) (A function can also be represented in the above form. Here the numbers represent the subscript of the shorthand notation of maxterms for which function has a FALSE value.

is used for maxterms and is used for minterms)

A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

C 0 1 0 1 0 1 0 1

F 1 1 0 1 0 0 1 1

MAXTERMS A+B+C A+B+C A+B+C A+B+C A+B+C A+B+C A+B+C A+B+C

The POS form isF = (A+B+C)(A+B+C)(A+B+C) -----------Find POS form of the function F = AB + BC Draw the truth table A 0 0 0 0 1 1 1 1 Exercise: Find SOP and POS forms of B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 F 0 0 0 1 0 0 1 1 MAXTERMS A+B+C A+B+C A+B+C A+B+C A+B+C A+B+C A+B+C A+B+C

The POS form is--F = (A+B+C) (A+B+C) (A+B+C) (A+B+C) (A+B+C)

F= (0, 1, 3, 6, 9, 10, 14) F= (1, 4, 5, 7, 12, 13, 15) F= AB + BC + ABD

Minimization of Boolean expressions


There are two ways to minimize a Boolean expression1) Algebraic method 2) Karnaugh maps

Algebraic method
In this method the Boolean expression is reduced by using the theorems of Boolean algebra. For example

-------simplify the function F = ABC + ABC + ABC F = AB.(C+C) + ABC = AB . 1 + ABC = AB + ABC = A.(B+BC) = A.(B + C) = AB + AC -------simplify the function F= ABCD + ABCD + ABCD + ABCD F = ABC.(D+D) + ABC.(D+D) = ABC + ABC (absorption law) (X+X=1)

= AC.(B+B) = AC

Karnaugh Maps
Karnaugh maps also known as K-maps make the simplification of the expressions very easy. A K-map consists of 2n cells, where n is the number of variables in the expression which is to be reduced. The reduction of SOP and POS forms using K-maps is shown as follows

SOP reduction using K-maps


Each cell of the K-map represents a minterm. A K-map for two variables is shown below

X Y

[0]
0

[1]
1

[0]

The
[1]

2 Y

number of since number variables is variables are

cells is 4 of 2. The 2

X and Y written with the line. The 0 and 1 written in the square

brackets are the possible values of X and Y. Each cell is a combination of the value of that row and column and the number on the top-right corner of the cell represents the decimal value of that combination. For example- the first cell has a combination [0][0] whose decimal equivalent is 0. Also cell number 2 has a combination [0][1] and decimal value is 1, so the value on the top-right corner of cell 2 is 1. K-map for 3 variables is as shown

YZ YZ X [00]

YZ [01]

YZ [11]

YZ [10]

0
X [0]

4
X [1]
[0]

These are combinations for YZ The combinations are such that only one variable changes its value in adjacent columns.

The content of a cell is determined by the value of expression for the value of input corresponding to the values of that row and column.

For example if the value of expression for the input 001 is 1 then the second cell(that is cell with row value [0] and column value [01]) will be filled with 1. Example: let the truth table of an expression is-

X 0 0 0 0 1 1 1 1 So the K-map would be-

Y 0 0 1 1 0 0 1 1

Z 0 1 0 1 0 1 0 1

F 1 1 0 1 0 0 1 1

YZ

YZ [00]

YZ [01]

YZ [11]

YZ [10]

0
X [0]

1
4
]

1
5

1
7

0
6

[1]
[0]

See how the K-map is filled for the values of F from truth table.

K-map for 4 variables


CD CD [00] 0 AB [00] CD [01] 1 CD [11] 0] 3 CD [10] 2

AB

1
4

0
5

1
7

1
6

AB [01]

1
12

0
13

1
15

1
14

AB

[11]

1
8

1
9

1
11

1
10

AB [10]

Reduction from a K-map


Pair
A combination of two ones is called a pair. In above figure, a pair is shown with yellow background. A pair is reduced by writing all the variables except for those which change from complemented to uncomplemented or vice versa. For exampleIn the above map, the variable B changes from B to B.

So, the reduced value of the pair is ACD. A pair removes only one variable.

Quad
A combination of four ones is called a quad. In above figure, a quad is shown with green background. A quad is also reduced by writing all the variables except for those which change from complemented to uncomplemented or vice versa. For example- in the above map, the variable B changes from B to B and D changes from D to D. So, the reduced value of the quad is AC since A and C do not change values for the four cells. A quad removes two variables.

Octet
A combination of 8 ones is called an octet. In above figure, an octet is shown with red background. An octet is also reduced by writing all the variables except for those which change from complemented to uncomplemented or vice versa. For example- in the above map, the variables B, C, and D change but A does not change. So, the reduced value of the octet is A. An octet removes three variables.

You might also like