/
Warm up Try to prove   if you didn’t get all the way through it last time. Warm up Try to prove   if you didn’t get all the way through it last time.

Warm up Try to prove if you didn’t get all the way through it last time. - PowerPoint Presentation

finley
finley . @finley
Follow
65 views
Uploaded On 2023-10-04

Warm up Try to prove if you didn’t get all the way through it last time. - PPT Presentation

  Digital Logic CSE 311 Autumn 2020 Lecture 4 Contrapositive     Law of Implication Commutativity Double Negation Law of Implication All of our rules deal with ORs and ANDs lets switch the implication to just use ANDNOTOR ID: 1021994

true 1110 step false 1110 true false step logic boolean day talk monday00001monday00011tuesday00101tuesday00111wednesday01001wednesday01011thursday01101thursday01111friday10001friday10011saturday10101saturday10111sunday11001sunday11011 1111daytalktosomeonemonday00001monday00011tuesday00101tuesday00111wednesday01001wednesday01011thursday01101thursday01111friday10001friday10011saturday10101saturday10111sunday11001sunday11011 algebra notation circuit problem rules

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Warm up Try to prove if you didn’t g..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1. Warm upTry to prove if you didn’t get all the way through it last time. 

2. Digital LogicCSE 311 Autumn 2020Lecture 4

3. Contrapositive   Law of ImplicationCommutativityDouble NegationLaw of ImplicationAll of our rules deal with ORs and ANDs, let’s switch the implication to just use AND/NOT/OR.And do the same with our target It’s ok to work from both ends. In fact it’s a very common strategy!Now how do we get the top to look like the bottom? Just a few more rules and we’re done!

4. AnnouncementsEveryone should have access to gradescope (you should have gotten a sign-up email if you don’t already have an account).If you can’t access the course on gradescope, let us know as soon as possible.Turning in an assignment to gradescope often takes about 15 minutes.You have to tell gradescope which page each problem is on.

5. TodayIt’s notation day! Two new different ways to represent propositions.Also vocabulary catch-up.

6. Digital Logic

7. Digital CircuitsComputing With LogicT corresponds to 1 or “high” voltage F corresponds to 0 or “low” voltageGates Take inputs and produce outputs (functions)Several kinds of gatesCorrespond to propositional connectives (most of them)

8. And Gatepqp  qTTTTFFFTFFFFpqOUT111100010000AND ConnectiveAND GateqpOUTAND“block looks like D of AND”pOUTANDqp  qvs.

9. Or Gatepqp  qTTTTFTFTTFFFpqOUT111101011000OR ConnectiveOR Gatep OUT ORqp  qvs.pqOR“arrowhead block looks like V”OUT

10. Not GatespNOT Gatep pTFFTpOUT1001vs.NOT Connective Also called inverterpOUTNOTpOUTNOT

11. Blobs are Okay!pOUTNOTpqOUTANDpqOUTORYou may write gates using blobs instead of shapes!

12. Combinational Logic CircuitsValues get sent along wires connecting gates NOTORANDANDNOTpqrsOUT

13. Combinational Logic CircuitsValues get sent along wires connecting gates NOTORANDANDNOTpqrsOUT

14. Combinational Logic CircuitsWires can send one value to multiple gates!ORANDNOTANDpqrOUT

15. Combinational Logic CircuitsWires can send one value to multiple gates!ORANDNOTANDpqrOUT 

16. Vocabulary Break!

17. Vocabulary!Tautology if it is always true.Contradiction if it is always false.Contingency if it can be both true and false.A proposition is a….TautologyIf is true, is true; if is false, is true. ContradictionIf is true, is false; if is false, is false. Contingency If is true and is true, is true; If is true and is false, is false.    

18. More Vocabulary is called the “hypothesis” or “antecedent” (or other names…) is called the “conclusion” or “consequent” (or other names…) 

19. Back to Notation Day

20. On notation…Logic is fundamental. Computer scientists use it in programs, mathematicians use it in proofs, engineers use it in hardware, philosophers use it in arguments,….…so everyone uses different notation to represent the same ideas.Since we don’t know exactly what you’re doing next, we’re going to show you a bunch of them; but don’t think one is “better” than the others!

21. Meet Boolean AlgebraPreferred by some mathematicians and circuit designers.“or” is “and” is (i.e. “multiply”)“not” is ‘ (an apostrophe after a variable)Why?Mathematicians like to study “operations that work kinda like ‘plus’ and ‘times’ on integers.”Circuit designers have a lot of variables, and this notation is more compact. 

22. Meet Boolean AlgebraNameVariables“True/False”“And”“Or”“Not”ImplicationJava Codeboolean btrue,false&&||!No special symbolPropositional LogicT, FCircuitsWires1, 0No special symbolBoolean Algebra1,0 (“multiplication”)(“addition”)(apostrophe after variable) No special symbolNameVariables“True/False”“And”“Or”“Not”ImplicationJava Codeboolean btrue,false&&||!No special symbolPropositional LogicT, FCircuitsWires1, 0No special symbolBoolean Algebra1,0No special symbol  Propositional logicBoolean Algebra

23. ComparisonRemember this is just an alternate notation for the same underlying ideas.So that big list of identities? Just change the notation and you get another big list of identities!  Propositional logicBoolean Algebra

24. Boolean Algebra

25. Boolean Algebra

26. Boolean Algebra

27. An Exercise in NotationThe rest of today we’re solving a problem.See the concepts we learned the last few days “in action”And practice Boolean algebra and propositional logic.

28. Today’s GoalGo from a problem statement to code to logical/circuit representation to an “optimized” version.Why?Practice translating between different representations.Practice applying simplification lawsHistorical context! This process is reminiscent of “hardware acceleration” – designing custom hardware to do a single task very fast. Most design is done automatically these days, but it’s still nice to see once.

29. Our GoalGiven what day of the week it is and what kind of question you have, what’s the quickest way to get it answered? (this is an example, not actual advice)Input: day of the week, Boolean talkToSomeoneOutput: The way to get your question answered, according to the following rules:On M,Tu,W,F if you want to talk, go to office hoursOn Th if you want to talk, go to sectionMonday through Friday, if you don’t want to talk ask on EdOn Saturday or Sunday, text a friend (whether you want to talk or not)

30. Step OneInput: day of the week, Boolean talkToSomeoneOutput: The way to get your question answered, according to the following rules:On M,Tu,W,F if you want to talk, go to office hoursOn Th if you want to talk, go to sectionMonday through Friday, if you don’t want to talk ask on EdOn Saturday or Sunday, text a friend (whether you want to talk or not)Take 2 minutes plan what your code might look like.

31. Step OneOne possibility (there are many)

32. Step TwoGo from a problem statement to code to logical/circuit representation to an “optimized” version.We want a logical/circuit representation.talkToSomeone?Day?0123

33. Step TwoInput? Day in binary and talkToSomeone Monday – 000 0 for false, 1 for true.Tuesday – 001Wednesday – 010Thursday – 011Friday – 100Saturday – 101Sunday – 110(invalid) – 111talkToSomeone?Day?0123

34. Step TwoOutput? We’ll turn on only the wire for what to docalled a “one-hot” encoding, because one wire is on (‘hot’)Office Hour – 0Section – 1 Ed – 2Text a Friend – 3 talkToSomeone?Day?0123

35. Step TwoDaytalkToSomeone(OH) (Se) (Ed) (TF)Monday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111DaytalkToSomeoneMonday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111

36. DaytalkToSomeone(OH) (Se) (Ed) (TF)Monday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111DaytalkToSomeoneMonday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111     

37. DaytalkToSomeone(OH) (Se) (Ed) (TF)Monday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111DaytalkToSomeoneMonday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111    ++ 

38. DaytalkToSomeone(OH) (Se) (Ed) (TF)Monday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111DaytalkToSomeoneMonday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111    ++ 

39. Step TwoDaytalkToSomeone(OH) (Se) (Ed) (TF)Monday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111DaytalkToSomeoneMonday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111Fill out the poll everywhere for Activity Credit!Go to pollev.com/cse311 and login with your UW identityOr text cse311 to 22333Find the formula for in both Boolean algebra and propositional logic.If you have extra time, draw the circuit representation. 

40. Step TwoDaytalkToSomeone(OH) (Se) (Ed) (TF)Monday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111DaytalkToSomeoneMonday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111 

41. Step TwoDaytalkToSomeone(OH) (Se) (Ed) (TF)Monday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111DaytalkToSomeoneMonday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111 

42. Step TwoDaytalkToSomeone(OH) (Se) (Ed) (TF)Monday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111DaytalkToSomeoneMonday00001Monday00011Tuesday00101Tuesday00111Wednesday01001Wednesday01011Thursday01101Thursday01111Friday10001Friday10011Saturday10101Saturday10111Sunday11001Sunday11011--- 1110--- 1111 

43.

44.

45. IckWOW that’s ugly.Be careful when wires cross – draw one “jumping over” the other.

46. Can we do betterMaybe the factored version will be better?

47.

48.

49. Ehhhhhhh, it’s a little better?Part of the problem here is Robbie’s art skills. Part is some layout choices – commuting the terms might make things prettier.Most of the problem is just the circuit is complicated. is a little better. 

50.

51. Can we use these for anything?Sometimes these concrete formulas lead to easier observations.For example, we might have noticed we factored out or in three of the four, which suggests switching first.We could see that from the rules too! But sometimes switching representations helps. 

52. Can we use these for anything?Is this code better? Maybe, maybe not. It’s another tool in your toolkit for thinking about logicIncluding logic you write in code!

53. TakeawaysYet another notation for propositions.These are just more representations – there’s only one underlying set of rules. Next time: wrap up digital logic and the tool really represent . 

54. Another ProofLet’s prove that is a tautology.Alright, what are we trying to show? 

55. Another Proof   Law of ImplicationIt’s easier if everything is AND/OR/NOTAssociative (twice)Put next to each other. DeMorgan’s LawGets rid of some parentheses/just a gut feeling.Commutative, NegationSimplify out the . Commutative, DominationSimplify out the . Commutative, NegationSimplify out the . Proof-writing tip:Take a step back.Pause and carefully look at what you have. You might see where to go next…We’re done!

56. Another Proof   Law of implicationDeMorgan’s LawAssociativeAssociativeCommutativeNegationCommutativeDominationCommutativeNegation