Maurice Karnaugh The Karnaugh map makes it easy to minimize Boolean - - PowerPoint PPT Presentation

maurice karnaugh
SMART_READER_LITE
LIVE PREVIEW

Maurice Karnaugh The Karnaugh map makes it easy to minimize Boolean - - PowerPoint PPT Presentation

Maurice Karnaugh The Karnaugh map makes it easy to minimize Boolean expressions! William Sandqvist william@kth.se A function of four variables a b c d. The truthtable consists of 11 "1" and 5 "0". According to earlier, we


slide-1
SLIDE 1

William Sandqvist william@kth.se

Maurice Karnaugh

The Karnaugh map makes it easy to minimize Boolean expressions!

slide-2
SLIDE 2

William Sandqvist william@kth.se

A function of four variables a b c d.

Anyone who used the Boolean algebra know that it then follows hard work to produce simpler expressions. Minterms could be combined in many different ways, which all result in different simplified expression - How do we know that we have found the minimal expression? The truthtable consists of 11 "1" and 5 "0". According to earlier, we know that the function can be expressed in the SoP form with 11 mintermer or PoS form with 5 maxtermer.

slide-3
SLIDE 3

William Sandqvist william@kth.se

A map with frames at unit distance

The Karnaugh map is the Truth Table but with the minterms in a different order. Note the numbering! The frames are ordered in such way that only one bit changes between two vertical frames or horisontal frames. This order is called Gray code.

slide-4
SLIDE 4

William Sandqvist william@kth.se

Two "neighbors"

The frames "5" and "13" are "neighbors" in the Karnaugh map ( but they are distant from each

  • ther in the truthtable ).

They correspond to two minterm with four variables, and the figure shows how, with Boolean algebra, they can be reduced to one term with three variables. What the two frames have in common is that b = 1, c = 0 and d = 1; and the reduced term expresses just that. Everywhere in the Karnaugh map where one can find two ones that are "neighbors" (vertically or horizontally) the minterms could be reduced to "what they have in common". This is called a grouping.

slide-5
SLIDE 5

William Sandqvist william@kth.se

Four "neighbors"

Frames "1" "3" "5" "7" is a group

  • f four frames with "1" that are

"neighbors" to each other. Here too, the four minterms could be reduced to a term that expresses what is common for the frames, namely that a = 0 and d = 1. Everywhere in Karnaugh map where one can find such groups

  • f four ones such simplifications can be done, grouping of four.
slide-6
SLIDE 6

William Sandqvist william@kth.se

Eight "neighbors"

All groups of 2, 4, 8, (... 2 N ie. powers of 2) frames containing ones can be reduced to a term, with what they have in common, grouping of n.

slide-7
SLIDE 7

William Sandqvist william@kth.se

Karnaugh - torus

The Karnaugh map should be drawn on a torus (a donut). When we reach an edge, the graph continnues from the opposite side! Frame 0 is the "neighbor" with frame 2, but also the "neighbor" with frame 8 which is "neighbor" to frame 10.

slide-8
SLIDE 8

The optimal groupings?

  • The resulting function is apparently a major simplification compared to the
  • rginal function with the 11 minterms.

One is looking for the bigest grouping as

  • possible. In the example,

there is a grouping with eight ones (frames 0,1,3,2,4,5,7,6). Corners (0,2,8,10) is a group of four ones. Two of the frames (0. 2) has already been included in the first group, but it does not matter if a minterm is included multiple times. All ones in the logic function must either be in a grouping, or be included as a minterm. The "1" in frame 13 may form a group with "1" in frame 5, unfortunately there are no bigger grouping for this "1".

William Sandqvist william@kth.se

slide-9
SLIDE 9

William Sandqvist william@kth.se

Incorrect groupings?

Is there any incorrect groupings in this Karnaugh diagrams?

slide-10
SLIDE 10

William Sandqvist william@kth.se

Groupings should be 2, 4, 8 (= power of two) "neighbors" vertikal or horisontal, not diagonal.

Incorrect groupings?

Is there any incorrect groupings in this Karnaugh diagrams?

slide-11
SLIDE 11

William Sandqvist william@kth.se

  • Ex. 6.1 Karnaugh map
slide-12
SLIDE 12

William Sandqvist william@kth.se

d b

  • Ex. 6.1 Karnaugh map
slide-13
SLIDE 13

William Sandqvist william@kth.se

d b abd

  • Ex. 6.1 Karnaugh map
slide-14
SLIDE 14

William Sandqvist william@kth.se

d b abd

d c a

  • Ex. 6.1 Karnaugh map
slide-15
SLIDE 15

William Sandqvist william@kth.se

d b abd

d c a

abd d c a d b f + + =

  • Ex. 6.1 Karnaugh map
slide-16
SLIDE 16

William Sandqvist william@kth.se

(Ex. 6.2 Karnaugh map)

slide-17
SLIDE 17

William Sandqvist william@kth.se

d b

(Ex. 6.2 Karnaugh map)

slide-18
SLIDE 18

William Sandqvist william@kth.se

d b abd

(Ex. 6.2 Karnaugh map)

slide-19
SLIDE 19

William Sandqvist william@kth.se

d b abd abc

(Ex. 6.2 Karnaugh map)

slide-20
SLIDE 20

William Sandqvist william@kth.se

d b abd abc

abc abd d b f + + =

(Ex. 6.2 Karnaugh map)

slide-21
SLIDE 21

William Sandqvist william@kth.se

Grouping of "0"

The Karnaugh map is also useful for groupings of 0's. The groupings may include the same number of frames as the case of groupings of 1's. In this example, 0: s are grouped together in pairs with their "neighbors". Maxterms are simplified to what is in common for the frames. The simplified expression is the product of three sums it represents a very substantial simplification of the original functins's five maxterms.

slide-22
SLIDE 22

De Morgan

If you use ”0” as if they were ”1” you will get the function inverted! (totally wrong) With De Morgans theorem you can invert the inverted function to get the result. (now correct)

  • Tip!

William Sandqvist william@kth.se

slide-23
SLIDE 23

William Sandqvist william@kth.se

Maps for other number of variables

Karnaugh maps with three and two variables are also useful. The Karnaugh map can conveniently be used for functions of up to four variables, and with a little practice up to six variables.

6

slide-24
SLIDE 24

Ex 6.4 change NOR to NAND

William Sandqvist william@kth.se

?

slide-25
SLIDE 25
  • Ex. 6.4

William Sandqvist william@kth.se

=

NOR-NOR to OR-AND change ”staight on!

slide-26
SLIDE 26
  • Ex. 6.4

William Sandqvist william@kth.se

) ( ) ( ) , , ( c b c a c b a f + ⋅ + =

=

slide-27
SLIDE 27
  • Ex. 6.4

William Sandqvist william@kth.se

) ( ) ( ) , , ( c b c a c b a f + ⋅ + =

=

slide-28
SLIDE 28
  • Ex. 6.4

William Sandqvist william@kth.se

slide-29
SLIDE 29
  • Ex. 6.4

William Sandqvist william@kth.se

b a c c b a f ⋅ + = ) , , (

slide-30
SLIDE 30
  • Ex. 6.4

William Sandqvist william@kth.se

b a c c b a f ⋅ + = ) , , (

slide-31
SLIDE 31
  • Ex. 6.4

William Sandqvist william@kth.se

b a c c b a f ⋅ + = ) , , (

=

AND-OR NAND-NAND change gates ”straight on”

slide-32
SLIDE 32
  • Ex. 6.4

William Sandqvist william@kth.se

b a c c b a f ⋅ + = ) , , (

=

!

No gate on this level

slide-33
SLIDE 33
  • Ex. 6.4

William Sandqvist william@kth.se

b a c c b a f ⋅ + = ) , , ( b a c b a c b a c ⋅ ⋅ = ⋅ + = ⋅ +

Or algebraic: Double invert = standard trick De Morgan

slide-34
SLIDE 34

William Sandqvist william@kth.se

slide-35
SLIDE 35

PLD-chip has output inverters

William Sandqvist william@kth.se

PLD circuits often have an XOR gate at the output so that they shall be able to invert the function. One can then choose to bring together 0s or 1s after what is most advantageous. When the control signal is a "1" the gates output is b's inverse, when a is "0", the output is equal to b

slide-36
SLIDE 36
  • Ex. 6.5 Minimize with the K-map

William Sandqvist william@kth.se

? ? ) 12 , 10 , 8 , 4 , 2 , ( ) , , , (

1 2 3

= = = ∑ f f m x x x x f

slide-37
SLIDE 37

William Sandqvist william@kth.se

? ? ) 12 , 10 , 8 , 4 , 2 , ( ) , , , (

1 2 3

= = = ∑ f f m x x x x f

  • Ex. 6.5 Minimize with the K-map
slide-38
SLIDE 38

William Sandqvist william@kth.se

? ? ) 12 , 10 , 8 , 4 , 2 , ( ) , , , (

1 2 3

= = = ∑ f f m x x x x f

  • Ex. 6.5 Minimize with the K-map
slide-39
SLIDE 39

William Sandqvist william@kth.se

? ? ) 12 , 10 , 8 , 4 , 2 , ( ) , , , (

1 2 3

= = = ∑ f f m x x x x f

  • Ex. 6.5 Minimize with the K-map
slide-40
SLIDE 40

William Sandqvist william@kth.se

? ? ) 12 , 10 , 8 , 4 , 2 , ( ) , , , (

1 2 3

= = = ∑ f f m x x x x f

Grouping of ”1” Grouping of ”0”

  • Ex. 6.5 Minimize with the K-map
slide-41
SLIDE 41

William Sandqvist william@kth.se

2 1

x x x x f + =

? ? ) 12 , 10 , 8 , 4 , 2 , ( ) , , , (

1 2 3

= = = ∑ f f m x x x x f

Grouping of ”1” Grouping of ”0”

  • Ex. 6.5 Minimize with the K-map
slide-42
SLIDE 42

William Sandqvist william@kth.se

2 1

x x x x f + =

? ? ) 12 , 10 , 8 , 4 , 2 , ( ) , , , (

1 2 3

= = = ∑ f f m x x x x f

Grouping of ”1” Grouping of ”0”

  • Ex. 6.5 Minimize with the K-map
slide-43
SLIDE 43

William Sandqvist william@kth.se

2 1

x x x x f + =

1 2

} "1" as 0" " { x x x f + = =

? ? ) 12 , 10 , 8 , 4 , 2 , ( ) , , , (

1 2 3

= = = ∑ f f m x x x x f

Grouping of ”1” Grouping of ”0”

  • Ex. 6.5 Minimize with the K-map
slide-44
SLIDE 44

William Sandqvist william@kth.se

2 1

x x x x f + =

1 2

} "1" as 0" " { x x x f + = = This time it was advantageous to group 0s and invert the output!

? ? ) 12 , 10 , 8 , 4 , 2 , ( ) , , , (

1 2 3

= = = ∑ f f m x x x x f

Grouping of ”1” Grouping of ”0”

  • Ex. 6.5 Minimize with the K-map
slide-45
SLIDE 45
  • Ex. 6.8 Don’t Care

William Sandqvist william@kth.se

? ? ) 15 , 6 ( ) 11 , 7 , 5 , 3 ( ) , , , (

1 2 3

= = + = ∑ f f d m x x x x f

Sometimes, problem is such that certain input combinations is "impossible" and therefore can not occur. Such mintermer (or maxtermer) one denotes man d ("do not care") and use them as ones

  • r zeros depending on what works best to get as big groupings as

possible. (A risk may be that what is thought to be "impossible" still occurs!? Therefore, it may often be better to take care of all combinations.)

slide-46
SLIDE 46
  • Ex. 6.8

William Sandqvist william@kth.se

? ? ) 15 , 6 ( ) 11 , 7 , 5 , 3 ( ) , , , (

1 2 3

= = + = ∑ f f d m x x x x f

Grouping of ”1” Grouping of ”0”

slide-47
SLIDE 47

William Sandqvist william@kth.se

? ? ) 15 , 6 ( ) 11 , 7 , 5 , 3 ( ) , , , (

1 2 3

= = + = ∑ f f d m x x x x f

2 3 1

x x x x x f + = Grouping of ”1” Grouping of ”0”

  • Ex. 6.8
slide-48
SLIDE 48

William Sandqvist william@kth.se

? ? ) 15 , 6 ( ) 11 , 7 , 5 , 3 ( ) , , , (

1 2 3

= = + = ∑ f f d m x x x x f

2 3 1

x x x x x f + =

  • Ex. 6.8

Grouping of ”1” Grouping of ”0”

slide-49
SLIDE 49

William Sandqvist william@kth.se

? ? ) 15 , 6 ( ) 11 , 7 , 5 , 3 ( ) , , , (

1 2 3

= = + = ∑ f f d m x x x x f

2 3 1

x x x x x f + =

1 3 1 2

x x x x x f + + =

  • Ex. 6.8

Grouping of ”1” Grouping of ”0”

slide-50
SLIDE 50

Alarm for vater tank

William Sandqvist william@kth.se

slide-51
SLIDE 51
  • Ex. 8.2

William Sandqvist william@kth.se

slide-52
SLIDE 52

William Sandqvist william@kth.se

  • Ex. 8.2
slide-53
SLIDE 53

William Sandqvist william@kth.se

Only the in-combinations X 0, 1, 3, 7, 15 can occur. All other in- combinations can be used as ”don’t care”. We can directly see from the table that u2 and x3 are same, u2 can be directly connected to x3. u2 = x3. The other expressions are obtained by using their Karnaugh maps.

  • Ex. 8.2
slide-54
SLIDE 54

William Sandqvist william@kth.se

  • Ex. 8.2

Only the in-combinations X 0, 1, 3, 7, 15 can occur. All other in- combinations can be used as ”don’t care”. We can directly see from the table that u2 and x3 are same, u2 can be directly connected to x3. u2 = x3. The other expressions are obtained by using their Karnaugh maps.

slide-55
SLIDE 55

William Sandqvist william@kth.se

  • Ex. 8.2
slide-56
SLIDE 56

William Sandqvist william@kth.se

  • Ex. 8.2
slide-57
SLIDE 57

P and N MOS-transistors

William Sandqvist william@kth.se

”Pull Up” ”Pull Down”

1

slide-58
SLIDE 58
  • Ex. 7.3 CMOS-gate ?

William Sandqvist william@kth.se

slide-59
SLIDE 59
  • Ex. 7.3 A=0 B=0

William Sandqvist william@kth.se

slide-60
SLIDE 60
  • Ex. 7.3 A=0 B=0

William Sandqvist william@kth.se

slide-61
SLIDE 61
  • Ex. 7.3 A=0 B=0

William Sandqvist william@kth.se

slide-62
SLIDE 62
  • Ex. 7.3 A=0 B=0

William Sandqvist william@kth.se

slide-63
SLIDE 63
  • Ex. 7.3 A=0 B=0

William Sandqvist william@kth.se

slide-64
SLIDE 64
  • Ex. 7.3 A=0 B=1

William Sandqvist william@kth.se

1 1 1 1

Y = 1

slide-65
SLIDE 65
  • Ex. 7.3 A=1 B=1

William Sandqvist william@kth.se

1 1 1 1 1 1 1

Y = 1

slide-66
SLIDE 66

7.3

William Sandqvist william@kth.se

A B Y 0 0 0 0 1 1 1 0 1 1 1 1

OR-gate

slide-67
SLIDE 67
  • Ex. 7.4 CMOS-gate ?

William Sandqvist william@kth.se

slide-68
SLIDE 68

7.4 EN = 1

William Sandqvist william@kth.se

A Y =

When EN = 1 we have an inverter.

slide-69
SLIDE 69

7.4 EN = 0

William Sandqvist william@kth.se

When EN = 0 the output is totaly disconnected from the supply voltage and ground. A can no longer influence the output value. This is a third output state, "Three State".

Many outputs could be connected to the same line ("bus"). One of the outputs at a time can be active. The otherare in their Three-state condition.

slide-70
SLIDE 70

Outputs from three different devices are connected to a common wire (BUS). The computer selects (Enables, EN) one at a time to be connected to the bus. The other two remain disconnected, (Three state).

William Sandqvist william@kth.se

slide-71
SLIDE 71
  • Ex. 7.5 CMOS-gate ?

William Sandqvist william@kth.se

Construct the "Pull-up" network with P-transistors for the CMOS gate.

slide-72
SLIDE 72

7.5

William Sandqvist william@kth.se

B C A B C A B C A Y B C A Y ⋅ + = ⋅ ⋅ = + ⋅ = ⇒ + ⋅ = ) ( B C A Y + ⋅ = =

Pull-down circuit is the inverted function. The Pull-up circuit is the function noninverted:

slide-73
SLIDE 73

7.5

William Sandqvist william@kth.se

The Pull-up net must therefore consist of A and C in parallel (+) then connected in series (⋅) with B. The use of PMOS transistors inverts the variables A, B and C.

B C A ) ( + B C A B C A B C A Y B C A Y ⋅ + = ⋅ ⋅ = + ⋅ = ⇒ + ⋅ = ) (