1 / 18

Computer Science 101

Computer Science 101 . Boolean Algebra. What’s next?. A new type of algebra – Helps us With logical reasoning Understand and design circuits of a computer The “innards” of a computer Basic circuits Major components and how they work together Low level instructions – machine language

ayala
Download Presentation

Computer Science 101

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 101 Boolean Algebra

  2. What’s next? • A new type of algebra – Helps us • With logical reasoning • Understand and design circuits of a computer • The “innards” of a computer • Basic circuits • Major components and how they work together • Low level instructions – machine language • How data and instructions are stored in computer

  3. George Boole • English mathematician • 1815-1864 • 1854: Introduction to the Laws of Thought • Boolean algebra • Logic • Set Theory • Circuits • Programming: Conditions in “while” and “if”

  4. Boolean Constants and Variables • In Boolean algebra, there are only two constants. • True and False • On and Off • +5v and 0v • 1 and 0 • Boolean variables are variables that store values that are Boolean constants.

  5. Boolean Operator AND • If A and B are Boolean variables (or expressions) then A AND Bis True (1) if and only if both A and B have values of True (1). • We denote the AND operation like multiplication in ordinary algebra: AB or A.B

  6. Boolean Operator OR • If A and B are Boolean variables (or expressions) then A OR Bis True (1) if and only if at least one of A and B has value of True (1). • We denote the OR operation like addition in ordinary algebra: A+B

  7. Boolean Operator NOT • If A is a Boolean variable (or expression) then NOT Ahas the opposite value from A. • We denote the NOT operation by putting a bar over the variable (or expression) _ A

  8. 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

  9. The value of a Boolean expression • At any point, the value of a BE can be computed using the current values of the variables. • 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 tablethat shows the value of the BE for every possible set of values of the variables.

  10. Truth Table: _ ____ E = AB + (A+C)B

  11. In Python!

  12. Laws of Algebra? • In ordinary algebra, we have a distributive law: A(B+C) = AB + AC • What does it mean to say this is a law? • The left side has parentheses, right side doesn’t. • The left side has one multiplication and the right side has two.

  13. Laws of Algebra? • A(B+C) = AB + AC • No matter what the numerical values of A, B, and C are, the two indicated computations will have the same value.

  14. Laws of Boolean Algebra

  15. Laws of Boolean Algebra

  16. Boolean Expression Simplification

  17. Boolean Expression Simplification

  18. Quick Mate, close that gate!

More Related