Karnaugh Maps

57
Karnaugh Maps By: Shakil Nobes

description

Karnaugh Maps. By: Shakil Nobes. History of Karnaugh Maps. The Karnaugh map was invented in 1952 It was invented by Edward W. Veitch It was then developed further in 1953 by Maurice Karnaugh. What’s the purpose to Karnaugh Maps?. - PowerPoint PPT Presentation

Transcript of Karnaugh Maps

Page 1: Karnaugh Maps

Karnaugh Maps

By: Shakil Nobes

Page 2: Karnaugh Maps

History of Karnaugh Maps

• The Karnaugh map was invented in 1952 • It was invented by Edward W. Veitch • It was then developed further in 1953 by

Maurice Karnaugh

Page 3: Karnaugh Maps

What’s the purpose to Karnaugh Maps?

• Normally, extensive calculations are required to obtain the minimal expression of a Boolean function

• The Karnaugh map reduces the needs for all these calculations

• It decides which terms should be combined to obtain the simplest expression.

• It Helps to teach about Boolean functions and minimization.

Page 4: Karnaugh Maps

What does it look like?

Y Z W X

Page 5: Karnaugh Maps

How does it work exactly?

1. Design your truth table2. Put your numbers into your Karnaugh Map3. Box your 1’s4. Create your equation5. Draw your diagram

Page 6: Karnaugh Maps

I don’t get it????

Here’s an example: Lets say I wanted to take a bunch of LED’s and

line them up to make an 8. Ex.

Page 7: Karnaugh Maps

Now I want to make it so when I flick on a switch, the light turns onto 1 like this:

So If I have 4 switches, and I want to make a 1 appear I flick

switch 1. If I want to make 2 appear I

have to flick switch 2. But If I want to make 3 appear, I have to flick switch

1 and 2 because 1+2=3, and there’s no switch 3. Another example is there’s no 7

so I have to flick switch 3,2 and 1 because 3+2+1=7.

Page 8: Karnaugh Maps

Easy Enough?

Well there’s still lots more. So lets say I wanted to design that with all 4 switches and the LED’s. Well first I have to set each set of LED’s to a assigned letter.

So the top 3 LED’s are set to A. The middle 3 LED’s are set to D. So on and so forth…

A

BCD

E F

G

Page 9: Karnaugh Maps

Designing a truth Table

• So now we need to design a truth table for each letter. Let’s start with letter A, the top 3 LED’s. So we know that when we the input is zero, the output is zero. So A is included in the number zero because all the lights go around the outside. The only letter that wouldn’t be included in zero is D because D is not lit up when zero is the output or else it would make it the number 8!

Page 10: Karnaugh Maps

Truth Table for A

0123456789

W X Y Z ASo to the left here we have a truthTable for A. Because we have 4 Switches, we are going to assign each Input a different letter. W, X, Y, and Z.On the output side, we have 0-9. As you can see were using binary code. 0000 is 0. 0001 is 1. 0010 is 2. 0011 is 3 And so on… So when the output is zero, we know thatA is on so we put a 1 there. When the Output is one, we know that A is not lit upSo we put a 0. When the output is Two we know A is lit up so we put a 1 and so on…

0000000011

OUTPUT INPUT

0000111100

0011001100

0101010101

Page 11: Karnaugh Maps

Final Truth Table for A

0123456789

W X Y Z A

0000000011

OUTPUT INPUT

0000111100

0011001100

0101010101

1011011111

So when the output is one and four, A is both off and for the rest A is all on.

Page 12: Karnaugh Maps

The Hard Part

Now here is where Karnaugh maps kick in. We now take our truth table and insert it into the Karnaugh map.

Page 13: Karnaugh Maps

How does the Karnaugh Map work?

Well the way we designed the Karnaugh Map, we will read WX, YZ. So we relate back to our truth table. When W and X are both 0, and Y and Z are both zero, the outputIs 1. So we fill a one into the box

Y Z W X

Page 14: Karnaugh Maps

How does the Karnaugh Map work?

Well the way we designed the Karnaugh Map, we will read WX, YZ. So we relate back to our truth table. When W and X are both 0, and Y and Z are both zero, the outputIs 1. So we fill a one into the box.

Y Z W X

1

Page 15: Karnaugh Maps

How does the Karnaugh Map work?

W XWell the way we designed the Karnaugh Map, we will read WX, YZ. So we relate back to our truth table. When W and X are both 0, and Y and Z are both zero, the outputis 1. So we fill a one into the box.

We now go to the next one down, When W is 0, X is 0, Y is 0 and Z is 1, the output is 0. So we fill in a 0 there.

Y Z1

W X

Page 16: Karnaugh Maps

How does the Karnaugh Map work?

W XWell the way we designed the Karnaugh Map, we will read WX, YZ. So we relate back to our truth table. When W and X are both 0, and Y and Z are both zero, the outputis 1. So we fill a one into the box.

Y Z1

0

W X

We now go to the next one down, When W is 0, X is 0, Y is 0 and Z is 1, the output is 0. So we fill in a 0 there.

Page 17: Karnaugh Maps

How does the Karnaugh Map work?

We now go and fill in the rest of The boxes. Y Z

1

0

W X

Page 18: Karnaugh Maps

How does the Karnaugh Map work?

Y ZWe now go and fill in the rest of The boxes.

Uh Oh. We ran into a problem. There’s no 1100! So if you don’t have a value in the truth table, you fill it withan x. Like so…

1

0

1

1

1

1

1

0

W X

Page 19: Karnaugh Maps

How does the Karnaugh Map work?

Y ZWe now go and fill in the rest of The boxes.

Uh Oh. We ran into a problem. There’s no 1100! So if you don’t have a value in the truth table, you fill it withan x. Like so…

Now to fill in the rest of the values…

1

0

1

1

1

1

1

0

W X

x

Page 20: Karnaugh Maps

How does the Karnaugh Map work?

Y ZWe now go and fill in the rest of The boxes.

Uh Oh. We ran into a problem. There’s no 1100! So if you don’t have a value in the truth table, you fill it withan x. Like so…

Now to fill in the rest of the values…

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 21: Karnaugh Maps

How does the Karnaugh Map work?

Y ZSo now that we have all the valuesput in it’s onto the confusing part! We now have to make a box around all the ones. You cannot box zero’s and here are the restrictions:

Boxes cannot be 1 by 1, or 3 by anything. For example 3 by 2 like this…

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 22: Karnaugh Maps

How does the Karnaugh Map work?

Y ZSo now that we have all the valuesput in it’s onto the confusing part! We now have to make a box around all the ones. You cannot box zero’s and here are the restrictions:

Boxes cannot be 1 by 1, or 3 by anything. For example 3 by 2 like this… NOT ALLOWED!

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 23: Karnaugh Maps

How does the Karnaugh Map work?

Y ZSo now that we have all the valuesput in it’s onto the confusing part! We now have to make a box around all the ones. You cannot box zero’s and here are the restrictions:

Boxes cannot be 1 by 1, or 3 by anything. You may not make boxes diagonally, but you may match all 4 corners. You may also do this:

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 24: Karnaugh Maps

How does the Karnaugh Map work?

Y ZSo now that we have all the valuesput in it’s onto the confusing part! We now have to make a box around all the ones. You cannot box zero’s and here are the restrictions:

Boxes cannot be 1 by 1, or 3 by anything. You may not make boxes diagonally, but you may match all 4 corners. You may also do this:

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 25: Karnaugh Maps

How does the Karnaugh Map work?

Y ZSo now that we have all the valuesput in it’s onto the confusing part! We now have to make a box around all the ones. You cannot box zero’s and here are the restrictions:

Boxes cannot be 1 by 1, or 3 by anything. You may not make boxes diagonally, but you may match all 4 corners. You may also do this. You can join boxes from one side to the other…

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 26: Karnaugh Maps

How does the Karnaugh Map work?

Y ZTHE MOST IMPORTANT THING:

You want to make the biggest box youcan, making sure you box all the ones. You can use as many boxes as you want. You also can box a 1 twice. Also, thinkof x’s as 1’s. You can box them as many times as you want but it is not mandatoryto box all the x’s. They are there so youcan create bigger boxes with the 1’s.

So instead of doing this:

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 27: Karnaugh Maps

How does the Karnaugh Map work?

Y ZTHE MOST IMPORTANT THING:

You want to make the biggest box youcan, making sure you box all the ones. You can use as many boxes as you want. You also can box a 1 twice. Also, thinkof x’s as 1’s. You can box them as many times as you want but it is not mandatoryto box all the x’s. They are there so youcan create bigger boxes with the 1’s.

So instead of doing this:

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 28: Karnaugh Maps

How does the Karnaugh Map work?

Y ZTHE MOST IMPORTANT THING:

You want to make the biggest box youcan, making sure you box all the ones. You can use as many boxes as you want. You also can box a 1 twice. Also, thinkof x’s as 1’s. You can box them as many times as you want but it is not mandatoryto box all the x’s. They are there so youcan create bigger boxes with the 1’s.

So instead of doing this. You want to do this:

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 29: Karnaugh Maps

How does the Karnaugh Map work?

Y ZYou want to do this because youare trying to create the biggest boxyou can. The bigger the box, the less work!

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 30: Karnaugh Maps

How does the Karnaugh Map work?

Y Z

ANOTHER IMPORTANT THING:

Lots and lots of people make boxesthat are by 3! Make sure you do not makeboxes that are 3 by 1, 3 by 2, 3 by 3 and soon!

Now try and get all the ones into boxes!Remember you can use as many boxesas you like! Also you can box x’s and 1’s asmany times as you like!

1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Page 31: Karnaugh Maps

How does the Karnaugh Map work?

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1 So I used the 4 corners, a 2 by 2 box in the middle, the 2 by 4 box and the bottomand another 2 by 4 box on the far right side. That includes all the ones, and the biggest boxes I can make!

Page 32: Karnaugh Maps

Creating the formula

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

This is what everyone gets confused aboutat first, but eventually you will get the hang of it!

So let’s start with our 4 corners. W is under 0 and 1. Don’t get it? Look:

Page 33: Karnaugh Maps

Creating the formula

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

This is what everyone gets confused aboutat first, but eventually you will get the hang of it!

So let’s start with our 4 corners. W is under 0 and 1. Don’t get it? Look:

Page 34: Karnaugh Maps

Creating the formula

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

This is what everyone gets confused aboutat first, but eventually you will get the hang of it!

So let’s start with our 4 corners. W is under 0 and 1. See how W is represented by the first numbers. So we are not using the 2middle columns because there’s no boxes going vertically in that row. So for X it would be 0 and 0.

Page 35: Karnaugh Maps

Creating the formula

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

This is what everyone gets confused aboutat first, but eventually you will get the hang of it!

So let’s start with our 4 corners. W is under 0 and 1. See how W is represented by the first numbers. So we are not using the 2middle columns because there’s no boxes going vertically in that row. So for X it would be 0 and 0. For Y it would be 0 and 1.

Page 36: Karnaugh Maps

Creating the formula

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

This is what everyone gets confused aboutat first, but eventually you will get the hang of it!

So let’s start with our 4 corners. W is under 0 and 1. See how W is represented by the first numbers. So we are not using the 2middle columns because there’s no boxes going vertically in that row. So for X it would be 0 and 0. For Y it would be 0 and 1. For Z it would be 0 and 0.

Page 37: Karnaugh Maps

Creating the formula

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Make sense? Well now we create the formula for that box. To do that, we take W and X and we see W is 0 and 1 and X is 0 and 0. X is 0 and 1. Because we have a mismatch with X (0,1) we don’t use it. W is (0,0), so weadd a W to our formula. But because the Wis zero’s, we label W as W ‘ (W invert).

Now we go to our Y and Z. Y is 0 and 1 so we don’t use it. Z is 0 and 0 so we do. It would be labeled Z ‘. Because we are still doingone whole box, we take W’ and Z’ and multiply them together to make

W’ Z’

That is our formula so far. Onto the next box.

Page 38: Karnaugh Maps

How does the Karnaugh Map work?

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1Let’s take the bottom 4 by 2 box. We start with W and X. W is 0,0,1,1. This meansthat the zero’s and the 1’s cancel each other out so we don’t use W. X is the same thing.0,0,1,1. The 0’s and 1’s cancel each other out so we don’t use X either. Now onto Y and Z. Y is 1 and 1! This is a match. So now we useY in our formula. Because Y is two 1’s, it’s justleft as Y. You only invert when you have 2 zero’s. Now onto Z. Z is 1 and 0. MISMATCH! So we don’t use Z.

So in our formula now we have X ‘ Z’ and Y. Because we have switched to a different box for Y, we put a plus sign in whenever we switch boxes. So our currentformula is X ‘ Z’ + Y

Page 39: Karnaugh Maps

How does the Karnaugh Map work?

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Let’s move on to our next box. We seethat W is 1 and 1 so we use it! X is 1 and 0so we don’t use it. Y and Z are both 1,1,0,0so we don’t use both Y and Z. So for this box we only use W, just like in the last2 by 4 box we only used X. So our currentformula is:

X ‘ Z ‘ + Y + W

Page 40: Karnaugh Maps

How does the Karnaugh Map work?

Y Z1

0

1

1

1

1

1

0

W X

x

x

x

x

x

x

1

1

Now onto our last box! We see thatW is 0,1 so we don’t use it. X is 1,1 so we use it. Y is 0,1 so we don’t use it. And Z is 1,1 so we use it! Because we are in the same box still we take the X and Z andput them together to make X Z.

So our final formula is X ‘ Z’ + Y + W + X Z

Page 41: Karnaugh Maps

Now to take it to logic gatesSo our current formula is X ‘ Z’ + Y +W + X Z. So let’s start by creating our four switches, and labeling them 1, 2, 4 and 8 (Z would be 1 and Y would be 2 and so on because our truth table tells us so)

Page 42: Karnaugh Maps

Now to take it to logic gatesSo lets start with X ‘ Z ‘. We first have to invert X and Invert Z. So we haveto use 2 NOT gates to invert them. So our logic gates will look like this:

Page 43: Karnaugh Maps

Now to take it to logic gatesWe now have to multiply X ’ and Z ’ together to make them X ‘ Z ‘. We do this with an AND gate:

Page 44: Karnaugh Maps

Now to take it to logic gatesWe now have to add our X ‘ Z ’ to Y. We do this with an OR Gate:

Page 45: Karnaugh Maps

Now to take it to logic gatesWe now have to add our X ‘ Z ’ + Y to the W. We do this with another OR Gate:

Page 46: Karnaugh Maps

Now to take it to logic gatesWe now have to add our X ‘ Z ’ + Y + W to X Z. First we have to take X and Z and multiply them together with an AND gate:

Page 47: Karnaugh Maps

Now to take it to logic gatesNow we have to take our XZ and add it to our X ‘ Z ‘ + Y + W. We do this with aOR Gate.

Page 48: Karnaugh Maps

Now to take it to logic gatesNow we take the whole circuit we made and attach it to the A part of our LED’s:

Page 49: Karnaugh Maps

You have now completed A

• Wow that was a lot of work! Now your have to do that for B, C, D, E, F and G! I’ll post my circuit diagrams for you guys to check…

Page 50: Karnaugh Maps

Note

• My 6’s have a stick at the top (it uses A) my nines have a stick at the bottom (it uses G). Also my 7 only uses A,B and F.

Page 51: Karnaugh Maps

LED BX ‘ Z ‘ + Y ‘ Z ‘ + Y Z + W

Page 52: Karnaugh Maps

LED CY ‘ + Z ‘ X

Page 53: Karnaugh Maps

LED DX ‘ Y + Y Z ‘ + W + Y ‘ X

Page 54: Karnaugh Maps

LED EY Z ‘ + X ‘ Z ‘ + W ‘ X ‘ Y ‘

Page 55: Karnaugh Maps

LED FY Z + T ‘ Z ‘ + X + W

Page 56: Karnaugh Maps

LED GX ‘ Z ‘ + Y Z ‘ + Y W ‘ X ‘ + W + X Y ‘ Z

Page 57: Karnaugh Maps

Now you know all about Karnaugh Maps

• Programs used: Multimedia Logic and Microsoft PowerPoint