Computer Science 101: Boolean Algebra
Computer Science 101: Boolean Algebra
Boolean Algebra
What’s next?
A new type of algebra – Helps us
• With logical reasoning
• Understand and design circuits of a computer
1815-1864
Boolean algebra
• Logic
• Set Theory
• Circuits
• Programming: Conditions in “while” and “if”
Boolean Constants and
Variables
In Boolean algebra, there are only two
constants.
• True and False
• On and Off
• +5v and 0v
• 1 and 0
A AND B
A OR B
NOT A
Example: _ ____
AB + (A+C)B
The value of a Boolean
expression
At any point, the value of a BE can be
computed using the current values of the
variables.
A(B+C) = AB + AC
Idempotent Commutative
A+A=A, AA=A A+B=B+A, AB=BA
Associative Distributive
(A+B)+C=A+(B+C) A(B+C)=AB+AC
(AB)C=A(BC) A+BC=(A+B)(A+C)
Laws of Boolean Algebra
Absorption DeMorgan
____ _ _
A+AB=A, A+B =_A B
___ _,
A(A+B)=A AB = A +B
Complement
_ _ Double
_ Complement
A+A =1, AA =0 A=A
Boolean Expression
Simplification
_ _ ____
(A+B )C + AC_ + (B+C _ ) _ _
= (A+B_ )C + AC + _ B_C (DeMorgan)
= (A+B_ )C + _(A+B )C (Distributive)
= (A+B_ )(C+C ) (Distributive)
= (A+B
_ )1 (Complement)
= A+B (Identity)
Boolean Expression
Simplification
_ _ _
A B + AB
_ _+ AB _ _
=A_ B_ + AB + AB
_ + AB (Idempotent)
=B_ (A +A) + A(B +B) (Distributive)
=B_ 1+A1 (Complement)
=B+A (Identity)