Presentation is loading. Please wait.

Presentation is loading. Please wait.

Karnaugh Maps.

Similar presentations


Presentation on theme: "Karnaugh Maps."— Presentation transcript:

1 Karnaugh Maps

2 Boolean algebra can be represented in a variety of ways. These include:
Boolean expressions Truth tables Circuit diagrams Another method is the Karnaugh Map (also known as the K-map) K-maps are particularly useful for simplfying boolean expressions What are karnaugh maps?

3 2 variable K-Map Starting with the Expression: A ∧ B
As a Truth Table this would be: As a Circuit Diagram this would be: A K-Map, will be a small grid with 4 boxes, one for each combination of A and B. Each grid square has a value for A and a value for B. To complete the K-Map for the expression, you find the box in the row where A is true and the column where B is true, put a 1 in the box that is in both rows. A B A ∧ B 1 2 variable K-Map 1

4 One way to view a K-Map is to figure out what the ‘address’ is for each box:
what its A and B values are for each position These have been written in the format (A, B) (0,0) (0,1) (1,0) (1,1) 2 variable K-Map

5 2 variable K-Map To create a K-map for the expression: A
Place 1s in all the boxes in the row where A is true 2 variable K-Map

6 2 variable K-Map To create a K-Map for the expression B
Place 1s in all the boxes in the column where B is true 2 variable K-Map

7 2 variable K-Map Expression: ~A ∧ B
Find the row where A is false and the column where B is true Place a 1 in the overlapping position 1 2 variable K-Map

8 2 variable K-Map Try working backwards!
Starting with the K-Map, interpret the results and write an expression Highlight the row that contains the 1 Is it A or ~A? Highlight the column that contains the 1 Is it B or ~B? Write down your two variables and join them with an AND (∧) 2 variable K-Map 1

9 2 variable K-Map Try working backwards!
Starting with the K-Map, interpret the results and write an expression Highlight the row that contains the 1 Is it A or ~A? Highlight the column that contains the 1 Is it B or ~B? Write down your two variables and join them with an AND (∧) 2 variable K-Map 1 1

10 In a 3 variable K-Map, we need to accommodate 8 possible combinations of A, B and C
We’ll start by figuring out the ‘address’ for each position (A, B, C) (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,1,0) (1,1,1) (1,0,0) (1,0,1) 3 variable K-Map

11 3 variable K-Map If we had a K-Map where the expression was B
We would place 1s in every box where B is true We ignore the values of A and C, because they are not written in our expression 3 variable K-Map 1 1 1

12 3 variable K-Map ~A ∧ C Create a K-map for the expression:
Highlight rows where A is false Highlight columns where C is true Place 1s in all the overlapping boxes Note: We can ignore the values of B, because they are not mentioned in the expression 1 3 variable K-Map

13 3 variable K-Map To create the K-Map for the expression A ∧B∧~C
Highlight rows where A is true Highlight rows where B is false Highlight columns where C is false Place 1s in all the overlapping boxes 3 variable K-Map

14 This time we’ll start with a K-map and find the expression.
Identify any groupings (in this case we have a pair) What is the value of A for both items in the pair? What is the value of B for both items in the pair? What is the value of C for both items in the pair? 1 3 variable K-Map

15 This time we’ll start with a K-map and find the expression.
Identify any groupings (in this case we have a pair) What is the value of A for both items in the pair? What is the value of B for both items in the pair? What is the value of C for both items in the pair? Because B is both true and false, it does not affect the answer and can be ignored 1 ~A ∧ C 3 variable K-Map

16 3 variable K-Map Determine the expression represented by this K-map
Identify any groupings What is the value of A for both items in the pair? What is the value of B for both items in the pair? What is the value of C for both items in the pair? 3 variable K-Map 1

17 3 variable K-Map Determine the expression represented by this K-map
Identify any groupings (I see two pairs) What is the value of A for both items in the first pair? What is the value of B for both items in the first pair? What is the value of C for both items in the first pair? First Pair: What is the value of A for both items in the second pair? What is the value of B for both items in the second pair? What is the value of C for both items in the second pair? Second Pair: Put brackets around each pair and combine them with an OR 1 1 3 variable K-Map 1

18 3 variable K-Map Working backwards to build an expression First Pair:
Identify any groupings (I see two pairs) What are the value of A, B, C values for the first pair? What are the value of A, B, C values for the second pair? First Pair: Second Pair: Put brackets around each pair and combine them with an OR 1 3 variable K-Map 1

19 3 variable K-Map Working backwards to build an expression
Identify any groupings (I see two pairs) When I look more closely, I can see they are both ~B, so perhaps I can view it as a group of 4 What are the value of A, B, C values for the group? 1 1 3 variable K-Map 1 1

20 K-Map Notes Some notes to add at this point:
Groupings can only be exact binary values: 1, 2, 4, 8 You cannot have a groupings of 3 Groups can overlap The bigger the groupings, the simpler the resulting expression/circuit When converting from a truth table to a K-Map, simply use the values in the TT to find the position values within the K-Map K-Map Notes

21 In a 4 variable K-Map, we need to accommodate 16 possible combinations of A, B, C and D
We’ll start by figuring out what the ‘address’ for each position (A, B, C, D) (0,0,0,0) (0,0,0,1) (0,0,1,1) (0,0,1,0) (0,1,0,0) (0,1,0,1) (0,1,1,1) (0,1,1,0) (1,1,0,0) (1,1,0,1) (1,1,1,1) (1,1,1,0) (1,0,0,0) (1,0,0,1) (1,0,1,1) (1,0,1,0) 4 variable K-Map

22 4 variable K-Map If we had a K-Map where the expression was D
We would place 1s in every box where D is true We ignore the values of A, B and C, because they are not written in our expression 4 variable K-Map

23 If we had a K-Map where the expression was: A ∧ ~B ∧ ~C ∧ ~D
We would highlight the Rows where A is true Rows where B is false Columns where C is false Columns where D is false place 1s in all the overlapping boxes (When you have all 4 variables in your expression, it will only result in a single value in the K-Map) 1 4 variable K-Map

24 4 variable K-Map If we had a K-Map where the expression was: (A ∧D)
We highlight the: Rows where A is true Columns where D is true Put 1s in all overlapping boxes 4 variable K-Map

25 If we had a K-Map where the expression was: (A ∧B) ∨(B∧C ∧~D)
We would work with one pair at a time. For each part of the expression: Identify the overlapping boxes Place 1s in them We have resulted in a: Group of 4 Pair 1 4 variable K-Map

26 4 variable K-Map Working backwards
Identify any groupings (I see a group of 4) What is the value of A for the items in the group? What is the value of B for the items in the group? What is the value of C for the items in the group? What is the value of D for the items in the group? 4 variable K-Map

27 4 variable K-Map Working backwards
Identify any groupings (I see a group of 4 and a pair) What are the values of A, B, C and D for the group? What are the values of A, B, C and D for the pair? Solution 4 variable K-Map

28 Often we are asked to write an expression based on a truth table, this can result in pretty complicated expressions that require simplification using logic laws Using a K-Map can aid the simplification process K-Maps & Truth Tables

29 K-Maps & Truth Tables Let’s start with a Truth Table
To build an expression we would normally write an expression (using AND’s) for each row resulting in true and combine those with ORs This produces a really big expression that will be difficult to simplify using the logic laws A B C Solution 1 (~A∧~B∧C)∨(~A∧B∧C)∨(A∧~B∧C)∨(A∧B∧~C)∨(A∧B∧C) K-Maps & Truth Tables

30 Rather than converting straight to an expression, let’s try placing the values in a Karnaugh Map.
Place 1s in the appropriate positions, according to the Truth Table This highlights a group of 4 and a pair From this we can write a simpler expression A B C Solution 1 1 K-Maps & Truth Tables

31 Practise, Practise, Practise
The best way to learn how to work with K-Maps is to apply your new knowledge to some Karnaugh Maps worksheets Practise, Practise, Practise


Download ppt "Karnaugh Maps."

Similar presentations


Ads by Google