1 / 9

Class objectives Boolean Logic

Class objectives Boolean Logic. In today’s lesson we will look at: what we mean by truth values what we mean by Boolean Operators how to use AND, OR and NOT how computers use these ideas!. Truth Values. Some statements can be seen to be either true or false For example…

neva
Download Presentation

Class objectives Boolean Logic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Class objectivesBoolean Logic In today’s lesson we will look at: • what we mean by truth values • what we mean by Boolean Operators • how to use AND, OR and NOT • how computers use these ideas!

  2. Truth Values Some statements can be seen to be either true or false For example… • you are in an ICT lesson • this slide has a blue background • it is Friday Other statements are a matter of opinion, e.g. • it’s warm today • that’s a nice hat you’re wearing For this lesson, we will only considered statements about which everyone will agree TRUE TRUE FALSE

  3. Boolean Operators • Arithmetic operators, e.g. +, -, X and ÷, tell us how to combine two numbers • Everyone agrees on the results – e.g. 2 + 3 = 5 • Boolean (also called logical) operators tell us how to combine truth values in a standard way • You might also have seen them used in database searches • Boolean operators include: • NOT • AND • OR

  4. NOT The NOT operator toggles the truth value to its opposite value, e.g. • NOT true = false • NOT false = true For example… • you are NOT in an ICT lesson • this slide’s background is NOT blue • it is NOT Friday FALSE FALSE TRUE

  5. OR The OR operator gives a true result if any of the input values is true, e.g. • false OR false = false • false OR true = true • true OR false = true • true OR true = true For example… • it is Saturday OR Sunday • it is a weekday OR a weekend • it is Monday OR this is an ICT lesson FALSE TRUE TRUE

  6. AND The AND operator gives a true result if everything is true, e.g. • false AND false = false • false AND true = false • true AND false = false • true AND true = true For example… • it is evening AND it is Monday • this slide is blue AND the text is orange • it is Monday AND this is an ICT lesson FALSE FALSE TRUE

  7. Is Anything Always True? Are there operations that are always true (or false)? • X OR NOT X is always true, e.g. • it is Monday OR NOT Monday • this slide is blue OR NOT blue • X AND NOT X is always false, e.g. • it is Monday AND NOT Monday • this slide is blue AND NOT blue • Think about this next time you hear someone say, “…whether or not…”! TRUE TRUE FALSE FALSE

  8. What About Computers? • Computers don’t understand the idea of truth, but they can detect whether a circuit or switch is on or off. • Circuits being on and off can also represent 1 and 0 as we learnt in the binary lesson. • When designing logic circuits for computers: • true = on = 1 • false = off = 0 • False and true are also often represented by zero and non-zero numbers when programming.

  9. Logic Circuits • The above circuit could operate a security light AND it is dark light motion detected upstairs switch landing light OR downstairs switch • The above circuit could operate a landing light

More Related