24
1 Lecture 4 Logic gates and truth tables Implementing logic functions Canonical forms Sum-of-products Product-of-sums

Lecture 4

  • Upload
    tarala

  • View
    35

  • Download
    0

Embed Size (px)

DESCRIPTION

Lecture 4. Logic gates and truth tables Implementing logic functions Canonical forms Sum-of-products Product-of-sums. XYZ 000 010 100 111. X. Z. Y. XYZ 000 011 101 111. X. Z. Y. XY 01 10. X. Y. Logic gates and truth tables. ANDX•YXY ORX + Y NOTX'X. - PowerPoint PPT Presentation

Citation preview

Page 1: Lecture 4

1

Lecture 4

Logic gates and truth tables Implementing logic functions Canonical forms

Sum-of-products Product-of-sums

Page 2: Lecture 4

2

Logic gates and truth tables

AND X•Y XY

OR X + Y

NOT X' X

XY Z

X Y Z0 0 00 1 01 0 01 1 1

XY

Z

X Y

_

X Y Z0 0 00 1 11 0 11 1 1

X Y0 11 0

Page 3: Lecture 4

3

Logic gates and truth tables

NAND

NOR

X Y XY X Y Z0 0 10 1 11 0 11 1 0

X Y Z0 0 10 1 01 0 01 1 0

X Y

XY

Z

ZX

Y

Page 4: Lecture 4

4

Logic gates and truth tables

XOR

XNOR

X

YZ

ZXY

X Y Z0 0 00 1 11 0 11 1 0

X Y Z0 0 10 1 01 0 01 1 1

X Y

X Y

Page 5: Lecture 4

5

Realizing Boolean formulas

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

F

A

B

C

D

A

B

CF

Page 6: Lecture 4

6

Realizing truth tables

Given a truth table1. Write the Boolean expression

2. Minimize the Boolean expression

3. Draw as gates

Page 7: Lecture 4

7

Example

A B C F0 0 0 00 0 1 00 1 0 10 1 1 11 0 0 01 0 1 11 1 0 01 1 1 1

F = A’BC’+A’BC+AB’C+ABC = A’B(C’+C)+AC(B’+B) = A’B+AC

Page 8: Lecture 4

8

Example: Binary full adder

1-bit binary adder Inputs: A, B, Carry-in Outputs: Sum, Carry-out

AB

CinCoutSumAdder

A B Cin Cout Sum0 0 0 0 0 1 0 1 0 0 1 11 0 0 1 0 1 1 1 0 1 1 1

01101001

00010111

Cout = A'BCin + AB'Cin + ABCin' + ABCin

Both Sum and Cout can be minimized.

Sum = A'B'Cin + A'BCin' + AB'Cin' + ABCin

Page 9: Lecture 4

9

Full adder: Sum

Before Boolean minimization

Sum = A'B'Cin + A'BCin'

+ AB'Cin' + ABCin

After Boolean minimization

Sum = (AB) Cin

Page 10: Lecture 4

10

Full adder: Carry-out

Before Boolean minimization

Cout = A'BCin + AB'Cin + ABCin' + ABCin

After Boolean minimization

Cout = BCin + ACin + AB

Page 11: Lecture 4

11

Preview: 2-bit ripple-carry adder

A1 B1

CoutCin

Sum1

A2 B2

Sum2

CoutCin0

Overflow

A

Sum

CoutCin

B

1-Bit Adder

Page 12: Lecture 4

12

Many possible mappings

Many ways to map expressions to gates

Example: Z = AB(C+D) = A(B(C+D))_ _ _ _

Page 13: Lecture 4

13

What is the optimal realization?

We use the axioms and theorems of Boolean algebra to “optimize” our designs

Design goals vary Reduce the number of gates? Reduce the number of gate inputs? Reduce the number of cascaded levels of

gates?

Page 14: Lecture 4

14

What is the optimal realization?

How do we explore the tradeoffs? Logic minimization: Reduce number of

gates and complexity Logic optimization: Maximize speed

and/or minimize power CAD tools

Page 15: Lecture 4

15

Canonical forms

Canonical forms Standard forms for Boolean expressions Derived from truth table Generally not the simplest forms (can be

minimized) Two canonical forms

Sum-of-products (minterms) Product-of-sums (maxterms)

Page 16: Lecture 4

16

Sum-of-products (SOP)

Also called disjunctive normal form (DNF) or minterm expansion

A B C F F'0 0 0 0 10 0 1 1 00 1 0 0 10 1 1 1 01 0 0 0 11 0 1 1 01 1 0 1 01 1 1 1 0

001 011 101 110 111

F = A'B'C + A'BC + AB'C + ABC' + ABC

F' = A'B'C' + A'BC' + AB'C'

minterm

Page 17: Lecture 4

17

Minterms

Variables appear exactly once in each minterm in true or inverted form (but not both)

short-hand notation

A B C minterms0 0 0 A'B'C' m00 0 1 A'B'C m10 1 0 A'BC' m20 1 1 A'BC m31 0 0 AB'C' m41 0 1 AB'C m51 1 0 ABC' m61 1 1 ABC m7

F in canonical form:F(A,B,C)= m(1,3,5,6,7)

= m1 + m3 + m5 + m6 + m7= A'B'C+A'BC+AB'C+ABC'+ABC

Page 18: Lecture 4

18

Product-of-sums (POS)

Also called conjunctive normal form (CNF) or maxterm expansion

A B C F F'0 0 0 0 10 0 1 1 00 1 0 0 10 1 1 1 01 0 0 0 11 0 1 1 01 1 0 1 01 1 1 1 0

000 010 100

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

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

maxterm

Page 19: Lecture 4

19

Maxterms

Variables appear exactly once in each maxterm in true or inverted form (but not both)

A B C maxterms0 0 0 A+B+C M00 0 1 A+B+C' M10 1 0 A+B'+C M20 1 1 A+B'+C' M31 0 0 A'+B+C M41 0 1 A'+B+C' M51 1 0 A'+B'+C M61 1 1 A'+B'+C' M7

short-hand notation

F in canonical form:F(A,B,C)= M(0,2,4)

= M0 • M2 • M4= (A+B+C)(A+B'+C)(A'+B+C)

Page 20: Lecture 4

20

Example: F = AB+C

Page 21: Lecture 4

21

From SOP to POS and back

Minterm to maxterm Use maxterms that aren’t in minterm

expansion F(A,B,C) = m(1,3,5,6,7) = M(0,2,4)

Maxterm to minterm Use minterms that aren’t in maxterm

expansion F(A,B,C) = M(0,2,4) = m(1,3,5,6,7)

Page 22: Lecture 4

22

From SOP to POS and back

Minterm of F to minterm of F' Use minterms that don’t appear F(A,B,C) = m(1,3,5,6,7) F' =

m(0,2,4)

Maxterm of F to maxterm of F' Use maxterms that don’t appear F(A,B,C) = M(0,2,4) F' =

M(1,3,5,6,7)

Page 23: Lecture 4

23

SOP, POS, and DeMorgan's

Sum-of-products F' = A'B'C' + A'BC' + AB'C'

Apply DeMorgan's to get POS (F')' = (A'B'C' + A'BC' + AB'C')' F = (A+B+C)(A+B'+C)(A'+B+C)

Page 24: Lecture 4

24

SOP, POS, and DeMorgan's

Product-of-sums F' = (A+B+C')(A+B'+C')(A'+B+C')(A'+B'+C')

Apply DeMorgan's to get SOP (F')' = ((A+B+C')(A+B'+C')(A'+B+C')(A'+B'+C'))' F = A'B'C + A'BC + AB'C + ABC