cpre 281: digital logic - computer...

95
Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/ CprE 281: Digital Logic

Upload: others

Post on 22-Mar-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Instructor: Alexander Stoytchev

http://www.ece.iastate.edu/~alexs/classes/

CprE 281: Digital Logic

Page 2: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Examples of Solved Problems

CprE 281: Digital LogicIowa State University, Ames, IACopyright © Alexander Stoytchev

Page 3: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Administrative Stuff

• HW5 is out

• It is due on Monday Sep 30 @ 4pm.

• Please write clearly on the first page (in block capital letters) the following three things:

§ Your First and Last Name§ Your Student ID Number§ Your Lab Section Letter

• Also, staple all of your pages together

Page 4: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Administrative Stuff• Midterm Exam #1

• When: Friday Sep 27.

• Where: This classroom

• What: Chapter 1 and Chapter 2 plus number systems

• The exam will be closed book but open notes (you can bring up to 3 pages of handwritten notes).

Page 5: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Topics for the Midterm Exam• Binary Numbers• Octal Numbers• Hexadecimal Numbers• Conversion between the different number systems• Truth Tables• Boolean Algebra• Logic Gates• Circuit Synthesis with AND, OR, NOT• Circuit Synthesis with NAND, NOR• Converting an AND/OR/NOT circuit to NAND circuit • Converting an AND/OR/NOT circuit to NOR circuit • SOP and POS expressions

Page 6: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Topics for the Midterm Exam• Mapping a Circuit to Verilog code• Mapping Verilog code to a circuit

• Multiplexers• Venn Diagrams• K-maps for 2, 3, and 4 variables

• Minimization of Boolean expressions using theorems• Minimization of Boolean expressions with K-maps

• Incompletely specified functions (with don’t cares)• Functions with multiple outputs

• Something from Star Wars

Page 7: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 0

The Link Between Truth Tables and Venn Diagrams

Page 8: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Place the minterms on the Venn diagram

A B

0 0 m0

0 1 m1

1 0 m2

1 1 m3

Page 9: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Place the minterms on the Venn diagram

A B

0 0 m0

0 1 m1

1 0 m2

1 1 m3

Page 10: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,
Page 11: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Color the Venn diagram for XOR

A B F

0 0 0

0 1 1

1 0 1

1 1 0

Page 12: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Color the Venn diagram for XOR

A B F

0 0 0

0 1 1

1 0 1

1 1 0

Page 13: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Color the Venn diagram for XOR

A B F

0 0 0

0 1 1

1 0 1

1 1 0

m0

m1

m2

m3

F = A B + A B

Page 14: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,
Page 15: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Place the minterms on the Venn diagram

A B C

0 0 0 m0

0 0 1 m1

0 1 0 m2

0 1 1 m3

1 0 0 m4

1 0 1 m5

1 1 0 m6

1 1 1 m7

Page 16: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Place the minterms on the Venn diagram

A B C

0 0 0 m0

0 0 1 m1

0 1 0 m2

0 1 1 m3

1 0 0 m4

1 0 1 m5

1 1 0 m6

1 1 1 m7

Page 17: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,
Page 18: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Color the Venn diagram for this function

A B C F

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 1

1 1 0 0

1 1 1 1

Page 19: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Color the Venn diagram for this function

A B C F

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 1

1 1 0 0

1 1 1 1

Page 20: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Place the minterms on the Venn diagram

A B C F

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 1

1 0 1 1

1 1 0 0

1 1 1 1

m0

m1

m2

m3

m4

m5

m6

m7

Page 21: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,
Page 22: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Color the Venn diagram for this function

A B C F

0 0 0 1

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 1

1 0 1 0

1 1 0 0

1 1 1 1

Page 23: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Color the Venn diagram for this function

A B C F

0 0 0 1

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 1

1 0 1 0

1 1 0 0

1 1 1 1

Page 24: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Place the minterms on the Venn diagram

A B C F

0 0 0 1

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 1

1 0 1 0

1 1 0 0

1 1 1 1

m0

m1

m2

m3

m4

m5

m6

m7

Page 25: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 1

Determine if the following equation is valid

Page 26: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

?

Page 27: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

?

LHS RHS

Page 28: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Left-Hand Side (LHS)

Page 29: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Left-Hand Side (LHS)

Page 30: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Left-Hand Side (LHS)

Page 31: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Right-Hand Side (RHS)

Page 32: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Right-Hand Side (RHS)

Page 33: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Right-Hand Side (RHS)

Page 34: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

?

LHS RHS

They are equal.

Page 35: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 2

Design the minimum-cost product-of-sums expression for the function

f(x1, x2, x3) = Σ m(0, 2, 4, 5, 6, 7)

Page 36: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Minterms and Maxterms(with three variables)

[ Figure 2.22 from the textbook ]

Page 37: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Minterms and Maxterms(with three variables)

The function is 1 for these rows

Page 38: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Minterms and Maxterms(with three variables)

The function is 1 for these rows

The function is 0 for these rows

Page 39: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Two different ways to specify the same function f of three variables

f(x1, x2, x3) = Σ m(0, 2, 4, 5, 6, 7)

f(x1, x2, x3) = Π M(1, 3)

Page 40: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The POS Expression

f(x1, x2, x3) = Π M(1, 3)

= M1� M3

= ( x1 + x2 + x3)�( x1 + x2 + x3)

Page 41: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The Minimum POS Expression

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

= ( x1 + x3 + x2)�( x1 + x3 + x2)

= ( x1 + x3 )

Hint: Use the following Boolean Algebra theorem

Page 42: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Alternative Solution Using K-Maps

x 1

x 2

x 3 00 01 11 10

0

1

(b) Karnaugh map

x 2

x 3

0 0

0 1

1 0

1 1

m 0

m 1

m 3

m 2

0

0

0

0

0 0

0 1

1 0

1 1

1

1

1

1

m 4

m 5

m 7

m 6

x 1

(a) Truth table

m 0

m 1 m 3

m 2 m 6

m 7

m 4

m 5

Page 43: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Alternative Solution Using K-Maps

x 1

x 2

x 3 00 01 11 10

0

1

(b) Karnaugh map

x 2

x 3

0 0

0 1

1 0

1 1

m 0

m 1

m 3

m 2

0

0

0

0

0 0

0 1

1 0

1 1

1

1

1

1

m 4

m 5

m 7

m 6

x 1

(a) Truth table

m 0

m 1 m 3

m 2 m 6

m 7

m 4

m 5

Page 44: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Alternative Solution Using K-Maps

x 1

x 2

x 3 00 01 11 10

0

1

(b) Karnaugh map

x 2

x 3

0 0

0 1

1 0

1 1

m 0

m 1

m 3

m 2

0

0

0

0

0 0

0 1

1 0

1 1

1

1

1

1

m 4

m 5

m 7

m 6

x 1

(a) Truth table

m 0

m 1 m 3

m 2 m 6

m 7

m 4

m 5

Page 45: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Alternative Solution Using K-Maps

Page 46: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Alternative Solution Using K-Maps

1

0 0

1 1 1

1 1

Page 47: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Alternative Solution Using K-Maps

1

0 0

1 1 1

1 1

( x1 + x3 )

Page 48: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 3

Page 49: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Condition A

Page 50: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Condition A

Page 51: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Condition B

Page 52: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Condition B

Page 53: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Condition C

Page 54: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Condition C

Page 55: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The output of the circuit can be expressed as f = AB + AC + BC

Page 56: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The output of the circuit can be expressed as f = AB + AC + BC

Page 57: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The output of the circuit can be expressed as f = AB + AC + BC

Page 58: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Finally, we get

Page 59: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 4

Solve the previous problem using Venn diagrams.

Page 60: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Venn Diagrams(find the areas that are shaded at least two times)

(a) Function A: (b) Function B

(c) Function C (d) Function f

x1 x2

x3

x1 x2

x3

[ Figure 2.66 from the textbook ]

x1

x3

x2x2 x1 x2

x3

Page 61: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 5

Design the minimum-cost SOP and POS expression for the function

f(x1, x2, x3, x4) = Σ m(4, 6, 8, 10, 11, 12, 15) + D(3, 5, 7, 9)

Page 62: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Let’s Use a K-Map

f(x1, x2, x3, x4) = Σ m(4, 6, 8, 10, 11, 12, 15) + D(3, 5, 7, 9)

x 1

x 2

x 3

x 4 00 01 11 10

00

01

11

10

x 2

x 4

x 1

x 3

m 0

m 1 m 5

m 4 m 12

m 13

m 8

m 9

m 3

m 2 m 6

m 7 m 15

m 14

m 11

m 10

Page 63: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Let’s Use a K-Map

f(x1, x2, x3, x4) = Σ m(4, 6, 8, 10, 11, 12, 15) + D(3, 5, 7, 9)

x 1

x 2

x 3

x 4 00 01 11 10

00

01

11

10

x 2

x 4

x 1

x 3

m 0

m 1 m 5

m 4 m 12

m 13

m 8

m 9

m 3

m 2 m 6

m 7 m 15

m 14

m 11

m 10

0

0

1

d

d

0

d

1

1

0

1

d

1

0

1

1

Page 64: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The SOP Expression

[ Figure 2.67a from the textbook ]

Page 65: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

What about the POS Expression?

f(x1, x2, x3, x4) = Σ m(4, 6, 8, 10, 11, 12, 15) + D(3, 5, 7, 9)

x 1

x 2

x 3

x 4 00 01 11 10

00

01

11

10

x 2

x 4

x 1

x 3

m 0

m 1 m 5

m 4 m 12

m 13

m 8

m 9

m 3

m 2 m 6

m 7 m 15

m 14

m 11

m 10

0

0

1

d

d

0

d

1

1

0

1

d

1

0

1

1

Page 66: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The POS Expression

[ Figure 2.67b from the textbook ]

Page 67: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 6

Use K-maps to find the minimum-cost SOP and POS expression for the function

Page 68: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Let’s map the expression to the K-Map

x 1

x 2

x 3

x 4 00 01 11 10

00

01

11

10

x 2

x 4

x 1

x 3

m 0

m 1 m 5

m 4 m 12

m 13

m 8

m 9

m 3

m 2 m 6

m 7 m 15

m 14

m 11

m 10

Page 69: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Let’s map the expression to the K-Map

x 1

x 2

x 3

x 4 00 01 11 10

00

01

11

10

x 2

x 4

x 1

x 3

m 0

m 1 m 5

m 4 m 12

m 13

m 8

m 9

m 3

m 2 m 6

m 7 m 15

m 14

m 11

m 10

d

d

d

Page 70: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Let’s map the expression to the K-Map

x 1

x 2

x 3

x 4 00 01 11 10

00

01

11

10

x 2

x 4

x 1

x 3

m 0

m 1 m 5

m 4 m 12

m 13

m 8

m 9

m 3

m 2 m 6

m 7 m 15

m 14

m 11

m 10

d

d

d

Page 71: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The SOP Expression

[ Figure 2.68a from the textbook ]

Page 72: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

What about the POS Expression?

x 1

x 2

x 3

x 4 00 01 11 10

00

01

11

10

x 2

x 4

x 1

x 3

m 0

m 1 m 5

m 4 m 12

m 13

m 8

m 9

m 3

m 2 m 6

m 7 m 15

m 14

m 11

m 10

1

1

1

0

1

0

1

0

d

1

0

d

1

d

1

0

Page 73: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The POS Expression

[ Figure 2.68b from the textbook ]

Page 74: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 7

Derive the minimum-cost SOP expression for

Page 75: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

First, expand the expression using property 12a

Page 76: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Construct the K-Map for this expression

x 1

x 2

x 3 00 01 11 10

0

1

(b) Karnaugh map

x 2

x 3

0 0

0 1

1 0

1 1

m 0

m 1

m 3

m 2

0

0

0

0

0 0

0 1

1 0

1 1

1

1

1

1

m 4

m 5

m 7

m 6

x 1

(a) Truth table

m 0

m 1 m 3

m 2 m 6

m 7

m 4

m 5

s1 s2 s3 s1 s2s3

Page 77: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Construct the K-Map for this expression

[ Figure 2.69 from the textbook ]

Page 78: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Construct the K-Map for this expression

[ Figure 2.69 from the textbook ]

Simplified Expression: f = s3 + s1 s2

Page 79: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 8

Write the Verilog code for the following circuit …

Page 80: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Logic Circuit

[ Figure 2.70 from the textbook ]

Page 81: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Circuit for 2-1 Multiplexer

f

x 1

x 2s

f

s

x 1 x 2

0

1

(c) Graphical symbol(b) Circuit

[ Figure 2.33b-c from the textbook ]

f (s, x1, x2) = s x1 s x2+

Page 82: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Logic Circuit vs Verilog Code

[ Figure 2.71 from the textbook ][ Figure 2.70 from the textbook ]

Page 83: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Example 9

Write the Verilog code for the following circuit …

Page 84: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

The Logic Circuit for this Example

[ Figure 2.72 from the textbook ]

Page 85: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Circuit for 2-1 Multiplexer

f

x 1

x 2s

f

s

x 1 x 2

0

1

(c) Graphical symbol(b) Circuit

[ Figure 2.33b-c from the textbook ]

f (s, x1, x2) = s x1 s x2+

Page 86: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Addition of Binary Numbers

Page 87: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Logic Circuit vs Verilog Code

[ Figure 2.73 from the textbook ]

Page 88: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Some material form Appendix B

Page 89: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Programmable Logic Array (PLA)

f 1

AND plane OR plane

Input buffers

inverters and

P 1

P k

f m

x 1 x 2 x n

x 1 x 1 x n x n

[ Figure B.25 from textbook ]

Page 90: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Gate-Level Diagram of a PLA

f1

P1

P2

f 2

x 1 x 2 x 3

OR plane

Programmable

AND plane

connections

P3

P4

[ Figure B.26 from textbook ]

Page 91: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Customary Schematic for PLA

f 1

P 1

P 2

f 2

x 1 x 2 x 3

OR plane

AND plane

P 3

P 4

[ Figure B.27 from textbook ]

Page 92: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Programmable Array Logic (PAL)

f 1

P 1

P 2

f 2

x 1 x 2 x 3

AND plane

P 3

P 4

[ Figure B.28 from textbook ]

Page 93: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Programmable Array Logic (PAL)

f 1

P 1

P 2

f 2

x 1 x 2 x 3

AND plane

P 3

P 4

[ Figure B.28 from textbook ]

Only the AND plane is programmable.The OR plane is fixed.

Page 94: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

Questions?

Page 95: CprE 281: Digital Logic - Computer Engineeringalexs/classes/2019_Fall_281/slides_PDF/13_Examples.pdfExamples of Solved Problems CprE 281: Digital Logic Iowa State University, Ames,

THE END