logical equivalence
play

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


  1. Logical equivalence Equivalence proof Multiplexers January 22, 2020 Patrice Belleville / Geoffrey Tien 1

  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

  3. Summary of equivalence rules Name Rule Name Rule 𝑞 ∧ 𝑈 ≡ 𝑞 𝑞 ∨ 𝑈 ≡ 𝑈 Identity laws Universal 𝑞 ∨ 𝐺 ≡ 𝑞 𝑞 ∧ 𝐺 ≡ 𝐺 bounds laws 𝑞 ∧ 𝑞 ≡ 𝑞 𝑞 ∨ 𝑟 ≡ 𝑟 ∨ 𝑞 Idempotent Commutative 𝑞 ∨ 𝑞 ≡ 𝑞 𝑞 ∧ 𝑟 ≡ 𝑟 ∧ 𝑞 laws laws 𝑞 ∨ 𝑟 ∨ 𝑠 ≡ 𝑞 ∨ 𝑟 ∨ 𝑠 𝑞 ∧ 𝑟 ∨ 𝑠 ≡ 𝑞 ∧ 𝑟 ∨ 𝑞 ∧ 𝑠 Associative Distributive 𝑞 ∧ 𝑟 ∧ 𝑠 ≡ 𝑞 ∧ 𝑟 ∧ 𝑠 𝑞 ∨ 𝑟 ∧ 𝑠 ≡ 𝑞 ∨ 𝑟 ∧ 𝑞 ∨ 𝑠 laws laws 𝑞 ∨ 𝑞 ∧ 𝑟 ≡ 𝑞 𝑞 ∨ ~𝑞 ≡ 𝑈 Absorption Negation laws 𝑞 ∧ 𝑞 ∨ 𝑟 ≡ 𝑞 𝑞 ∧ ~𝑞 ≡ 𝐺 laws ~ ~𝑞 ≡ 𝑞 ~ 𝑞 ∨ 𝑟 ≡ ~𝑞 ∧ ~𝑟 Double- DeMorgan's ~ 𝑞 ∧ 𝑟 ≡ ~𝑞 ∨ ~𝑟 negative law laws Definition of ⨁ 𝑞⨁𝑟 𝑞 → 𝑟 ≡ ~𝑞 ∨ 𝑟 Definition of ≡ 𝑞 ∨ 𝑟 ∧ ~ 𝑞 ∧ 𝑟 → 𝑞 → 𝑟 ≡ ~𝑟 → ~𝑞 Contrapositive law January 22, 2020 Patrice Belleville / Geoffrey Tien 3

  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

  5. Logical equivalence proofs • Example: prove that ~𝑏 ∧ 𝑐 ∨ 𝑏 ≡ 𝑏 ∨ 𝑐 • Proof: ~𝑏 ∧ 𝑐 ∨ 𝑏 ≡ 𝑏 ∨ ~𝑏 ∧ 𝑐 commutative law ≡ 𝑏 ∨ ~𝑏 ∧ 𝑏 ∨ 𝑐 distributive law ≡ ≡ 𝑏 ∨ 𝑐 identity law • What's missing? a) 𝑏 ∨ 𝑐 b) 𝐺 ∧ 𝑏 ∨ 𝑐 c) 𝑏 ∧ 𝑏 ∨ 𝑐 d) Something else e) Not enough information to tell January 22, 2020 Patrice Belleville / Geoffrey Tien 5

  6. Logic equivalence proofs • Worksheet! • Prove that: 𝑞 ∧ 𝑞 ∨ 𝑠 ∨ 𝑡 ≡ 𝑞 ∨ 𝑞 ∧ 𝑠 ∧ 𝑡 1) ~𝑞 ∧ 𝑟 ≡ ~𝑞 ∨ 𝑟 ∧ ~ ~𝑟 ∨ 𝑞 2) January 22, 2020 Patrice Belleville / Geoffrey Tien 6

  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

  8. 2 × 1 MUX 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 𝑛 = ~𝑡𝑓𝑚 ∧ 𝑏 ∨ 𝑡𝑓𝑚 ∧ 𝑐 ? January 22, 2020 Patrice Belleville / Geoffrey Tien 8

  9. 2 × 1 MUX Implementation • 𝑛 = ~𝑡𝑓𝑚 ∧ 𝑏 ∨ 𝑡𝑓𝑚 ∧ 𝑐 • Let's implement a circuit based on this logical expression • Seems reasonable, but this might not work as expected January 22, 2020 Patrice Belleville / Geoffrey Tien 9

  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

  11. Gate delay • Suppose 𝑏 , 𝑐 , 𝑡𝑓𝑚 are initially T – assume the gate delay is 10ns • How long will it take 𝑛 to reflect any changes in 𝑏 , 𝑐 , or 𝑡𝑓𝑚 ? T F a) 10 ns F T T b) 20 ns c) 30 ns T d) 40 ns T e) It may never happen January 22, 2020 Patrice Belleville / Geoffrey Tien 11

  12. Gate delay • We switch 𝑡𝑓𝑚 to F at time 0ns • At time 5ns: T F F T T T F January 22, 2020 Patrice Belleville / Geoffrey Tien 12

  13. Gate delay • We switch 𝑡𝑓𝑚 to F at time 0ns • At time 10ns: T F T T T F F January 22, 2020 Patrice Belleville / Geoffrey Tien 13

  14. Gate delay • We switch 𝑡𝑓𝑚 to F at time 0ns • At time 20ns: T T T F T F F The output became F January 22, 2020 Patrice Belleville / Geoffrey Tien 14

  15. Gate delay • We switch 𝑡𝑓𝑚 to F at time 0ns • At time 30ns: T T T T T F F The output became T again January 22, 2020 Patrice Belleville / Geoffrey Tien 15

  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

  17. Instability • Which one(s) of the following operations might cause an instability? changing 𝑏 or 𝑐 only a) changing 𝑡𝑓𝑚 , when exactly one of 𝑏 , 𝑐 is F b) changing 𝑡𝑓𝑚 , when both 𝑏 , 𝑐 are F c) d) both (a) and (b) e) None of (a), (b), or (c) January 22, 2020 Patrice Belleville / Geoffrey Tien 17

  18. Multiplexers • Here's a multiplexer that avoids the instability January 22, 2020 Patrice Belleville / Geoffrey Tien 18

  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

Recommend


More recommend