contemporary logic design two-level logic © r.h. katz transparency no. 4-1 chapter #2: two-level...

31
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 4-1 hapter #2: Two-Level Combinational Logi Section 2.3, 2.4 -- Switches and Tools

Post on 21-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-1

Chapter #2: Two-Level Combinational Logic

Section 2.3, 2.4 -- Switches and Tools

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-2

A 0 0 1 1

B 0 1 0 1

G 1 0 1 0

A 0 0 1 1

B 0 1 0 1

F 0 0 1 1

Gate Logic: Two-Level Simplification

Key Tool: The Uniting Theorem — A (B' + B) = AKey Tool: The Uniting Theorem — A (B' + B) = A

F = A B' + A B = A (B' + B) = A

A's values don't change within the on-set rows

B's values change within the on-set rows

G = A' B' + A B' = (A' + A) B' = B'

B's values stay the same within the on-set rows

A's values change within the on-set rows

B is eliminated, A remains

A is eliminated, B remains

Essence of Simplification:find two element subsets of the ON-set where only one variable changes its value. This single varying variable can be eliminated!

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-3

A B 0 1

0

1

0

1

2

3

0

1

2

3

6

7

4

5

AB C

0

1

3

2

4

5

7

6

12

13

15

14

8

9

11

10

A

B

AB

CD

A

00 01 11 10

0

1

00 01 11 00

00

01

11

10 C

B

D

Gate Logic: Two-Level SimplificationKarnaugh Map Method

K-map is an alternative method of representing the truth table that helps visualize adjacencies in up to 6 dimensions

Beyond that, computer-based methods are needed

2-variableK-map

3-variableK-map

4-variableK-map

Numbering Scheme: 00, 01, 11, 10Gray Code — only a single bit changes from code word to next code word

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-4

Gate Logic: Two-Level SimplificationKarnaugh Map Method

Adjacencies in the K-Map

Wrap from first to last column

Top row to bottom row

000

001

010

01 1

1 10

1 1 1

100

101

00 01 11 10

0

1

AB C

A

B

011

010

000

001

100

110

101

111

B

C

A

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-5

Gate Logic: Two-Level SimplificationK-Map Method Examples -- Minimum sum of products

F = A

A asserted, unchangedB varies

G = B’

B complemented, unchangedA varies

Cout = Bcin + AB + ACin F(A,B,C) = A

A

B 0 1

0 1

0 1

0

1

A

B 0 1

1 1

0 0

0

1

A B A

B

Cin 00 01 11 10

0

1

0

0

0

1

1

1

0

1

AB C

A

00 01 11 10

0

1

0

0

0

0

1

1

1

1

B

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-6

Gate Logic: Two-Level SimplificationMore K-Map Method Examples, 3 Variables

F(A,B,C) = m(0,4,5,7)

F =

F'(A,B,C) = m(1,2,3,6)

F' =

F' simply replace 1's with 0's and vice versa

00 C

AB 01 11 10

1 0 0 1

1 1 0 0

A

B

0

1

00 C

AB

01 11 10

0 1 1 0

0 0 1 1

A

B

0

1

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-7

Gate Logic: Two-Level Simplification

K-map Method Examples: 4 variables

F(A,B,C,D) = m(0,2,3,5,6,7,8,10,11,14,15)

F = C + A’BD + B’D’

AB 00 01 11 10

1 0 0 1

0 1 0 0

1 1 1 1

1 1 1 1

00

01

11

10 C

CD

A

D

B

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-8

Gate Logic: Two-Level Simplification

K-map Method: Circling Zeros -- Minimum Product of Sums

AB 00 01 11 10

1 0 0 1

0 1 0 0

1 1 1 1

1 1 1 1

00

01

11

10 C

CD

A

D

B

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

F = B C D + A C D + B C D

F = B C D + A C D + B C D

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

Replace F by F, 0’s become 1’s and vice versa

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-9

Gate Logic: Two-Level Simplification

K-map Example: Don't Cares

F(A,B,C,D) = m(1,3,5,7,9) + d(6,12,13)

F = A’D + B’C’D w/o don't cares

F = A’D + C’D w/ don't cares

Don't Cares can be treated as 1's or 0's if it is advantageous to do soDon't Cares can be treated as 1's or 0's if it is advantageous to do so

AB 00 01 11 10

0 0 X 0

1 1 X 1

1 1 0 0

0 X 0 0

00

01

11

10 C

CD

A

D

B

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-10

Gate Logic: Two Level SimplificationDefinition of Terms

implicant: single element of the ON-set or any group of elements that can be combined together in a K-map

prime implicant: implicant that cannot be combined with another implicant to eliminate a term

essential prime implicant: if an element of the ON-set is covered by a single prime implicant, it is an essential prime

Objective:

grow implicants into prime implicants

cover the ON-set with as few prime implicants as possible

essential primes participate in ALL possible covers

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-11

Gate Logic: Two Level SimplicationExamples to Illustrate Terms

6 Prime Implicants:

A' B' D, B C', A C, A' C' D, A B, B' C D

essential

Minimum cover = B C' + A C + A' B' D

5 Prime Implicants:

B D, A B C', A C D, A' B C, A' C' D

essential

Essential implicants form minimum cover

AB 00 01 11 10

0 1 1 0

1 1 1 0

1 0 1 1

0 0 1 1

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

0 0 1 0

1 1 1 0

0 1 1 1

0 1 0 0

00

01

11

10 C

CD

A

D

B

Minimum cover = ABC’ + ACD + A’BC + A’C’D

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-12

Gate Logic: Two Level Simplification

More Examples

Prime Implicants:

B D, C D, A C, B' C

essential

Essential primes form the minimum cover

AB 00 01 11 10

0 0 0 0

0 1 1 0

1 1 1 1

1 0 1 1

00

01

11

10 C

CD

A

D

B Minimum cover = B D + AC + B’C

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-13

Gate Logic: Two-Level SimplificationAlgorithm: Minimum Sum of Products Expression from a K-Map

Step 1: Choose an element of ON-set not already covered by an implicant

Step 2: Find "maximal" groupings of 1's and X's adjacent to that element.Remember to consider top/bottom row, left/right column, andcorner adjacencies. This forms prime implicants (always a powerof 2 number of elements).

Repeat Steps 1 and 2 to find all prime implicants

Step 3: Revisit the 1's elements in the K-map. If covered by single primeimplicant, it is essential, and participates in final cover. The 1's itcovers do not need to be revisited

Step 4: If there remain 1's not covered by essential prime implicants, thenselect the smallest number of prime implicants that cover theremaining 1's

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-14

Gate Logic: Two Level SimplificationExample: ƒ(A,B,C,D) = m(4,5,6,8,9,10,13) + d(0,7,15)

Initial K-map

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-15

Gate Logic: Two Level SimplificationExample: ƒ(A,B,C,D) = m(4,5,6,8,9,10,13) + d(0,7,15)�

Initial K-map Primes aroundA' B C' D' --m4

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

A’B, A’C’D

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-16

Gate Logic: Two Level SimplificationExample: ƒ(A,B,C,D) = m(4,5,6,8,9,10,13) + d(0,7,15)�

Initial K-map Primes aroundA' B C' D'

Primes aroundA B C' D -- m5

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

BD

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-17

Gate Logic: Two-Level SimplificationExample Continued

Primes aroundA B C' D -- m13

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

AC’D

m6 -- no new implicant canbe added because the set ofimplicants already containsA’B.

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-18

Gate Logic: Two-Level SimplificationExample Continued

Primes aroundA B' C' D' -- m8

Primes aroundA B C' D

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

AB’C’, AB’D’, B’C’D’

m9 and m10 -- addno new primeimplicants

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-19

Gate Logic: Two-Level SimplificationExample Continued

Primes aroundA B' C' D'

Primes aroundA B C' D

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

X 1 0 1

0 1 1 1

0 X X 0

0 1 0 1

00

01

11

10 C

CD

A

D

B

Essential Primeswith Min Cover

A’B, AB’D’ coverm6 and m10 exclusively

Cover remaining 1’s not already covered by the essential primes. -- AC’D

F = A’B + AB’D’ + AC’D -- final minimized function

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-20

Gate Logic: Two-Level SimplificationDesign Example: Two Bit Comparator

Block Diagramand

Truth Table

A 4-Variable K-mapfor each of the 3output functions

F 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

F 2 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0

F 3 0 0 0 0 1 0 0 0 1 1 0 0 1 1 1 0

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

C 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

B 0 1 0 1

A 0 0 1 1

=, >, < F 1 A B = C D F 2 A B < C D F 3 A B > C D

A B

C D

N 1

N 2

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-21

Gate Logic: Two-Level SimplificationDesign Example: Two Bit Comparator

F1 =

F2 =

F3 =

AB 00 01 11 10

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

00

01

11

10 C

CD

A

D

B

K-map for F 1

AB 00 01 11 10

0 0 0 0

1 0 0 0

1 1 0 1

1 1 0 0

00

01

11

10 C

CD

A

D

B

K-map for F 2

AB 00 01 11 10

0 1 1 1

0 0 1 1

0 0 0 0

0 0 1 0

00

01

11

10 C

CD

A

D

B

K-map for F 3

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-22

Gate Logic: Two-Level Simplification

Design Example: Two Bit Adder

Block Diagramand

Truth Table

A 4-variable K-mapfor each of the 3output functions

+ N 3

X 0 0 0 0 0 0 0 1 0 0 1 1 0 1 1 1

Y 0 0 1 1 0 1 1 0 1 1 0 0 1 0 0 1

Z 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

C 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

B 0 1 0 1

A 0 0 1 1

A B

C D

N 1

N 2

X Y Z

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-23

Gate Logic: Two-Level SimplificationDesign Example (Continued)

X =

Z =

Y =

AB 00 01 11 10

0 0 0 0

0 0 1 0

0 1 1 1

0 0 1 1

00

01

11

10 C

CD

A

D

B

K-map for X

AB 00 01 11 10

0 0 1 1

0 1 0 1

1 0 1 0

1 1 0 0

00

01

11

10 C

CD

A

D

B

K-map for Y

AB 00 01 11 10

0 1 1 0

1 0 0 1

1 0 0 1

0 1 1 0

00

01

11

10 C

CD

A

D

B

K-map for Z

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-24

Gate Logic: Two-Level Simplification

A 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

B 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

C 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

W 0 0 0 0 0 0 0 1 1 0 X X X X X X

X 0 0 0 1 1 1 1 0 0 0 X X X X X X

Y 0 1 1 0 0 1 1 0 0 0 X X X X X X

Z 1 0 1 0 1 0 1 0 1 0 X X X X X X

Design Example: BCD Increment By 1

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-25

Gate Logic: Two-Level SimplificationDesign Example: BCD Increment By 1

W =

X =

Y =

Z =

AB 00 01 11 10

0 0 X 1

0 0 X 0

0 1 X X

0 0 X X

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

0 1 X 0

0 1 X 0

1 0 X X

0 1 X X

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

0 0 X 0

1 1 X 0

0 0 X X

1 1 X X

00

01

11

10 C

CD

A

D

B

AB 00 01 11 10

1 1 X 1

0 0 X 0

0 0 X X

1 1 X X

00

01

11

10 C

CD

A

D

B

Z Y

X W

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-26

Gate Logic: Two-Level Simplification5-Variable K-maps

ƒ(A,B,C,D,E) = m(2,5,7,8,10,13,15,17,19,21,23,24,29 31)

=

BC DE

BC DE

A =0

A =1

00 01 11 10 00

01

11

10

00 01 11 10 00

01

11

10

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

16 20 28 24

17 21 29 25

19 23 31 27

18 22 30 26

1

00

1

10

1

10 BC

DE 00 01 11

00

01

11

10

A=0

BC DE 00 01 11

01

11

10

A=1

1 1

1

1 1

1

1 1

1 1 1

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-27

Gate Logic: Two-Level Simplification5-Variable K-maps

ƒ(A,B,C,D,E) = m(2,5,7,8,10,13,15,17,19,21,23,24,29 31)

= C E + A B' E + B C' D' E' + A' C' D E'

BC DE 00 01 11 10

00

01

11

10

A=0

BC DE 00 01 11 10

00

01

11

10

A=1

1 1

1

1

1 1

1

1

1 1 1

1 1 1

BC DE

BC DE

A =0

A =1

00 01 11 10 00

01

11

10

00 01 11 10 00

01

11

10

0 4 12 8

1 5 13 9

3 7 15 11

2 6 14 10

16 20 28 24

17 21 29 25

19 23 31 27

18 22 30 26

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-28

Gate Logic: CAD Tools for SimplificationQuine-McCluskey Method

Karnaugh map method breaks down beyond six variables

Quine-McCluskey method finds the minimized representationof any Boolean expression by systematically finding all primeimplicants and then extracting a minimum set of primescovering the on-set

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-29

Gate Logic: CAD Tools for SimplificationESPRESSO Method

Problem with Quine-McCluskey: the number of prime implicants grows rapidly with the number of inputs

upper bound: 3 /n, where n is the number of inputsn

finding a minimum cover is NP-complete, i.e., a computational expensive process not likely to yield to any efficient algorithm

Espresso: trades solution speed for minimality of answer

don't generate all prime implicants (Quine-McCluskey Stage 1)

judiciously select a subset of primes that still covers the ON-set

operates in a fashion not unlike a human finding primes in a K-map

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-30

Two-Level Logic: Summary

Primitive logic building blocksINVERTER, AND, OR, NAND, NOR, XOR, XNOR

Canonical FormsSum of Products, Products of Sums

Incompletely specified functions/don't cares

Logic Minimization

Goal: two-level logic realizations with fewest gates and fewest number of gate inputs

Obtained via Laws and Theorems of Boolean Algebra

or Boolean Cubes and the Uniting Theorem

or K-map Methods up to 6 variables

or Quine-McCluskey Algorithm

or Espresso CAD Tool

Contemporary Logic DesignTwo-Level Logic

© R.H. Katz Transparency No. 4-31

Homework Assignment

HW#4 Chapter 2: Sections 2.3 and 2.4