Advanced Boolean Logic and Gates Lupoli’s Theorem on Understanding Decisions Computer Makes the ultimate decision Programmer (you and me) Sets the criteria Decision Structures Single-alternative selection structure Dual-alternative selection structure Action is provided for only one outcome if-then Provides an action for each of two possible outcomes
17
Embed
faculty.cse.tamu.edufaculty.cse.tamu.edu/slupoli/notes/CSOverview/Advanced... · Web viewAdvanced Boolean Logic and Gates Lupoli’s Theorem on Understanding Decisions Computer Makes
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Advanced Boolean Logic and Gates
Lupoli’s Theorem on Understanding DecisionsComputer Makes the ultimate decisionProgrammer (you and me) Sets the criteria
Provides an action for each of two possible outcomes
Beginning at “Start”, where would we go in the flowchart when “housekeeping” appears?
Explanation of Relation OperationsSymbol Means Example! not if(answer != ‘Q’)++ / -- incrementing/decrementing covered later% modulus - remainder covered later+ - / * normal arithmetic symbols< less than 4 < 8 = = True<= less than or equal to 6 <= 6 = = True> greater than 6 > 4 = = True>= greater than or equal to 6 > = 6 = = True= = used to COMPARE – if they are equal if ( answer = = ‘Q’)! = or <> used to COMPARE – if they are NOT equal if(answer != ‘Q’)&& and covered later| | or covered later
Logical Operators/Gates used to make decisions in programming and circuit boards 0 == false 1 == true
Why are we learning this? so many things are created using these gates!! application
o http://www.youtube.com/watch?v=idhTFhtDyKY&feature=fvwrel schematic
o http://www.flickr.com/photos/29971737@N03/6293170275/in/ photostream/
OR gate One OR the other must be true in order for the entire expression to be true
Symbols representing the OR GateMathematical Electronic Programming
+ Or (in VB)|| (Java, just above the enter)
Using the two images below, what direction does the electricity flow in the electronic symbol?? (A or B)
A B
OR Gate (||)x y answer0 0 00 1 11 0 11 1 1
OR Example(x) your keys in the ignition?(y) are your headlights on?(answer)