Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product"...

42
Lecture 11: Digital Logic Design

Transcript of Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product"...

Page 1: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Lecture 11: ���Digital Logic Design

Page 2: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

CS 30

���Today’s Focus:���

���Truth Table ���

(Simplified) Boolean Expression

Page 3: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

From Truth Table Boolean Expression

 Sum of the Product

F= ABC + BCD + DEF

 Product of the Sum

F= (A+B+C) (B+C+D) (D+E+F)

CS 30

Page 4: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Sum of the Product

 Each row of the truth table represents a product term

 Product term -- each row in which the output column is a 1 contributes a single ANDed term of input variables to the Boolean expressions  If the column associated with variable X has a 0 in it, the

expression X’ is part of the ANDed term., otherwise, X is part of the ANDed term

 Sum of the product  Product terms are ORed together

CS 30

Page 5: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

CS 30

Examples

literal

Page 6: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Another Example

CS 30

1 1 Carry = A’B’+ AB Sum = A’B’ + A’B+ AB’

0 0 1 0 1 0 0 1

Carry = A’B+AB’ Sum = AB

Page 7: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

One More

1 1

Page 8: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

What About Product of the Sum

CS 30

1 1 Carry = A’B’+ AB Sum = A’B’ + A’B+ AB’ Carry’= (A+B)(A’+B’) = C Sum’ = (A+B)(A+B’)(A’+B) =S

0 0 1 0 1 0 0 1

C = A’B+AB’ S = AB

C S

Page 9: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Product of the Sum

 Each row of the truth table represents a sum term

 Sum term -- each row in which the output column is a 0 contributes a single ORed term of input variables to the Boolean expressions  If the column associated with variable X has a 0 in it, the

expression X is part of the ORed term.; If X has a 1 in it, then X’ is part of the ORed term

 Product of the Sum  Sum terms are ANDed together

CS 30

Page 10: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

From Truth Table Boolean Expression

 Sum of the Product

Find rows with output of 1

each product term, input X, x=0 use X’, x=1, use X

OR all the product terms together

 Product of the Sum

Find rows with output of 0

each sum term, input X, x=0 use X, x=1, use X’

AND all the sum terms together

CS 30

Page 11: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

How is this related to ���

Logic Design?

CS 30

Page 12: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Logic Design Process

Function definition

Truth table

Boolean expression

Logic block

CS 30

adder ?

Page 13: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Truth Table

CS 30

Boolean Expression

Page 14: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

From Truth Table to Minimized Boolean Expression

CS 30

OR

Page 15: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

K-Map: ���A systematic way to simplify ���

Boolean expressions ���Directly from Truth Table

CS 30

Page 16: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Graphing Boolean Expressions

CS 30

Page 17: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

B

Mapping Truth Tables to Tubes

A

CS 30

Adjacent plane

on set

off set

Page 18: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Mapping Truth Tables to Tubes

A

B

CS 30

Adjacent plane

on set

off set

Page 19: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

3-variable example

CS 30

Page 20: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Adjacencies of higher dimensions

CS 30

Eliminate 2 variables, reduce the expression into a single variable

What about higher dimensions…………….

The problem for humans is the difficulty of visualizing adjacencies in more than three dimensions.

Page 21: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Graphing Boolean becomes much more complex as the input increases

CS 30

Page 22: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

From Multi-dimention to Two-dimention

CS 30

Page 23: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

K-MAP

CS 30

Page 24: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

K-Map (general idea)

CS 30

Page 25: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Properties of K-Map

 Any two adjacent (horizontal or vertical, but not diagonal) elements are distance 1 apart in the equivalent cube representation

CS 30

Page 26: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Rules of Simplification

 Grouping together adjacent cells containing 1

 Groups may not include any cell containing 0.

 Groups may be horizontal or vertical, but not diagonal.

CS 30

Page 27: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

CS 30

 Groups must contain 1, 2, 4, 8, or in general 2^n cells.

Page 28: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

CS 30

 Each group should be as large as possible.

Page 29: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

CS 30

 Each cell containing a one must be in at least one group.

 Groups may overlap.   

Page 30: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

CS 30

 Groups may wrap around the table. The leftmost cell in a row may be grouped with the rightmost cell and the top cell in a column may be grouped with the bottom cell.

Page 31: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

CS 30

 There should be as few groups as possible, as long as this does not contradict any of the previous rules.

Page 32: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Mapping from truth table to k-map

CS 30

Page 33: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Boolean Minimization via K-MAP

CS 30

A BA B’

Page 34: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Mapping from truth table to k-map

CS 30

Page 35: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Additional examples

CBCAF •+•=

CS 30

Page 36: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

CS 30

Page 37: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Examples

 Avoid redundant coverage!

CS 30

Page 38: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Exercise

DBDBACF •+••+=CS 30

Page 39: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Using K-map to perform complement

CS 30

complement

Page 40: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Don’t cares

 X: don’t care.

 Do not confuse this with an undefined value or a don’t know.

 Any actual implementation of the circuit will generate some output for the don’t-care cases.

 In a truth table, an X simply means that we have a choice of assigning a 0 or 1 to the truth table entry.

 We should choose the value that will lead to the simplest implementation.

CS 30

Page 41: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Choosing don’t cares

CS 30

Page 42: Lecture 11: Digital Logic Designhtzheng/teach/cs64s11/pdf/... · 2011-05-05 · Sum of the Product" Each row of the truth table represents a product term" Product term -- each row

Summary

 Review: transistors and gates

 Combinational logic  Vs. sequential logic

 Boolean Algebra  Laws of boolean algebra

 Realizing Boolean Expressions using Gates  NAND, NOR, AND, OR, NOT

 K-map  1,2,3,4 variables….

CS 30