Lecture 11: Digital Logic Design - UCSB Computer Sciencehtzheng/teach/cs64s11/pdf/lecture11.pdf ·...

42
Lecture 11: Digital Logic Design

Transcript of Lecture 11: Digital Logic Design - UCSB Computer Sciencehtzheng/teach/cs64s11/pdf/lecture11.pdf ·...

Lecture 11: ���Digital Logic Design

CS 30

���Today’s Focus:���

���Truth Table ���

(Simplified) Boolean Expression

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

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

CS 30

Examples

literal

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

One More

1 1

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

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

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

How is this related to ���

Logic Design?

CS 30

Logic Design Process

Function definition

Truth table

Boolean expression

Logic block

CS 30

adder ?

Truth Table

CS 30

Boolean Expression

From Truth Table to Minimized Boolean Expression

CS 30

OR

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

Boolean expressions ���Directly from Truth Table

CS 30

Graphing Boolean Expressions

CS 30

B

Mapping Truth Tables to Tubes

A

CS 30

Adjacent plane

on set

off set

Mapping Truth Tables to Tubes

A

B

CS 30

Adjacent plane

on set

off set

3-variable example

CS 30

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.

Graphing Boolean becomes much more complex as the input increases

CS 30

From Multi-dimention to Two-dimention

CS 30

K-MAP

CS 30

K-Map (general idea)

CS 30

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

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

CS 30

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

CS 30

 Each group should be as large as possible.

CS 30

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

 Groups may overlap.   

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.

CS 30

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

Mapping from truth table to k-map

CS 30

Boolean Minimization via K-MAP

CS 30

A BA B’

Mapping from truth table to k-map

CS 30

Additional examples

CBCAF •+•=

CS 30

CS 30

Examples

 Avoid redundant coverage!

CS 30

Exercise

DBDBACF •+••+=CS 30

Using K-map to perform complement

CS 30

complement

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

Choosing don’t cares

CS 30

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