Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.

Similar presentations


Presentation on theme: "1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011."— Presentation transcript:

1 1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011

2 2 Outline Introduction Definitions Interpretation in Set Operations Interpretation in Logic Operations Theorems and Proofs Multi-valued Boolean Algebra Expression Transformations

3 3 Introduction Boolean algebra is used in computers for arithmetic & logic operations. Eg: 1. if a is true, then y = b, else y = c. 2. y is true if a and b are true. 3. y is true if a or b is true.

4 4 Introduction We use binary bits to represent true or false. A=1: A is true A=0: A is false We use AND, OR, NOT gates to operate the logic. NOT gate inverts the value (flip 0 and 1) y = NOT (A)= A’ idANOT A 00 1 110 AA’

5 5 Introduction OR gate: Output is true if either input is true y= A OR B idA BA OR B 00 0 10 11 21 01 31 1 A B A OR B

6 6 Introduction AND gate: Output is true only if all inputs are true y= A AND B IdA BA AND B 00 0 10 10 21 00 31 1 A B A AND B

7 7 Introduction A Half Adder: Carry = A AND B Sum = (A AND B’) OR (A’ AND B) Carry: A B Carry = A AND B

8 8 Introduction A Half Adder: Carry = A AND B Sum = (A AND B’) OR (A’ AND B) Sum: A B B’ A’ A’ and B A and B’ (A and B’) or (A’ and B)

9 9 Definition Boolean Algebra: A set of elements B with two operations.+ (OR, U, ˅ ) * (AND, ∩, ˄ ), satisfying the following 4 laws. P1. Commutative Laws: a+b = b+a; a*b = b*a, P2. Distributive Laws: a+(b*c) = (a+b)*(a+c); a*(b+c)= (a*b)+(a*c), P3. Identity Elements: Set B has two distinct elements denoted as 0 and 1, such that a+0 = a; a*1 = a, P4. Complement Laws: a+a’ = 1; a*a’ = 0.

10 Interpretation in Set Operations Set: Collection of Objects Example: A = {1, 3, 5, 7, 9} N = {x | x is a positive integer}, e.g. {1, 2, 3,…} Z = {x | x is an integer}, e.g. {-1, 0, 4} Q = {x | x is a rational number}, e.g. {-0.75, ⅔, 100} R = {x | x is a real number}, e.g. {π, 12, -⅓} C = {x | x is a complex number}, e.g. {2 + 7i} Ф = {} or empty set 10

11 P1. Commutative Laws in Venn Diagram A+B 11 A*B AA B B

12 P2. Distributive Laws A* (B+C) = (A*B) + (A*C) 12 A B C

13 P2. Distributive Laws A+ (B*C) = (A+B) * (A+C) 13 A B C

14 P3. Identity Elements 0 = {} 1 = Universe of the set A+0 = A A*1 = A 14

15 P4: Complement A+A’= 1 A*A’= 0 15 A A’


Download ppt "1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011."

Similar presentations


Ads by Google