1 / 27

Boolean Algebra

Boolean Algebra. Computer Science 1611. AND. (today is Monday) AND (it is raining) (today is Monday) AND (it is not raining) (today is Friday) AND (it is raining) (today is Friday) AND (it is not raining). OR. (today is Monday) OR (it is raining) (today is Monday) OR (it is not raining)

galya
Download Presentation

Boolean Algebra

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 Algebra Computer Science 1611

  2. AND • (today is Monday) AND (it is raining) • (today is Monday) AND (it is not raining) • (today is Friday) AND (it is raining) • (today is Friday) AND (it is not raining)

  3. OR • (today is Monday) OR (it is raining) • (today is Monday) OR (it is not raining) • (today is Friday) OR (it is raining) • (today is Friday) OR (it is not raining)

  4. NOT • (today is Monday) OR NOT (it is raining) • (today is Monday) OR (it is raining) • (today is Friday) AND NOT(it is raining) • (today is Friday) AND (it is raining) • (today is Monday) AND NOT(it is raining) • (today is Monday) AND (it is raining) • (today is Friday) OR NOT (it is raining) • (today is Friday) OR (it is raining)

  5. IMPLIES (A  B) • A B is False only when A is True and B is False. • In other words, A  B is True except when the premise (A) is True and the conclusion (B) is False. • A  B is logically equivalent to (NOT A) OR B

  6. Truth Table (AND, OR, NOT)

  7. Truth Table (AND, OR, NOT)

  8. Truth Table (AND, OR, NOT)

  9. Truth Table (AND, OR, NOT)

  10. Truth Tables • A AND B is True only when both A and B are true. • A OR B is always True unless both A and B are false. • NOT A changes the value from True to False or False to True.

  11. IMPLIES (A  B)

  12. Writing AND, OR, NOT • A AND B = A ^ B = AB • A OR B = A V B = A+B • NOT A = ~A = A’ • TRUE = T = 1 • FALSE = F = 0

  13. Example Write the truth table for A(A’ + B) + AB’ (section 7.5, AE, p 308, exercise #3a) • First, write in words: A AND (NOT A OR B) OR (A AND NOT B) • Then do a truth table with the following columns: A, B, NOT A, NOT B, NOT A OR B, A AND NOT B, A AND (NOT A OR B), whole expression.

  14. X = A (A’ + B) + AB’

  15. Exercise • Write the truth table for (A + A’) B • First, write in words. • Then do a truth table.

  16. Solution to (A + A’) B

  17. Boolean Algebra • Boolean Algebra is made up of two constants (True and False) • Several operators - AND, OR, NOT, XOR, NOR, NAND • XOR = either a or b but not both • NOR = NOT OR • NAND = NOT AND

  18. Boolean Algebra • The = in Boolean Algebra means equivalent • Two statements are equivalent if they have the same truth table. • For example, • True = True, • a = a,

  19. A OR True = True A OR False = A A OR A = A A OR B = B OR A (commutative) A AND True = A A AND False = False A AND A = A A AND B = B AND A (commutative) Boolean Algebra - Identities

  20. Associative and Distributive Identities • A AND (B AND C) = (A AND B) AND C • A OR (B OR C) = (A OR B) OR C • A OR (B AND C) = (A OR B) AND (A OR C) • A AND (B OR C) = (A AND B) OR (A AND C) • Exercise: using truth tables prove - • A AND (A OR B) = A

  21. Solution: A AND (A OR B) = A

  22. Using Identities • A OR (B AND C) = (A OR B) AND (A OR C) • A AND (B OR C) = (A AND B) OR (A AND C) • A AND (A OR B) = A • A OR A = A • Exercise - using identities prove: • A OR (A AND B) = A • = A AND (A OR B) = A • A OR (A AND B) = (A OR A) AND (A OR B)

  23. Identities with NOT • NOT (NOT A) = A • A OR NOT A = True • A AND NOT A = False • On and on and on and on …

  24. DeMorgan’s Laws • NOT (A OR B) = NOT A AND NOT B ~ (A + B) = (~A) (~B) • NOT (A AND B) = NOT A OR NOT B ~ (AB) = ~ A + ~ B • Exercise - Simplify the following with identities NOT (NOT A AND B)

  25. Solving a Truth Table

  26. Solving a Truth Table

  27. Exercise 1: Solving a Truth Table

More Related