1 / 29

Computer Science 210 Computer Organization

Computer Science 210 Computer Organization. Introduction to Boolean Algebra. Interview with President Ruscio. http://news.blogs.wlu.edu/2013/01/14/wls-ruscio-on-wmras-virginia-insight-monday/ “ I want a programmer with a liberal arts degree. ”. George Boole.

Download Presentation

Computer Science 210 Computer Organization

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. Computer Science 210Computer Organization Introduction to Boolean Algebra

  2. Interview with President Ruscio http://news.blogs.wlu.edu/2013/01/14/wls-ruscio-on-wmras-virginia-insight-monday/ “I want a programmer with a liberal arts degree.”

  3. George Boole • English mathematician (1815-1864) • Boolean algebra • Logic • Set Theory • Digital circuits • Programming: Conditions in while and if statements

  4. Boolean Constants In Boolean algebra, there are only two constants, true and false

  5. Boolean Variables Boolean variables are variables that store values that are Boolean constants. Let A be true Let B be false Etc.

  6. Boolean Operator AND If A and B are Boolean variables (or expressions) then A AND B is true if and only if bothA and B are true.

  7. Boolean Operator AND If A and B are Boolean variables (or expressions) then A AND B is false if and only if eitherA or B are false or they’re both false.

  8. Boolean Operator AND We denote the AND operation like multiplication in ordinary algebra: AB or A.B

  9. Boolean Operator OR If A and B are Boolean variables (or expressions) then A OR B is true if and only if at least one ofA and B is true.

  10. Boolean Operator OR If A and B are Boolean variables (or expressions) then A OR B is false if and only if both A and B are false.

  11. Boolean Operator OR We denote the OR operation like addition in ordinary algebra: A+B

  12. Boolean Operator NOT If A is a Boolean variable (or expression) then NOT A has the opposite value from A.

  13. Boolean Operator NOT We denote the NOT operation by putting a bar over the variable (or expression) _A

  14. Boolean Expressions • As with ordinary algebra, a Boolean expression is a well-formed expression made from • Boolean constants • Boolean variables • Operators AND, OR and NOT • Parentheses • Example: __ ____AB + (A+C)B

  15. Evaluating a Boolean expression At any time, the value of a BE can be computed using the current values of the variables. __ AB + (CD) Let A = true Let B = false Let C = true Let D = false Then the resulting value is true

  16. Operator precedence NOT comes first, then AND, and finally OR (Like arithmetic negation, product, and addition) A + BC is not the same as (A + B)C

  17. Evaluating a Boolean expression Unlike ordinary algebra, for a BE, there are only finitely many possible assignments of values to the variables; so, theoretically, we can make a table, called a truth table, that shows the value of the BE for every possible set of values of the variables. For convenience, use 0 = false 1 = true

  18. Truth Table for AND

  19. Truth Table for OR

  20. Truth Table for NOT

  21. Filling in a Truth Table • If there are N variables, there are 2N possible combinations of values • Thus, there are 2N rows in the truth table • Fill in the values by counting up from 0 in binary

  22. Example Construct a truth table for _ ___ E = AB + (A+C)B

  23. _ ___ E = AB + (A+C)B Assign the values of the variables first

  24. _ ___ E = AB + (A+C)B Then add columns for each operation

  25. _ ___ E = AB + (A+C)B

  26. _ ___ E = AB + (A+C)B

  27. _ ___ E = AB + (A+C)B

  28. _ ___ E = AB + (A+C)B

  29. _ ___ E = AB + (A+C)B

More Related