Logical equivalence Equivalence proof Multiplexers January 22, - - PowerPoint PPT Presentation

logical equivalence
SMART_READER_LITE
LIVE PREVIEW

Logical equivalence Equivalence proof Multiplexers January 22, - - PowerPoint PPT Presentation

Logical equivalence Equivalence proof Multiplexers January 22, 2020 Patrice Belleville / Geoffrey Tien 1 Announcements Pre-class quiz #4, due Sunday, Jan.26, 19:00 Epp 4e/5e: Chapter 2.3 Pre-class quiz #5, due Sunday, Feb.02, 19:00


slide-1
SLIDE 1

Logical equivalence

Equivalence proof Multiplexers

January 22, 2020 Patrice Belleville / Geoffrey Tien 1

slide-2
SLIDE 2

Announcements

  • Pre-class quiz #4, due Sunday, Jan.26, 19:00

– Epp 4e/5e: Chapter 2.3

  • Pre-class quiz #5, due Sunday, Feb.02, 19:00

– Epp 4e/5e: Chapter 3.1, 3.3

  • HW1 due tomorrow, 19:00

– Start the submission process early – there are several steps which may take a few minutes

January 22, 2020 Patrice Belleville / Geoffrey Tien 2

slide-3
SLIDE 3

Summary of equivalence rules

Name Rule Name Rule Identity laws 𝑞 ∧ 𝑈 ≡ 𝑞 𝑞 ∨ 𝐺 ≡ 𝑞 Universal bounds laws 𝑞 ∨ 𝑈 ≡ 𝑈 𝑞 ∧ 𝐺 ≡ 𝐺 Idempotent laws 𝑞 ∧ 𝑞 ≡ 𝑞 𝑞 ∨ 𝑞 ≡ 𝑞 Commutative laws 𝑞 ∨ 𝑟 ≡ 𝑟 ∨ 𝑞 𝑞 ∧ 𝑟 ≡ 𝑟 ∧ 𝑞 Associative laws 𝑞 ∨ 𝑟 ∨ 𝑠 ≡ 𝑞 ∨ 𝑟 ∨ 𝑠 𝑞 ∧ 𝑟 ∧ 𝑠 ≡ 𝑞 ∧ 𝑟 ∧ 𝑠 Distributive laws 𝑞 ∧ 𝑟 ∨ 𝑠 ≡ 𝑞 ∧ 𝑟 ∨ 𝑞 ∧ 𝑠 𝑞 ∨ 𝑟 ∧ 𝑠 ≡ 𝑞 ∨ 𝑟 ∧ 𝑞 ∨ 𝑠 Absorption laws 𝑞 ∨ 𝑞 ∧ 𝑟 ≡ 𝑞 𝑞 ∧ 𝑞 ∨ 𝑟 ≡ 𝑞 Negation laws 𝑞 ∨ ~𝑞 ≡ 𝑈 𝑞 ∧ ~𝑞 ≡ 𝐺 Double- negative law ~ ~𝑞 ≡ 𝑞 DeMorgan's laws ~ 𝑞 ∨ 𝑟 ≡ ~𝑞 ∧ ~𝑟 ~ 𝑞 ∧ 𝑟 ≡ ~𝑞 ∨ ~𝑟 Definition of ⨁ 𝑞⨁𝑟 ≡ 𝑞 ∨ 𝑟 ∧ ~ 𝑞 ∧ 𝑟 Definition of → 𝑞 → 𝑟 ≡ ~𝑞 ∨ 𝑟 Contrapositive law 𝑞 → 𝑟 ≡ ~𝑟 → ~𝑞

January 22, 2020 Patrice Belleville / Geoffrey Tien 3

slide-4
SLIDE 4

Logical equivalence proofs

  • How do we write a logical equivalence proof?

– State the theorem we want to prove – Indicate the beginning of the proof by "Proof:" – Start with one side and work towards the other

  • one step at a time
  • without forgetting to justify each step
  • usually we will simplify the more complicated proposition instead of

trying to complicate the simpler one

– Indicate the end of the proof by "QED" or

January 22, 2020 Patrice Belleville / Geoffrey Tien 4

slide-5
SLIDE 5

Logical equivalence proofs

  • Example: prove that ~𝑏 ∧ 𝑐 ∨ 𝑏 ≡ 𝑏 ∨ 𝑐
  • Proof:

January 22, 2020 Patrice Belleville / Geoffrey Tien 5

~𝑏 ∧ 𝑐 ∨ 𝑏 ≡ 𝑏 ∨ ~𝑏 ∧ 𝑐 commutative law ≡ 𝑏 ∨ ~𝑏 ∧ 𝑏 ∨ 𝑐 distributive law ≡ ≡ 𝑏 ∨ 𝑐 identity law

  • What's missing?

a) 𝑏 ∨ 𝑐 b) 𝐺 ∧ 𝑏 ∨ 𝑐 c) 𝑏 ∧ 𝑏 ∨ 𝑐 d) Something else e) Not enough information to tell

slide-6
SLIDE 6

Logic equivalence proofs

  • Worksheet!
  • Prove that:

1) 𝑞 ∧ 𝑞 ∨ 𝑠 ∨ 𝑡 ≡ 𝑞 ∨ 𝑞 ∧ 𝑠 ∧ 𝑡 2) ~𝑞 ∧ 𝑟 ≡ ~𝑞 ∨ 𝑟 ∧ ~ ~𝑟 ∨ 𝑞

January 22, 2020 Patrice Belleville / Geoffrey Tien 6

slide-7
SLIDE 7

Modeling circuits with propositional logic

  • Propositional logic is not a perfect model of how logic gates

work

  • To understand why, we will look at a multiplexer (MUX)
  • A multiplexer selects one of several possible input signals, and

"steers" it to a single output

– Analogy: An HDMI switchbox for your TV

January 22, 2020 Patrice Belleville / Geoffrey Tien 7

slide-8
SLIDE 8

2×1 MUX

January 22, 2020 Patrice Belleville / Geoffrey Tien 8

Truth table

a b sel m F F F F F F T F F T F F F T T T T F F T T F T F T T F T T T T T 𝑛 = ~𝑡𝑓𝑚 ∧ 𝑏 ∨ 𝑡𝑓𝑚 ∧ 𝑐 ?

slide-9
SLIDE 9

2×1 MUX

  • 𝑛 = ~𝑡𝑓𝑚 ∧ 𝑏 ∨ 𝑡𝑓𝑚 ∧ 𝑐
  • Let's implement a circuit based on this logical expression

January 22, 2020 Patrice Belleville / Geoffrey Tien 9

Implementation

  • Seems reasonable, but this might not work as expected
slide-10
SLIDE 10

Gate delay

  • Fact: gates do not operate instantaneously

– If we change the input of a gate at time 𝑢 = 0 – the output of the gate will only reflect the change some time later – This time gap is called the gate delay

January 22, 2020 Patrice Belleville / Geoffrey Tien 10

slide-11
SLIDE 11

Gate delay

a) 10 ns b) 20 ns c) 30 ns d) 40 ns e) It may never happen

January 22, 2020 Patrice Belleville / Geoffrey Tien 11

T F T T T T F

  • Suppose 𝑏, 𝑐, 𝑡𝑓𝑚 are initially T

– assume the gate delay is 10ns

  • How long will it take 𝑛 to reflect any changes in 𝑏, 𝑐, or 𝑡𝑓𝑚?
slide-12
SLIDE 12

Gate delay

  • We switch 𝑡𝑓𝑚 to F at time 0ns
  • At time 5ns:

January 22, 2020 Patrice Belleville / Geoffrey Tien 12

F F T T T T F

slide-13
SLIDE 13

Gate delay

  • We switch 𝑡𝑓𝑚 to F at time 0ns
  • At time 10ns:

January 22, 2020 Patrice Belleville / Geoffrey Tien 13

F T T T F T F

slide-14
SLIDE 14

Gate delay

  • We switch 𝑡𝑓𝑚 to F at time 0ns
  • At time 20ns:

January 22, 2020 Patrice Belleville / Geoffrey Tien 14

F T T T F F T The output became F

slide-15
SLIDE 15

Gate delay

  • We switch 𝑡𝑓𝑚 to F at time 0ns
  • At time 30ns:

January 22, 2020 Patrice Belleville / Geoffrey Tien 15

F T T T F T T The output became T again

slide-16
SLIDE 16

Instability

  • The output changed from T (old output) to F briefly, and then

to T (new output)

  • This is called an instability
  • The cause of the problem:

– the information from 𝑡𝑓𝑚 travels on two different paths to the output – these paths contain different numbers of gates – the shorter path may affect the output until the information on the longer path catches up

January 22, 2020 Patrice Belleville / Geoffrey Tien 16

slide-17
SLIDE 17

Instability

  • Which one(s) of the following operations might cause an

instability?

a) changing 𝑏 or 𝑐 only b) changing 𝑡𝑓𝑚, when exactly one of 𝑏, 𝑐 is F c) changing 𝑡𝑓𝑚, when both 𝑏, 𝑐 are F d) both (a) and (b) e) None of (a), (b), or (c)

January 22, 2020 Patrice Belleville / Geoffrey Tien 17

slide-18
SLIDE 18

Multiplexers

  • Here's a multiplexer that avoids the instability

January 22, 2020 Patrice Belleville / Geoffrey Tien 18

slide-19
SLIDE 19

More exercises

  • Use equivalence rules to reduce the following expressions to

the specified number of literals:

– ~𝑞 ∧ ~𝑟 ∨ 𝑞 ∧ 𝑟 ∧ 𝑠 ∨ ~𝑞 ∧ 𝑟 , to three literals – 𝑞 ∨ 𝑟 ∧ 𝑠 ∨ ~ 𝑞 ∨ 𝑠 , to two literals

  • Prove:

– 𝑏 ∧ ~𝑐 ∨ ~𝑏 ∧ 𝑐 ≡ 𝑏 ∨ 𝑐 ∧ ~ 𝑏 ∧ 𝑐

January 22, 2020 Patrice Belleville / Geoffrey Tien 19