Presentation is loading. Please wait.

Presentation is loading. Please wait.

Warmup Answer the following True/False questions in your head: I have brown hair AND I am wearing glasses I am male OR I am wearing sneakers I am NOT male.

Similar presentations


Presentation on theme: "Warmup Answer the following True/False questions in your head: I have brown hair AND I am wearing glasses I am male OR I am wearing sneakers I am NOT male."— Presentation transcript:

1 Warmup Answer the following True/False questions in your head: I have brown hair AND I am wearing glasses I am male OR I am wearing sneakers I am NOT male OR I am male

2 Boolean Logic Paul Bui Subject: Computer Science Level: High School

3 Warmup Extended x = I have brown hair y = I am wearing glasses I have brown hair AND I am wearing glasses x AND y What are all the possible combinations of T/F?

4 Warmup Extended x = I am male y = I am wearing sneakers I am male OR I am wearing sneakers x OR y What are all the possible combinations of T/F?

5 Boolean Operators (T/F) xyx AND y FF FT TF TT xyx OR y FF FT TF TT xNOT x F T

6 Boolean Operators (T/F) xyx AND y FFF FTF TFF TTT xyx OR y FFF FTT TFT TTT xNOT x FT TF

7 Boolean Operators (1/0) xyx AND y 000 010 100 111 xyx OR y 000 011 101 111 xNOT x 01 10

8 Warmup Reviewed x = I am male I am NOT male OR I am male (NOT x) OR x What are all the possible combinations of T/F?

9 Questions?

10 Boolean Operators Symbols OperatorSymbol NOTā (overbar), a’, ~a AND· (mult. dot) OR+

11 Boolean Expressions Follows a logical order of operations 1. Parentheses 2. NOT operators 3. AND 4. OR Example: x + y·z

12 Truth Tables Write out table of all possible combinations of truth values Evaluate the boolean expression for all combinations Example x + y·z xyz FFFF FFTF FTFF FTTT TFFT TFTT TTFT TTTT

13 Example What is the truth table for: ~x + y? xy~x + y FFT FTT TFF TTT

14 Another Example What is the truth table for: x · (~y)? xyx·(~y) FFF FTF TFT TTF

15 Your Turn What is the truth table for the boolean expression: x + ~y + z?


Download ppt "Warmup Answer the following True/False questions in your head: I have brown hair AND I am wearing glasses I am male OR I am wearing sneakers I am NOT male."

Similar presentations


Ads by Google