Logic Gates and Truth Tables Implementing Logic Functions Canonical Forms

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 24

Lecture 4

Logic gates and truth tables Implementing logic functions Canonical forms

Sum-of-products Product-of-sums

Logic gates and truth tables

AND

XY
X Y

XY
Z

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

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

Z 0 0 0 1 Z 0 1 1 1

OR

X+Y
X Y Z

NOT

X'
X

_ X
Y

Logic gates and truth tables

NAND
X Y

XY

XY
Z

X 0 0 1 1

Y 0 1 0 1

Z 1 1 1 0

NOR
X Y

XY
Z

X 0 0 1 1

Y 0 1 0 1

Z 1 0 0 0

Logic gates and truth tables

XOR

XY
X Y Z

X 0 0 1 1

Y 0 1 0 1

Z 0 1 1 0

XNOR
X Y

XY
Z

X 0 0 1 1

Y 0 1 0 1

Z 1 0 0 1

Realizing Boolean formulas

A B C D F

F = (AB) + CD

F = C(A+B)

A B C F

Realizing truth tables

Given a truth table


1. Write the Boolean expression 2. Minimize the Boolean expression 3. Draw as gates

Example
A B 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 C 0 1 0 1 0 1 0 1 F 0 0 1 1 0 1 0 1

F = ABC+ABC+ABC+ABC = AB(C+C)+AC(B+B) = AB+AC

Example: Binary full adder

1-bit binary adder


Inputs: A, B, Carry-in Outputs: Sum, Carry-out


Cin 0 1 0 1 0 1 0 1 Cout 0 0 0 1 0 1 1 1 Sum 0 1 1 0 1 0 0 1

A B Cin

Adder

Sum Cout

A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

Sum = A'B'Cin + A'BCin' + AB'Cin' + ABCin Cout = A'BCin + AB'Cin + ABCin' + ABCin Both Sum and Cout can be minimized.

Full adder: Sum


Before Boolean minimization Sum = A'B'Cin + A'BCin' + AB'Cin' + ABCin After Boolean minimization Sum = (AB) Cin

Full adder: Carry-out


Before Boolean minimization Cout = A'BCin + AB'Cin + ABCin' + ABCin After Boolean minimization Cout = BCin + ACin + AB

10

Preview: 2-bit ripple-carry adder


A B
A1 B1 1-Bit Adder 0 Cin Cout Cin Cout A2 B2

Cin

Cout
Sum1 Sum2

Overflow Sum
11

Many possible mappings

Many ways to map expressions to gates _ _ _ _ Example: Z = AB(C+D) = A(B(C+D))

12

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?
13

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

14

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)


15

Sum-of-products (SOP)

Also called disjunctive normal form minterm (DNF) or minterm expansion


001 011 101 110 111

A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

C 0 1 0 1 0 1 0 1

F 0 1 0 1 0 1 1 1

F' 1 0 1 0 1 0 0 0

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

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


16

Minterms

Variables appear exactly once in each minterm in true or inverted form (but not both)
C 0 1 0 1 0 1 0 1 minterms A'B'C' m0 A'B'C m1 A'BC' m2 A'BC m3 AB'C' m4 AB'C m5 ABC' m6 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

A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

short-hand notation

17

Product-of-sums (POS)

Also called conjunctive normal form (CNF) or maxterm expansion


000 010 100

A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

C 0 1 0 1 0 1 0 1

F 0 1 0 1 0 1 1 1

F' 1 0 1 0 1 0 0 0

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

maxterm

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

Maxterms

Variables appear exactly once in each maxterm in true or inverted form (but not both)
C 0 1 0 1 0 1 0 1 maxterms A+B+C M0 A+B+C' M1 A+B'+C M2 A+B'+C' M3 A'+B+C M4 A'+B+C' M5 A'+B'+C M6 A'+B'+C' M7 F in canonical form: F(A,B,C) = M(0,2,4) = M0 M2 M4 = (A+B+C)(A+B'+C)(A'+B+C)

A 0 0 0 0 1 1 1 1

B 0 0 1 1 0 0 1 1

short-hand notation

19

Example: F = AB+C

20

From SOP to POS and back

Minterm to maxterm

Use maxterms that arent in minterm expansion F(A,B,C) = m(1,3,5,6,7) = M(0,2,4) Use minterms that arent in maxterm expansion F(A,B,C) = M(0,2,4) = m(1,3,5,6,7)
21

Maxterm to minterm

From SOP to POS and back

Minterm of F to minterm of F'


Use minterms that dont appear F(A,B,C) = m(1,3,5,6,7) F' = m(0,2,4) Use maxterms that dont appear F(A,B,C) = M(0,2,4) F' = M(1,3,5,6,7)

Maxterm of F to maxterm of F'


22

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)

23

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

24

You might also like