Gates – Part 2

Post on 30-Dec-2015

22 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Gates – Part 2. Converting English to Boolean Expressions. The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday. 1. Identify phrases. - PowerPoint PPT Presentation

Transcript

06 GATES2Page 1

ECEn 224 © 2003-2008BYU

Gates – Part 2

06 GATES2Page 2

ECEn 224 © 2003-2008BYU

Converting English to Boolean Expressions

06 GATES2Page 3

ECEn 224 © 2003-2008BYU

The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

06 GATES2Page 4

ECEn 224 © 2003-2008BYU

1. Identify phrases

F = air conditioner should be turned onA = temperature is greater than 75B = time is between 8a.m. and 5 p.mC = it is a holiday

The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

06 GATES2Page 5

ECEn 224 © 2003-2008BYU

2. Identify connective words =

The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

AND

06 GATES2Page 6

ECEn 224 © 2003-2008BYU

3. Construct a Boolean Expression

F = air conditioner should be turned onA = temperature is greater than 75B = time is between 8a.m. and 5 p.mC = it is a holiday

F = A • B • C’

The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

06 GATES2Page 7

ECEn 224 © 2003-2008BYU

4. Draw the Network

F = A • B • C’

The air conditioner should be turned on if and only if: - the temperature is greater than 75, - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

BA

CF

06 GATES2Page 8

ECEn 224 © 2003-2008BYU

Converting English to Boolean

1. Identify phrases2. Identify connective words3. Construct a Boolean Expression4. Draw the Network

06 GATES2Page 9

ECEn 224 © 2003-2008BYU

Converting English to Boolean

• Be careful: Boolean algebra is precise, English is not.

The roads will be very slippery if it snows or rains and there is oil on the road.

F = A + BC

or

F = (A + B) C

AB C

Which is it?

06 GATES2Page 10

ECEn 224 © 2003-2008BYU

AND/OR vs. OR/AND Logic Forms

06 GATES2Page 11

ECEn 224 © 2003-2008BYU

AND/OR Logic from Truth Table

1. Write the SOP by inspection for f

A

B

C

f

f = A’B’C +AB’C + ABC’ + ABC

A B C f

0 0 0 00 0 1 10 1 0 00 1 1 01 0 0 01 0 1 11 1 0 11 1 1 1

06 GATES2Page 12

ECEn 224 © 2003-2008BYU

AND/OR Logic from Truth Table

2. Simplify the equation

f = A’B’C +AB’C + ABC’ + ABC

f = (A + A’) B’C + AB (C + C’)

f = AB + B’C

06 GATES2Page 13

ECEn 224 © 2003-2008BYU

AND/OR Logic from Truth Table

3. Draw the logic network

f = AB + B’C

A

B

C

f

“AND/OR”

06 GATES2Page 14

ECEn 224 © 2003-2008BYU

OR/AND Logic from Truth Table

A

B

C

f

f ’ = A’B’C’ + A’BC’ + AB’C’f = (A’B’C’ + A’BC’ + AB’C’)’f = (A + B + C)(A + B’ + C)(A’ + B + C)

1. Write a POS by inspection from f

A B C f

0 0 0 00 0 1 10 1 0 00 1 1 11 0 0 01 0 1 11 1 0 11 1 1 1

06 GATES2Page 15

ECEn 224 © 2003-2008BYU

OR/AND Logic from Truth Table

3. Simplify the equation:

f = (A + B + C)(A + B’ + C)(A’ + B + C)f = (A + B)(A + B’)(A’ + B) + Cf = (A)(A’ + B) + Cf = (AA’ + AB) + Cf = AB + Cf = (A + C)(B + C)

A + BCD = A + B(CD)= (A + B)(A + CD)= (A + B)(A + C)(A + D)

(X + Y)(X + Y’) = X

06 GATES2Page 16

ECEn 224 © 2003-2008BYU

OR/AND Logic from Truth Table

4. Draw the logic network

f = (A+C)(B+C)

BC

AC

f

“OR/AND”

06 GATES2Page 17

ECEn 224 © 2003-2008BYU

Types of Gates

• Gates already studied

– AND, NAND

– OR, NOR

– Inverter (NOT)

– XOR (Exclusive-OR)

– XNOR (Equivalence)

06 GATES2Page 18

ECEn 224 © 2003-2008BYU

NAND/NAND and NOR/NOR Logic

06 GATES2Page 19

ECEn 224 © 2003-2008BYU

AND/OR to NAND/NAND

AB+CD = [AB+CD]’’= [(AB)’(CD)’]’

Algebra-based:

Schematic-based:Preferred symbol in this context…

06 GATES2Page 20

ECEn 224 © 2003-2008BYU

OR/AND to NOR/NOR

(A+B)(C+D) = [(A+B)(C+D)]’’= [(A+B)’ + (C+D)’]’

Algebra-based:

Schematic-based:Preferred symbol in this context…

06 GATES2Page 21

ECEn 224 © 2003-2008BYU

Alternative Gate SymbolsWhich is easier to understand?

A

B

C

D

Q = AB + CD

A

B

C

D

Q = ?

A

B

C

D

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

A

B

C

D

Q = ?

If you think of the bubbles as canceling each other out…

06 GATES2Page 22

ECEn 224 © 2003-2008BYU

Bubble Matching

How to make schematics readable, understandable,

maintainable, …

06 GATES2Page 23

ECEn 224 © 2003-2008BYU

Bubble Matching Rules

• Choose alternative symbols• Match all interior bubbles • More than one solution• Makes reading of the function trivial

AB

CD

FAB

CD

F

F = [(AB)’(C+D)’]’ ??? F = AB + (C+D) = AB+C+D

06 GATES2Page 24

ECEn 224 © 2003-2008BYU

More Bubble Matching

AB

CD

FAB

CD

F

This doesn’t work – has unmatched bubbles

AB

CD

F

This works. F = AB + C’D’

06 GATES2Page 25

ECEn 224 © 2003-2008BYU

Yet More Bubble Matching

AB

CD

F

Alternative solution = convert top-left gate.

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

Same result as on previous slide

AB

CD

F

Same circuit as on previous slide…

06 GATES2Page 26

ECEn 224 © 2003-2008BYU

Can Bubbles Always Be Matched?

• No…

A

B

CD

EF

x

y

Nodes x and y both drive final gate and so both need same polarity (bubble or no bubble).

Can’t satisfy that requirement because x also drives y’s input.

This is called reconvergent fanout

06 GATES2Page 27

ECEn 224 © 2003-2008BYU

Bubble Matching Summary

• Convert symbols to match bubbles– Two versions for each circuit

• Inverted output• Non-inverted output

• Good schematic style similar to good programming style– Convey meaning as well as function– Document the design

06 GATES2Page 28

ECEn 224 © 2003-2008BYU

Functional Completeness

06 GATES2Page 29

ECEn 224 © 2003-2008BYU

Functionally Complete

• AND, OR, and NOT make a functionally complete set of operators– There is no truth table which cannot be

implemented using AND, OR, NOT– Any set of gates which can implement AND, OR

and NOT is also functionally complete

06 GATES2Page 30

ECEn 224 © 2003-2008BYU

Functionally Complete

• Is the set {AND, NOT} functionally complete?• If I could just build an OR gate…

or…

X + Y = (X’Y’)’

Success!

06 GATES2Page 31

ECEn 224 © 2003-2008BYU

Functionally Complete

• Is the set {OR, NOT} functionally complete?• If I could just build an AND gate…

Success!

or…

XY = (X’ + Y’)’

06 GATES2Page 32

ECEn 224 © 2003-2008BYU

Functionally Complete

• Is the set {AND, OR} functionally complete?

• No! Can’t do a NOT

06 GATES2Page 33

ECEn 224 © 2003-2008BYU

How About NAND Only?

NOT

AND

OR

Success!

06 GATES2Page 34

ECEn 224 © 2003-2008BYU

How About NOR Only?

NOT

OR

AND

Success!

06 GATES2Page 35

ECEn 224 © 2003-2008BYU

Functional Completeness

• A few functionally complete sets:

AND, OR, NOT

OR, NOT

AND, NOT

NOR

NAND

top related