You are on page 1of 11

Courses In Electrical Engineering

Volume II DIGITAL ELECTRONICS CHAPTER FOUR: KARNAUGH MAPPING

By J-P. NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon.

Digital Electronics_Jean-Paul NGOUNE

Chapter Four

KARNAUGH MAPPING
4.0 Specific objectives: At the end of this chapter, the student will be able to simplify Boolean expressions using Karnaugh mapping.

4.1 Introduction: Karnaugh map, like Boolean algebra is a simplification tool applicable to digital logic. Maurice Karnaugh, a telecommunication engineer developed the k-map at Bell labs in 1953 while designing digital logic based telephone switching circuits. K-map reduces logic functions more quickly and easily compared to Boolean algebra. By reduce we mean simplify, reducing the number of gates and inputs. K-map works well for up to six input variables (in this course we will study up to 4 input variables). For more than six variables, simplification should be done by CAD (Computer Automated Design). 4.2 Karnaugh maps, truth tables and Boolean expression: Karnaugh map is filled using Gray code. As we have already seen in the first chapter, Gray code is a numeration code which is such that, in a given Gray sequence, each number differs from the next or the previous number only with one bit. In order to know how to generate a Gray sequence of number, please go back to the first chapter which treated the matter of numeration systems and codes.

4.2.1 Transferring the content of a truth table into a k-map: Let us consider the following truth table: A 0 0 1 1 B 0 1 0 1 X 0 1 0 1

Digital Electronics_Jean-Paul NGOUNE

The content of the truth table can be transferred to the truth table as follow: X
B A

0 0 0

1 1 1

Top

0 1 Side

The logic states of the output are written in the table according to the combination of the input variable A and B. Each location of the table corresponds to one logic state of the output. So we have four locations here because we have four output combinations according to our truth table. The logic states of the inputs A and B are filled using Gray code. To determine the simplified Boolean expression of the output, we should follow the following steps: Look for adjacent cells; that is above or to the side of a cell. Diagonal cells are not adjacent. Circle the two adjacent ones. Find the variables top and/or side which are the same for the group. It is the variable B in our case. It means that, as we can notice, for the group of ones, the variables B remains unchanged and equal to 1. Write this as the Boolean result. Ignore variables which are not the same for the cell group. In our case, A varies. It is both 1 and 0. So A should be ignored; it cannot be written as Boolean result. Ignore any variable not associated with cells containing ones. Then the Boolean expression of the output is: X = B

Digital Electronics_Jean-Paul NGOUNE

Exercise 4.1: Consider the following logic diagram:


A B

a. Establish the truth table of the circuit. b. Give the Boolean expression of the output using SOP (Sum of products) method. c. Give the simplified Boolean expression of the output using K-map.

Exercise 4.2: For each of the following truth table, write the Boolean expression of the output using k-maps. A 0 0 1 1 B 0 1 0 1 X 1 1 0 0 A 0 0 1 1 B 0 1 0 1 X 0 1 1 1

A 0 0 1 1

B 0 1 0 1

X 1 0 1 1

A 0 0 1 1

B 0 1 0 1

X 1 1 0 1

Digital Electronics_Jean-Paul NGOUNE

Remark 4.1: How to determine the Boolean expression of a gate circuit. Write the Boolean expression of the output using SOP method; Transfer the product terms to the k-map; Form groups of adjacent cells; Deduce simplified Boolean expression of the output. Draw the simplified logic circuit.

Example 4.1: Let us determine the simplified Boolean expression of the following circuit using kmap.
A B

Using the SOP method the Boolean expression of the output can be written as follow:

X = AB + AB
X
B A

The expression can then be transfer in a k-map:

0 0 1

1 1 0

0 1

It is not possible to form groups of adjacent ones. The two ones of the k-map are isolated. No simplification is therefore possible. The Boolean expression should be left as it is.

X = AB + AB = A B

Digital Electronics_Jean-Paul NGOUNE

This is not a simplified expression. This simplification is just intended to make a schematic diagram look nicer. In fact exclusive-or function is a combination of other functions. 4.2.2 Logic simplification with Karnaugh map: Boolean simplification that we have done above could be achieved with Boolean algebra quickly. Real world logic simplification problems call for larger kmaps so that we may do serious work. We will now develop tools that we need for more complex application in combinatory logic. 4.2.2.1 General method These are the steps which should be followed for the simplification of a Boolean expression using Karnaugh mapping. Draw the k-map filling the ones and the zeros in the corresponding cells; Observe with attention the k-map and detect the ones which are isolated: those are the ones that are not adjacent to another one. Circle them. Find the ones which are adjacent only to one another one. Circle them to form groups of two ones. Find groups one eight ones which are adjacent and circle them, even if among them there are ones belonging already to a group of two ones. Find groups of four adjacent ones and circle them. Among the four ones there should be at least one one which has not yet been grouped. Then deduce the simplified Boolean expression.

The following sizes of k-map will be used

X
CD AB

00

01

11

10

X
A

BC

00 00 01 11 10 01 11 10

0 1

K-map for 3 Boolean input variables

K-map for four Boolean input variables

Digital Electronics_Jean-Paul NGOUNE

As we have already said, the input logic states are filled using Gray code, so for instance, if we have two variables A and B, the Gray sequence will be: 00,01,11,10 (a binary sequence would have been 00,01,10,11!). 4.2.2.2 K-map for three input Boolean variables: Let us consider the following three variables Boolean expression.

X = A.B.C + A.B.C
This expression can be transferred in a k-map as follow: X
A BC

00 1 0

01 1 0

11 0 0

10 0 0

0 1

The simplified Boolean expression of the output can therefore be determined.

X = A.B
Exercise4.3: Simplify the following Boolean expressions using k-maps:

X = A.B.C + A.B.C + A.BC + A.B.C Y = A.B.C + A.BC + ABC + ABC Z = A.B.C + A.B.C + ABC + A.BC + ABC + ABC
Example 4.2: Let us simplify the following Boolean expression using k-map.

X = A.B.C + A.B.C + A.BC + A.B.C + A.B.C + ABC


The first step consists of filling the k-map. X
A BC

00 1 1

01 1 0

11 1 0

10 1 1

0 1

After grouping the ones, we can now deduce the simplified expression of the output:

X = A+C

Digital Electronics_Jean-Paul NGOUNE

4.2.2.3 K-map for four input Boolean variables: Let us consider the following Boolean expression:

X = A.BCD + A.BCD + ABCD + ABCD + ABC .D + ABC D + ABC D


This expression can be transferred in the k-map as follows:
X
CD AB

00 0 0 1 0

01 0 0 1 0

11 1 1 1 1

10 0 0 1 0

00 01 11 10

The simplified Boolean expression of the output can therefore be deduced:


X = AB + CD

Example 4.3: Consider the k-map bellow and give the simplified Boolean expression the output X:
X
CD AB

00 1 1 1 1

01 1 0 0 1

11 1 0 0 1

10 1 1 1 1

00 01 11 10

The simplified Boolean expression of the output is therefore determined:

X = B+D
Exercise 4.4: Simplify the following Boolean expression using k-map:
X = A.B.C.D + A..B.C .D + A B.C .D + A.B.C .D Y = A.B.C.D + A.B.C.D + A.B.CD + A.B.C .D + A.B..C.D + A.B.C.D + A B.CD + A.B.C .D

Digital Electronics_Jean-Paul NGOUNE

Remark 4.2: Condition of indifference Some logic circuits are conceived in such a way that for certain combination of input variables, the output is neither high nor low. In fact, those input combinations should never occur. In the k-maps, the cells representing those combinations are filled with a X. Let us consider for instance the following truth table:

X
A

BC

00 0 0

01 0 X

11 1 1

10 We deduce that X 1 X=B

0 1

4.3 Conclusion: This chapter has permitted us to study Karnaugh mapping which is used for an easier simplification of Boolean expression. It is one of the most important tools that should be deeply understood in order to succeed in the study of combinatory logic circuit. The next chapter will be focused on the study of digital arithmetic. That is, on how digital systems perform arithmetical operations such as addition, subtraction, multiplication and division.

REVIEW QUESTIONS
1. Simplify the following Boolean expressions using k-maps:

Y = B +C B+C + A+ B+C

( ( ) ) Z = (C + D + AC D + AB.C + A..BCD + A.C.D )


S = ABCD + A..B.C .D + A.B.C D + A.B.C.D + A.BCD + ABC.D + ABC D + ABC D + ABCD

X = A.B.C + A.BC + ABC + AB.C + A.B.C

T = ABC + ABC + ABC + ABC

Digital Electronics_Jean-Paul NGOUNE

2. For each of the following k-maps, determine the Boolean expression of the output X.
X
CD AB

X
CD

00 1 0 0 0

01 1 1 1 0

11 0 1 1 0

10 1 0 0 1

AB

00 1 1 1 1

01 1 1 1 1

11 1 0 0 0

10 1 1 1 1

00 01 11 10

00 01 11 10

X
CD AB

X
CD

00 0 0 1 0

01 0 0 1 1

11 1 0 1 1

10 0 0 1 0

AB

00 1 0 0 1

01 1 1 0 0

11 1 1 0 0

10 1 0 0 1

00 01 11 10

00 01 11 10

X
A

BC

00 0 0

01 1 1

11 1 1

10 0 0

BC A

00 0 0

01 0 1

11 1 1

10 0 1

0 1

0 1

X
A

BC

00 1 1

01 1 0

11 1 0

10 1 1

BC A

00 1 0

01 0 1

11 1 0

10 0 1

0 1

0 1

Digital Electronics_Jean-Paul NGOUNE

10

References: 1. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition, Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985. 2. Lessons In Electric Circuits Volume IV Digital, Tony R. Kuphaldt, Fourth Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits. 3. Cours de systmes logiques, Notes de cours, Premire anne du gnie lectrique, ENSET de Douala, J.C Tsokezo, 2004-2005.

Digital Electronics_Jean-Paul NGOUNE

11

You might also like