Module V Kaurnaugh Mapping

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

V.

KARNAUGH MAPPING ( K-MAP)

A. INTRODUCTION

In many digital circuits and practical problems, we need to find


expression with minimum variables. We can minimize Boolean expressions
of 3, 4 variables very easily using K-map without using any Boolean algebra
theorems. K-map can take two forms Sum of Product (SOP) and Product of
Sum (POS) according to the need of problem. K-map is table like
representation but it gives more information than TRUTH TABLE. We fill grid
of K-map with 0’s and 1’s then solve it by making groups.

B. W HAT IS K-MAP?

A Karnaugh map is a two-dimensional truth-table. Unlike ordinary


(i.e., one-dimensional) truth tables, however, certain logical network
simplifications can be easily recognized from a Karnaugh map.Maurice
Karnaugh, a telecommunications engineer, developed the Karnaugh map
at Bell Labs in 1953 while designing digital logic based telephone switching
circuits.

It is a graphical representation of logic function suitable for manual


simplification and minimization. Karnaugh maps reduce logic functions
more quickly and easily compared to Boolean algebra. By reduce we mean
simplify, reducing the number of gates and inputs. We like to simplify logic
to lowest form to save costs by elimination of components. We define lowest
cost as being the lowest number of gates with the lowest number of inputs
per gate. Given a choice, most students do logic simplification with
Karnaugh maps rather than Boolean algebra once they learn this tool.

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.

a. The two-variable K-map


b. The 3-variable K-map

c. The 4-variable K-map

C. CELL ADJACENCY

The figure below the shows how cell adjacency works.


D. THE K- MAP MINIMIZATION

The following should be the goal of the K-Map:

• The K-Map is used for simplifying Boolean expressions to their


minimal form.

• A minimized SOP expression contains the fewest possible terms


with fewest possible variables per term.

• Generally, a minimum SOP expression can be implemented with


fewer logic gates than a standard expression.

We show five individual items above, which are just different


ways of representing the same thing: an arbitrary 2-input digital logic
function. First is relay ladder logic, then logic gates, a truth table, a
Karnaugh map, and a Boolean equation.

The point is that any of these are equivalent. Two


inputs A and B can take on values of either 0 or 1, high or low, open
or closed, True or False, as the case may be. There are 2 2 = 4
combinations of inputs producing an output. This is applicable to all
five examples.

These four outputs may be observed on a lamp in the relay


ladder logic, on a logic probe on the gate diagram. These outputs may
be recorded in the truth table, or in the Karnaugh map. Look at the
Karnaugh map as being a rearranged truth table.

The output of the Boolean equation may be computed by the


laws of Boolean algebra and transferred to the truth table or
Karnaugh Map, which of the five equivalent logic descriptions should
we use? The one which is most
useful for the task to be
accomplished.

The outputs of a truth table correspond on a one -to-one basis


to Karnaugh map entries. Starting at the top of the truth table, the
A=0, B=0 inputs produce an output α. Note that this same output α
is found in the Karnaugh map at the A=0, B=0 cell address, upper
left corner of K-map where the A=0 row and B=0 column intersect.
The other truth table outputs β, χ, δ from inputs AB=01, 10, 11 are
found at corresponding K-map locations.

Below, we show the adjacent 2-cell regions in the 2-variable K-


map with the aid of previous rectangular Venn diagram like Boolean
regions.

Cells α and χ are adjacent in the K-map as ellipses in the left


most K-map below. Referring to the previous truth table, this is not
the case. There is another truth table entry (β) between them. Which
brings us to the whole point of the organizing the K-map into a square
array, cells with any Boolean variables in common need to be close
to one another so as to present a pattern that jumps out at us.

For cells α and χ they have the Boolean variable B’ in common.


We know this because B=0 (same as B’) for the column above cells α
and χ. Compare this to the square Venn diagram above the K-map.
A similar line of reasoning shows that β and δ have
Boolean B (B=1) in common. Then, α and β have Boolean A’ (A=0) in
common. Finally, χ and δ have Boolean A (A=1) in common. Compare
the last two maps to the middle square Venn diagram.
To summarize, we are looking for commonality of Boolean
variables among cells. The Karnaugh map is organized so that we
may see that commonality. Let’s try some examples.

E. MAPPING A STANDARD SOP EXPRESSION

For an SOP Expression in Standard Form, please refer to the figure


below.

A “1” is placed on the K- map for each product term in the expression.
Each “1” is placed in a cell corresponding to the value of a product term,
let’s say, ABC . For example, a “1” goes to 101 (written with red ink).

To illustrate more, the expression:


a. The Rules in Groupings of Minterms are the following:

1. No zeroes allowed.
2. Only power of 2 cells in each grouping is accepted meaning, group
must contain either 1,2,4,8,or 16 cells (depending on number of
variables in the expression).
3. Everyone must be at least in one grouping. 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.
4. No diagonal groupings.
5. Overlapping is allowed. The 1s already in a group can be
included in another group as long as the overlapping groups
include noncommon 1s.
6. Groups may “Wrap-around”
7. Always include the largest possible number of 1s in a group in
accordance with rule 2.
8. Obtain the fewest number of groups possible.

Examples of Groupings:

b. Determining the Minimum SOP Expression from the Map

The following rules are applied to find the minimum product terms
and the minimum SOP expression:

1. Group the cells that have 1s. Each group of cell containing 1s
creates one product term composed of all variables that occur in
only one form (either complemented or complemented) within the
group. Variables that occur both complemented and
uncomplemented within the group are eliminated called
contradictory variables.
2. Determine the minimum product term for each group.

For a 3-variable map:


• A 1-cell group yields a 3-variable product term
• A 2-cell group yields a 2-variable product term
• A 4-cell group yields a 1-variable product term
• An 8-cell group yields a value of 1 for the expression.

For a 4-variable map:


• A 1-cell group yields a 4-variable product term
• A 2-cell group yields a 3-variable product term
• A 4-cell group yields a 2-variable product term
• An 8-cell group yields a a 1-variable product term
• A 16-cell group yields a value of 1 for the expression.

3. When all the minimum product terms are derived from the K-map,
they are summed to form the minimum SOP expression.

Illustrations:

Examples:

1. Transfer the contents of the truth table to the Karnaugh map


above.
Solution:

The truth table contains two 1s. the K- map must have both of
them. locate the first 1 in the 2nd row of the truth table above.

• Note the truth table AB address


• Locate the cell in the K-map having the same address
• Place a “1” in the cell

Repeat the process for the 1 in the last line of the truth table.

2. For the Karnaugh map in the above problem, write the Boolean
expression. Solution is below.

Solution:

Look for adjacent cells, that is, above or to the side of a cell.
Diagonal cells are not adjacent. Adjacent cells will have one or more
Boolean variables in common.

• Group (circle) the two 1s in the column


• Find the variable(s) top and/or side which are the same
for the group, write this as the Boolean result. It is B in
our case.
• Ignore variable which ae not the same for cell group. In
our case A varies, is both 1 and 0, ignore Boolean A.
• Ignore any variable not associated with cell containing
1s. B has no 1s under it. Ignore B
• Result Out = B

This might be easier to see by comparing to the Venn


diagrams to the right, specifically the B column.

3. Write the Boolean expression for the Karnaugh map below.

Solution:

• Group (circle) the two 1’s in the row


• Find the variable(s) which are the same for the group.
• Out = A

4. For the Truth table below, transfer the outputs to the Karnaugh,
then write the Boolean expression for the result.
Solution:

Transfer the 1s from the locations in the Truth table to the


corresponding locations in the K-map.

• Group the two 1’s in the column under B = 1


• Group the two 1’s in the row right of A = 1
• Write product term for first group = B
• Write product term for the second group = A
• Write SOP of the above two terms Output = A+B

The solution of the K-map in the middle is the simplest or


lowest cost solution. A less desirable solution is at far right. After
grouping the two 1s, we make the mistake of forming a group of 1-
cell. The reason that this is not desirable is that:

• The single cell has a product term of AB’


• The corresponding solution is Output = AB’ + B
• This is not the simplest solution
The way to pick up this single 1 is to form a group of two with
the 1 to the right of it as shown in the lower line of the middle K-
map, even though this 1 has already been included in the column
group ( B). We are allowed to re -use cells in order to form larger
groups. In fact, it is desirable because it leads to a simpler result.

We need to point out that either of the above solutions, Output


or Wrong Output, are logically correct. Both circuits yield the same
output. It is a matter of the former circuit being the lowest cost
solution.

5. Fill in the Karnaugh map for the Boolean expression below, then
write the Boolean expression for the result.
Solution:

The Boolean expression has three product terms. There will be


a 1 entered for each product term. Though, in general, the number
of 1s per product term varies with the number of variables in the
product term compared to the size of the K-map.

The product term is the address of the cell where the 1 is


entered. The first product term, A’B, corresponds to the 01 cell in the
map. A 1 is entered in this cell. The other two P-terms are entered
for a total of three 1s. Next, proceed with grouping and extracting the
simplified result as in the previous truth table problem.

6. Simplify the logic diagram below.

Solution:

• Write the Boolean expression for the original logic diagram as


shown below.
• Write the Boolean expression for the original logic diagram as
shown below.
• Transfer the product terms to the K-map
• Write the Boolean expressions for groups as in previous
examples
7. Simplify the logic diagram below.

Solution:

Write the Boolean expression for the original logic diagram


shown above

• Transfer the product terms to the Karnaugh map.


• It is not possible to form groups.
• No simplification is possible; leave it as it is.

No logic simplification is possible for the above diagram. This


sometimes happens. Neither the methods of Karnaugh maps nor
Boolean algebra can simplify this logic further. We show an
Exclusive-OR schematic symbol above; however, this is not a logical
simplification. It just makes a schematic diagram look nicer. Since it
is not possible to simplify the Exclusive -OR logic and it is widely
used, it is provided by manufacturers as a basic integrated circuit
(7486).

PROBLEM SET 27

1. Solve the following boolean function using k-map:

F(A,B,C,D) = Σm(3,5,6,7,9,11,15)
2. Generate a simplified Logical Equation of the Truth Table below
and draw the Logic Circuit of the said equation:

A B C D F (output)
0 0 0 0 1
0 0 0 1 0
0 0 1 0 1
0 0 1 1 0
0 1 0 0 1
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
1 0 1 1 0
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1

1. Minimize the following problems using the Karnaugh


maps method.
a. F = (A. B. C) + (A. B. C) + (A. B. C) + (A. B. C)
b. F = (A. B. C) + (A. B. C) + (A. B. C) + (A. B. C)

F. DON’T CARE CONDITIONS (x)

Sometimes a situation arises in which some input variable combinations


are not allowed, i.e. BCD code. There are six invalid combinations: 1010,
1011, 1100, 1101, 1110, and 1111.

Since these unallowed states will never occur in an application involving


the BCD code they can be treated as “don’t care” terms with respect to their
effect on the output.

The “don’t care” terms can be used to advantage on the K-map.


In certain cases, some of the minterms may never occur or it may
not matter what happens if they do? In such cases we fill in the Karnaugh
map with and X (meaning don't care). When minimizing an X is like a
"joker" , “X” can be 0 or 1, whatever helps best with the minimization

For instance:

This simplifies to B if “x” is assumed “1”. Therefore X = B

Don’t Care conditions should be changed to either “0” or “1” to


produce K-map looping that produced the simplest expression.
PROBLEM SET 27:

1. Minimize the following boolean function-

F(A, B, C, D) = Σm(1, 3, 4, 6, 8, 9, 11, 13, 15) + Σd(0, 2, 14)

2. Minimize the following boolean function:

F (A, B, C) = Σm (1, 2, 5, 7) + Σd (0, 4, 6)

3. Minimize the following boolean function:

F(A, B, C, D) = Σm(0, 2, 8, 10, 14) + Σd(5, 15)

4. Simplify the given Logical Equation

F = A`B`C`+A`BC` + ABC` d=A`B`C +A`BC + AB`C

G. SUMMARY

KARNAUGH MAP is a graphical method for representing a circuit’s truth table


and generating a simplified expression. Compared to the algebraic method,
the K-map process is a more orderly process requiring fewer steps and always
producing a minimum expression.

DON’T CARE entries in K map can take on values of 1 or 0. Therefore can be


exploited to help simplification.

You might also like