CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

39
CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties

Transcript of CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Page 1: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

CSC 110 -Intro. to Computing

Lecture 7:

Circuits & Boolean Properties

Page 2: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Announcements

Course slides are available from web pagePosted both before and after classSlides after class includes my drawings

Homework #2 handed out at end of classAlso available on course web pageDue by 5PM on Thursday, Feb. 9

CSC tutors are still availableHours posted outside Wehle 206 & 208

Page 3: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Announcements

Quiz #1 handed back at end of class Mean score: 82 Standard deviation: 20 Answer key available on web page

Lowest quiz and homework score is dropped I expect everyone will still get a 100% for this course

Do not worry about your difficulties in mathematics. I can assure you mine are still greater.

-- Albert Einstein

Page 4: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Truth Table

a) a b

Page 5: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Diagram

a) a b

Page 6: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Truth Table

b) a b

Page 7: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Diagram

b) a b

Page 8: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Truth Table

c) ( ) a b a

Page 9: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Diagram

c) ( ) a b a

Page 10: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Truth Table

d) ( ) c a b

Page 11: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Diagram

d) ( ) c a b

Page 12: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Truth Table

e) ( ) ( ) c a a b

Page 13: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

In-Class Exercise Diagram

e) ( ) ( ) c a a b

Page 14: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Boolean Properties

Law of Double Negation: a a

Property AND OR

Commutative a·b = b·a a+b = b+a

Associative a·(b·c) = (a·b)·c a+(b+c)=(a+b)+c

Distributive a·(b+c) = (a·b)+(a·c) a+(b·c) = (a+b)·(a+c)

Identity a·1 = a a+0 = a

Complement a·ā = 0 a+ā = 1

DeMorgan a·b = ā+b a+b = ā·b

Idempotency a·a = a a+a = a

Page 15: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

More About Boolean Properties

Properties identify equivalent circuitsE.g., circuits with identical truth table results

Many ways we use these propertiesReduce delays by doing more work in parallelSimplify circuits by removing useless gates

0 1 0

1 0 1

aa a

Page 16: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Usedb+a Identity

Reduce to a+b:

Page 17: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Usedb+a Identitya+b

Reduce to a+b:

Page 18: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Useda·(a·b) Identity

Reduce to a·b:

Page 19: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Useda·(a·b) Identity(a·a)·b

Reduce to a·b:

Page 20: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Useda·(a·b) Identity(a·a)·b Associative

a·b

Reduce to a·b:

Page 21: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Used(c·d)+(d·c) Identity

Reduce to c:

Page 22: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Used(c·d)+(d·c) Identity(c·d)+(c·d)

Reduce to c:

Page 23: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Used(c·d)+(d·c) Identity(c·d)+(c·d) Commutative

c·(d+d)

Reduce to c:

Page 24: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Used(c·d)+(d·c) Identity(c·d)+(c·d) Commutative

c·(d+d) Distributivec·1

Reduce to c:

Page 25: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Used(c·d)+(d·c) Identity(c·d)+(c·d) Commutative

c·(d+d) Distributivec·1 Complementc

Reduce to c:

Page 26: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Used(y·z)·(z·y) Identity

Reduce to y·z:

Page 27: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Used(y·z)·(z·y) Identity(y·z)·(y·z)

Reduce to y·z:

Page 28: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Used(y·z)·(z·y) Identity(y·z)·(y·z) Commutative

y·z

Reduce to y·z:

Page 29: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

DeMorgan’s Laws

Two laws specific to logicalsystemsFirst stated in present form by Prof.

DeMorganUseful for evaluating & simplifying

circuitsMake great quiz questions, too

Page 30: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

DeMorgan’s Laws

Only properties that works with NAND or NOR gatesEasy to know when it should be used

How to use DeMorgan’s LawsNegate the inputs to the NAND/NOR gateReplace the gate with its opposite

NAND becomes an OR NOR becomes an AND

Page 31: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Usedb·a Identity

Reduce to a+b:

Page 32: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Usedb·a Identityb+a DeMorgan’s

Reduce to a+b:

Page 33: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Usedb·a Identityb+a DeMorgan’sb+a

Reduce to a+b:

Page 34: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Using Boolean Properties

Circuit Property Usedb·a Identityb+a DeMorgan’sb+a Double Negationa+b

Reduce to a+b:

Page 35: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Half-Adders

Half-adder is a simple, but vital, circuitAccepts two bits as inputCircuit then adds the two bitsOutputs the result bit and a carry bit

Half-adder can only be used to add least significant bit of a large number

Page 36: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Half-Adder

Which line is result and which is carry?

Page 37: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Full-Adders

Full-adder continues adding two numbersTakes two new bits and carry bit from last

adder as inputsCircuit adds all the bitsOutputs a result bit and another carry bit

Full-adder is used to add additional bitsAlso makes EXCELLENT quiz and midterm

questions

Page 38: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

Full-Adder

Slightly more complex version of a half-adder

Page 39: CSC 110 - Intro. to Computing Lecture 7: Circuits & Boolean Properties.

For next lecture

Do your homework! Start reading Section 5 Be ready to discuss:

Computer components