Sunteți pe pagina 1din 35

Karnaugh Maps

Another Way to Simplify Boolean


Equations
Part I
• You can use Boolean Algebra to simplify
your Boolean equations, but it’s not always
easy.
• In addition, how do you know when the
equation has been simplified as much as
possible?
• Just like in regular algebra, it’s often hard
to know if an expression can be simplified
further or not.
• So we’re going to learn a new technique:
Karnaugh Maps
• This technique, developed by Maurice
Karnaugh, a telecommunications engineer
for Bell Labs in 1953, is another method of
simplifying a Boolean expression.
• If you do it correctly, using Karnaugh Maps
will give you the simplest possible sum-of-
product form of the equation.
A B C X
In an earlier presentation,
we looked at an example of 0 0 0 0
a buzzer in a car. Later, we 0 0 1 0
simplified that equation 0 1 0 1
using Boolean Algebra. 0 1 1 1
Now, let’s try simplifying it
1 0 0 0
using our new technique:
Karnaugh Maps. 1 0 1 0
1 1 0 1
1 1 1 0
• This is a Karnaugh C
Map for a 3-input AB 0 1
equation.
• There are eight 00
boxes, one for each
line of the truth table.
01
• Note that AB counts
in an unusual order –
00, 01, 11, 10. 11

10
Go down the truth table, and put the value of
X in the corresponding box in the Karnaugh
Map.
C
AB 0 1
A B C X
0 0 0 0 00 0 0
0 0 1 0
0 1 0 1 1 1
0 1 1 1
01
1 0 0 0
11 1 0
1 0 1 0
1 1 0 1
10 0 0
1 1 1 0
C
• We’ve now completed AB 0 1
step 1 – transfer the
outputs from the truth 00 0 0
table to the Karnaugh
Map.
01 1 1
• Now it’s time for the
next step – drawing
loops around all of the 11 1 0
1’s in the map.
10 0 0
C
What we’ve got to do AB 0 1
now is draw loops
around all of the 1’s in 00 0 0
the map. But before
we do this, let’s
01 1 1
review the rules for
drawing loops.
11 1 0

10 0 0
• All 1’s must be included in at least one loop.
• Draw the fewest loops possible.
• All loops must contain 2n (1, 2, 4, 8) 1’s.
• All loops must be “rectangular” in shape.
• Draw the largest loops possible.
• A 1 may be included in more than one loop in
order to create larger and fewer loops.
• An X is a “don’t care”, and may be circled if it
helps create larger or fewer loops.
• The top of the map “touches” the bottom; on a
4-input map, the right also “touches” the left.
All 1’s must be included in at least one loop.

All of the 1’s on the map must be in a


loop. You can’t leave any of them out.
Draw the fewest loops possible.

Each loop we draw will correspond to one


term in our equation. So the fewer loops
we draw, the fewer the terms in the
equation, and the simpler our circuit will
be.
All loops must contain 2n (1, 2, 4, 8) 1’s.

You can’t put 3 1’s in a loop. You can


put 1, 2, or 4, but not 3. Nor can you put
5, 6, or 7 1’s in a loop. But the most
important thing is to remember that you
cannot have three 1’s in a loop.
All loops must be “rectangular” in shape.

What I mean here is that there should be no


odd shapes like those below.

No diagonals No “L” shapes No “T” shapes


Draw the largest loops possible.

Larger loops lead to simpler terms than


smaller loops. So you always want to make
the loops as large as you can.
A 1 may be included in more than one loop in
order to create larger and fewer loops.

Suppose you have 6 1’s


together. You can’t put all 6 in
1 1
one loop, so you loop 4 together. 1 1
Now do we loop the other two
together?
1 1
No! We can create a larger loop
by looping 4 together, even
though 2 are already in a loop.
An X is a “don’t care”, and may be circled if it
helps create larger or fewer loops.

Sometimes there’s a case in the truth table


where you don’t care what the output is, or
maybe it’s a case that you know won’t ever
occur.
These are shown with an X in the truth table
and map. You can circle them if it helps you
draw fewer and larger loops, but you don’t
have to include them in the loops.
The top of the map “touches” the bottom; on a 4-
input map, the right also “touches” the left.

These two 1’s can be put into 1


one single loop.

1
The top of the map “touches” the bottom; on a 4-
input map, the right also “touches” the left.

These four 1’s can be put into 1 1


one single loop.

1 1
The top of the map “touches” the bottom; on a 4-
input map, the right also “touches” the left.

Later, when we do 4 input


maps, we’ll be able to put 1 1
these two 1’s into one single
loop.
The top of the map “touches” the bottom; on a 4-
input map, the right also “touches” the left.

Later, when we do 4 input


maps, we’ll be able to put
these four 1’s into one single
1 1
loop. 1 1
The top of the map “touches” the bottom; on a 4-
input map, the right also “touches” the left.

With 4 input maps, there’s a 1 1


special case where the four
corners can be put into one
single loop.
1 1
C
Now, back to our AB 0 1
example. We need to
draw loops around 00 0 0
the 1’s.
Since we have three 1 1
1’s, it will take two 01
loops.
To make the largest 11 1 0
loops possible, both
loops will include two
1’s. 10 0 0
C
Let’s take the red loop AB 0 1
first, and write down A,
B, and C for each 1 00 0 0
inside this loop.
01 1 1
ABC
010
11 1 0
011
10 0 0
C
Since A is 0 for this
AB 0 1
loop, we write down
not A.
00 0 0
ABC
010 01 1 1
011
11 1 0
A 0 0
10
C
Since B is 1 for this
AB 0 1
loop, we write down B
with no bar.
00 0 0
ABC
010 01 1 1
011
11 1 0
AB 0 0
10
Since C is both 0 and 1 C
inside this loop, we can AB 0 1
drop the C altogether.
00 0 0
ABC
010 01 1 1
011
11 1 0
This is the
AB term for the
0 0
red loop. 10
C
Now let’s take the blue AB 0 1
loop and write down A,
B, and C for each 1 00 0 0
inside this loop.
01 1 1
ABC
010
11 1 0
110
10 0 0
C
Since A is both 0 and 1
AB 0 1
inside this loop, we
can drop the A.
00 0 0
ABC
010 01 1 1
110
11 1 0

10 0 0
C
Since B is 1 for this
AB 0 1
loop, we write down B
with no bar.
00 0 0
ABC
010 01 1 1
110
11 1 0
B 0 0
10
Since C is 0 for this loop, C
we write C with a bar. AB 0 1
00 0 0
ABC
010 01 1 1
110
11 1 0
This is the
BC term for the
0 0
blue loop. 10
We have finished determining the terms for
each loop, so we can now write our final
equation.

X = A B + BC
If you apply Karnaugh Maps correctly, your
solution will be the simplest possible solution
in sum-of-products form.
It might be possible to simplify slightly by
taking it out of SOP form, but it isn’t really
necessary.
X = A B + BC
Here is the logic diagram that matches this
equation.

X
B
C
Let’s review the steps involved in simplification
using Karnaugh Maps.
1. Copy the outputs from the truth table into a
Karnaugh Map.
2. Draw loops around all of the 1’s in the map,
following the rules to create the largest and
fewest loops possible.
3. Write the Boolean equation by writing one term
for each loop in the map.
In part 2, we’ll do some examples, and we’ll
learn how to draw a Karnaugh Map with four
inputs.

S-ar putea să vă placă și