1 / 18

Boolean Operations

Boolean Operations. 1 and 1 = 1. Boolean Algebra. Boolean Logic Logical rules for dealing with true/false values Examples: You get an F if you skip the test OR if you get below 60 You can register for CS161 if you have taken CS160 AND you have taken MTH111. Boolean Operators.

Download Presentation

Boolean Operations

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. Boolean Operations 1 and 1 = 1

  2. Boolean Algebra • Boolean Logic • Logical rules for dealing with true/false values • Examples: • You get an F if you skip the test OR if you get below 60 • You can register for CS161 if you have taken CS160ANDyou have taken MTH111

  3. Boolean Operators • Boolean Operations • Combine/modify booleanvalues • Computers implements as logic gate circuits

  4. Or Rule • OR rule • 1 if either input is 1 • 0 if they both are 0

  5. Or Rule • Logic rules implemented as circuits • Can represent anything with true/false values You get an F if you skip the test OR if you get below 60

  6. And Rule • AND produces • 1 if both inputs are 1 • 0 if either is 0

  7. And Rule • On/Off can stand for any true/false idea • You can register for CS161 if you have taken CS160ANDyou have taken MTH111

  8. Boolean Operators • Truth Table : • Shows every combination of inputs and their output

  9. Basic Rules – 1 input • NOT • Output is 1 if input is 0 • Output is 0 if input is 1 If it is not raining my drive is easier

  10. Basic Rules – 2 inputs • AND • 1 if both inputs 1 • 0 otherwise • OR • 1 if either input is 1 • 0 if both are 0 • XOR (exclusive OR) • 1 if only one input is 1 • 0 if both inputs are 0 or 1

  11. OR vs XOR • In English "or" used for OR and XOR • You can either pick up your room or you can come help do the laundry • You can have an ice cream cone or a two cookies

  12. Not Rules • OR • 1 if either input is 1 • 0 if both are 0 • "Not" rules do opposite: • NOR (not OR) • 0 if either input is 1 • 1 if both are 0

  13. Other NOT rules • AND • XOR • NAND • XNOR

  14. Applying rules • Rules only work on two inputs • Bit sequences processed on bit at a time EX: Combine with OR

  15. Combining Bits • Can apply a rule to combine two bit sequences: • Apply rule to each pair EX: Combine with OR

  16. Combining Bits • Can apply a rule to combine two bit sequences: • Apply rule to each pair EX: Combine with OR

  17. Combining Bits • Can apply a rule to combine two bit sequences: • Apply rule to each pair EX: Combine with OR

  18. Combining Bits • Can apply a rule to combine two bit sequences: • Apply rule to each pair EX: Combine with OR

More Related