1 / 17

Boolean Logic

Boolean Logic. George Boole. In1854, George Boole published “ An investigation into the Laws of Thought, on which are founded the Mathematical Theories of Logic and Probabilities.” Boole outlined a system of logic and a corresponding algebraic language dealing with true and false values. .

harlow
Télécharger la présentation

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. Boolean Logic

  2. George Boole In1854, George Boole published “An investigation into the Laws of Thought, on which are founded the Mathematical Theories of Logic and Probabilities.” Boole outlined a system of logic and a corresponding algebraic language dealing with true and false values. 100th Anniversary Edition

  3. Boolean Logic Boolean logic is a form of mathematics in which the only values used are true and false. Boolean logic is the basis of all modern computing. There are three basic operations in Boolean logic – AND, OR, and NOT. 100th Anniversary Edition

  4. The AND Operation The AND operation is a binary operation, meaning that it needs two operands. c = a AND b Both a and b must be true for the result to be true.

  5. The OR Operation The OR operation is also a binary operation with two operands. c = a OR b If either a OR b is true, then the result is true.

  6. The NOT Operation The NOT operation is a unary operation with only one operand. c = NOT (a) It simply reverses the true or false value of the operand.

  7. Logical Conditions Logical comparisons that are either true or false are most often used as the basis for the true and false values in Boolean logic. They are often used for simple conditions in branching and looping instructions. If (hours > 40) pay overtime If (age < 12) stay in the back seat While (count  10) print count increment count

  8. Logical Comparison Operators Six different comparison operators are used in mathematics and computer programming.

  9. Compound Conditions Compound Boolean conditions can be created using the Boolean AND, OR and NOT operations in branching and looping instructions. If ( (hours > 40) AND (type = hourly) ) pay overtime If ( (age < 12) OR (height < 42 in.) ) stay in the back seat While ( (count <= 10) AND NOT (status = away) ) print name.count increment count

  10. Boolean Logic in Alice

  11. Boolean Functions Functions in Alice that return true or false values are called Boolean functions. Alice has many such built-in functions, such as these two groups of basic Boolean logic functions and comparison functions.

  12. They can be found on the world’s functions tab

  13. They are used inside branching and looping instruction tiles

  14. Boolean Functions The Boolean comparison functions can be used to create simple true or false conditions.

  15. Boolean Functions The Boolean logic functions can be used to create compound conditions.

  16. Boolean Functions Alice has many other world-level and object-level fuctions that return true or false values, such as the Boolean proximity functions shown here on aliceLiddel’s functions tab in the details area.

  17. Boolean Functions They can be used anywhere that a Boolean value is needed, such as in this If/Else command.

More Related