cs 226: digital logic design

17
Ashutosh Trivedi – 1 of 11 CS 226: Digital Logic Design Lecture 6: Karnaugh Maps Ashutosh Trivedi 0 1 0 1 0 1 S I S 0 Department of Computer Science and Engineering, Indian Institute of Technology Bombay. Ashutosh Trivedi Lecture 6: Karnaugh Maps

Upload: others

Post on 12-May-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 226: Digital Logic Design

Ashutosh Trivedi – 1 of 11

CS 226: Digital Logic DesignLecture 6: Karnaugh Maps

Ashutosh Trivedi

0 1

01

0

1 SI

S′

Department of Computer Science and Engineering,Indian Institute of Technology Bombay.

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 2: CS 226: Digital Logic Design

Ashutosh Trivedi – 2 of 11

Logical functionsHow to represent logical functions:

1. Truth-tables2. Algebraic expressions3. Venn diagrams

4. Karnaugh maps

Dr. Maurice Karnaugh, developer of Karnaugh maps or K-maps (1954), explainingK-maps

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 3: CS 226: Digital Logic Design

Ashutosh Trivedi – 2 of 11

Logical functionsHow to represent logical functions:

1. Truth-tables2. Algebraic expressions3. Venn diagrams4. Karnaugh maps

Dr. Maurice Karnaugh, developer of Karnaugh maps or K-maps (1954), explainingK-maps

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 4: CS 226: Digital Logic Design

Ashutosh Trivedi – 3 of 11

Karnaugh-maps

– A clever way to represent a truth-table– It represent the truth-table in such a visual manner to help identifying

manipulations of the following nature:– x1 · x2 + x1 · x2 = x1

– x1 · x2 · x3 + x1 · x2 · x3 + x1 · x2 · x3 + x1 · x2 · x3 = x1.

– An intuitive visual way to simplify logical expressions involving2, 3, 4, 5, and 6 variables

– The minimization process gives insight to the working of CAD tools.– We will begin by introducing K-maps of 2 variables, and continue

with K-maps of higher complexity.

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 5: CS 226: Digital Logic Design

Ashutosh Trivedi – 4 of 11

Two variable Karnaugh maps

x1 x2 f (x1, x2)0 0 00 1 11 0 11 1 0

x2

x10 1

0

1

1

1

0

0

f (x1, x2) = x1x2 + x1x2

– A box or a cell corresponding to each (minterm) line of truth-table– The placement 1’s in corresponding cell identifies the minterms

representing a function

– Nice graphics, Ashutosh! but what’s the point?

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 6: CS 226: Digital Logic Design

Ashutosh Trivedi – 4 of 11

Two variable Karnaugh maps

x1 x2 f (x1, x2)0 0 00 1 11 0 11 1 0

x2

x10 1

0

1

1

1

0

0

f (x1, x2) = x1x2 + x1x2

– A box or a cell corresponding to each (minterm) line of truth-table– The placement 1’s in corresponding cell identifies the minterms

representing a function– Nice graphics, Ashutosh! but what’s the point?

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 7: CS 226: Digital Logic Design

Ashutosh Trivedi – 5 of 11

Two variable Karnaugh maps

x1 x2 f (x1, x2)0 0 00 1 11 0 11 1 1

x2

x10 1

0

1

1

1 1

0

f (x1, x2) = x1 + x2

– Did you see what we did here?

– green group = x1x2 + x1x2 = x1

– red group = x1x2 + x1x2 = x2

– These groupings of 1’s helped us to simplify the logical expressions.– We are allowed to make (down and across) groups of 1 2, 4 cells.– Try to minimize number of groupings while covering all the 1 cells.– Do not introduce redundant groupings.– Let’s work out some more examples.

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 8: CS 226: Digital Logic Design

Ashutosh Trivedi – 5 of 11

Two variable Karnaugh maps

x1 x2 f (x1, x2)0 0 00 1 11 0 11 1 1

x2

x10 1

0

1

1

1 1

0

f (x1, x2) = x1 + x2

– Did you see what we did here?– green group = x1x2 + x1x2 = x1

– red group = x1x2 + x1x2 = x2

– These groupings of 1’s helped us to simplify the logical expressions.

– We are allowed to make (down and across) groups of 1 2, 4 cells.– Try to minimize number of groupings while covering all the 1 cells.– Do not introduce redundant groupings.– Let’s work out some more examples.

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 9: CS 226: Digital Logic Design

Ashutosh Trivedi – 5 of 11

Two variable Karnaugh maps

x1 x2 f (x1, x2)0 0 00 1 11 0 11 1 1

x2

x10 1

0

1

1

1 1

0

f (x1, x2) = x1 + x2

– Did you see what we did here?– green group = x1x2 + x1x2 = x1

– red group = x1x2 + x1x2 = x2

– These groupings of 1’s helped us to simplify the logical expressions.– We are allowed to make (down and across) groups of 1 2, 4 cells.– Try to minimize number of groupings while covering all the 1 cells.– Do not introduce redundant groupings.

– Let’s work out some more examples.

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 10: CS 226: Digital Logic Design

Ashutosh Trivedi – 5 of 11

Two variable Karnaugh maps

x1 x2 f (x1, x2)0 0 00 1 11 0 11 1 1

x2

x10 1

0

1

1

1 1

0

f (x1, x2) = x1 + x2

– Did you see what we did here?– green group = x1x2 + x1x2 = x1

– red group = x1x2 + x1x2 = x2

– These groupings of 1’s helped us to simplify the logical expressions.– We are allowed to make (down and across) groups of 1 2, 4 cells.– Try to minimize number of groupings while covering all the 1 cells.– Do not introduce redundant groupings.– Let’s work out some more examples.

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 11: CS 226: Digital Logic Design

Ashutosh Trivedi – 6 of 11

Three variable Karnaugh maps

x1 x2 x3 f (x1, x2, x3)0 0 0 00 0 1 00 1 0 10 1 1 11 0 0 11 0 1 11 1 0 01 1 1 0

x2x3

x100 01 11 10

0

1

11

1 1

0 0

00

f (x1, x2, x3) = x1x2 + x1x2

– Alert: Did you notice the Gray code ordering?– Groupings of 1, 2, 4, and 8 cells possible

– “Ends are connected”– Let’s work out some examples!

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 12: CS 226: Digital Logic Design

Ashutosh Trivedi – 6 of 11

Three variable Karnaugh maps

x1 x2 x3 f (x1, x2, x3)0 0 0 00 0 1 00 1 0 10 1 1 11 0 0 11 0 1 11 1 0 01 1 1 0

x2x3

x100 01 11 10

0

1

11

1 1

0 0

00

f (x1, x2, x3) = x1x2 + x1x2

– Alert: Did you notice the Gray code ordering?– Groupings of 1, 2, 4, and 8 cells possible– “Ends are connected”– Let’s work out some examples!

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 13: CS 226: Digital Logic Design

Ashutosh Trivedi – 7 of 11

Three variable Karnaugh maps: Example 1

x1 x2 x3 f (x1, x2, x3)0 0 0 00 0 1 00 1 0 10 1 1 11 0 0 01 0 1 01 1 0 11 1 1 1

x2x3

x100 01 11 10

0

1

11

11

0 0

0 0

f (x1, x2, x3) = x2

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 14: CS 226: Digital Logic Design

Ashutosh Trivedi – 8 of 11

Four variable Karnaugh maps

x3x4

x1x200 01 11 10

00

01

11

10

0 0 00

0 0 00

0 0 00

0 0 00

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 15: CS 226: Digital Logic Design

Ashutosh Trivedi – 9 of 11

Four dimension K-map connected as a Torus

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 16: CS 226: Digital Logic Design

Ashutosh Trivedi – 10 of 11

Thumb Rules

1. No zeroes allowed.2. No diagonal groupings3. Only power of 2 cells in each grouping4. Every one must be at least in one grouping5. Overlapping is allowed6. Groups may “Wrap-around”7. Fewest number of groups possible

Ashutosh Trivedi Lecture 6: Karnaugh Maps

Page 17: CS 226: Digital Logic Design

Ashutosh Trivedi – 11 of 11

Additional Topics

– Five and Six variable Karnaugh maps– Incompletely specified functions– Generating product-of-sum representation using K-maps

Ashutosh Trivedi Lecture 6: Karnaugh Maps