Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Mathematics CS 2610 February 12, 2009. 2 Agenda Previously Finished functions Began Boolean algebras And now Continue with Boolean algebras.

Similar presentations


Presentation on theme: "Discrete Mathematics CS 2610 February 12, 2009. 2 Agenda Previously Finished functions Began Boolean algebras And now Continue with Boolean algebras."— Presentation transcript:

1 Discrete Mathematics CS 2610 February 12, 2009

2 2 Agenda Previously Finished functions Began Boolean algebras And now Continue with Boolean algebras

3 3 But First p  q  r, is NOT true when only one of p, q, or r is true. Why not? It is true for (p Λ ¬q Λ ¬r) It is true for (¬p Λ q Λ ¬r) It is true for (¬p Λ ¬q Λ r) So what’s wrong? Raise your hand when you know.

4 4 Injective Functions (one-to-one) If function f : A  B is 1-to-1 then every b  B has 0 or 1 pre-image. Proof (bwoc): Say f is 1-to-1 and b  B has 2 or more pre-images. Then  a 1, a 2 st a 1  A and a 2  A, and a 1 ≠ a 2. So f(a 1 ) = b and f(a 2 ) = b, meaning f(a 1 ) = f(a 2 ). This contradicts the definition of an injection since when a 1 ≠ a 2 we know f(a 1 ) ≠ f(a 2 ).

5 5 Boolean Algebras (Chapter 11) Boolean algebra provides the operations and the rules for working with the set {0, 1}. These are the rules that underlie electronic and optical circuits, and the methods we will discuss are fundamental to VLSI design.

6 6 Boolean Algebra The minimal Boolean algebra is the algebra formed over the set of truth values {0, 1} by using the operations functions +, ·, - (sum, product, complement). The minimal Boolean algebra is equivalent to propositional logic where O corresponds to False 1 corresponds to True  corresponds logical operator AND + corresponds logical operator OR - corresponds logical operator NOT

7 7 Boolean Algebra Tables x0011x0011 y0101y0101 x + y 0 1 xy 0 1 x01x01 x10x10 x,y are Boolean variables – they assume values 0 or 1

8 8 Boolean n-Tuples Let B = {0, 1}, the set of Boolean values. Let B n = { (x 1,x 2,…x n ) | x i  B, i=1,..,n}. B 1= { (x 1 ) | x 1  B,} B 2= { (x 1, x 2 ), | x i  B, i=1,2} B n= { ((x 1,x 2,…x n ) | x i  B, i=1,..,n,} For all n  Z +, any function f:B n → B is called a Boolean function of degree n.

9 9 Example Boolean Function x00001111x00001111 y00110011y00110011 z01010101z01010101 F(x,y,z)=x(y+z) F(x,y,z) =B 3  B B 3 has 8 triplets 0 0 0 0 1 1 0 1

10 10 Number of Boolean Functions How many different Boolean functions of degree 1 are there? How many different Boolean functions of degree 2 are there? How many different functions of degree n are there ? There are 2 2ⁿ distinct Boolean functions of degree n.

11 11 Combining Boolean Functions Let F and G be two Booleans functions of degree n. Complement of F: F (x 1,..x n ) = F (x 1,..x n ) Boolean Sum : (F + G)(x 1,..x n ) = F (x 1,..x n ) + G (x 1,..x n ) Boolean Product: (F·G)(x 1,..x n ) = F(x 1,..x n )·G(x 1,..x n )

12 12 Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n )  B n, F (x 1,..x n ) = G (x 1,..x n ) Example: F(x,y,z) = x(y+z), G(x,y,z) = xy + zx

13 13 Boolean Expressions Let x 1, …, x n be n different Boolean variables. A Boolean expression is a string of one of the following forms (recursive definition): 0, 1, x 1, …, or x n. are Boolean Expressions If E 1 and E 2 are Boolean expressions then -E 1, (E 1 E 2 ), or (E 1 +E 2 ) are Boolean expressions. Example: E 1 = x E 2 = y E 3 = z E 4 = E 1 + E 2 = x + y E 5 = E 1 E 2 = x y E 6 = -E 3 = -z E 7 = E 6 + E 4 = -z + x + y E 8 = E 6 E 4 = -z ( x + y) Note: equivalent notation: -E = E for complement

14 14 Functions and Expressions F(x 1,x 2,x 3 ) 1 110 1010 0100 1000 x3x3 x2x2 x1x1 0 001 0101 0011 1111 A Boolean expression represents a Boolean function. Furthermore, every Boolean function (of a given degree) can be represented by a Boolean expression with n variables. F(x 1,x 2,x 3 ) = x 1 (x 2 +x 3 )+x 1 x 2 x 3

15 15 Boolean Functions Two Boolean expressions e 1 and e 2 that represent the exact same function F are called equivalent F(x 1,x 2,x 3 ) 1 110 1010 0100 1000 x3x3 x2x2 x1x1 0 001 0101 0011 1111 F(x 1,x 2,x 3 ) = x 1 (x 2 +x 3 )+x 1 x 2 x 3 F(x 1,x 2,x 3 ) = x 1 x 2 +x 1 x 3 +x 1 x 2 x 3

16 16 Representing Boolean Functions How to construct a Boolean expression that represents a Boolean Function ? 1 110 1010 0100 0000 zyx 0 001 1101 0011 1111 F (-x)(y)(-z) + (-x)yz + x(-y)z + xyz F(x, y, z) = 1 if and only if: What about a 2-input multiplexer?

17 17 Boolean Identities Double complement: x = x Idempotent laws: x + x = x, x · x = x Identity laws: x + 0 = x, x · 1 = x Domination laws: x + 1 = 1, x · 0 = 0 Commutative laws: x + y = y + x, x · y = y · x Associative laws: x + (y + z) = (x + y) + z x · (y · z) = (x · y) · z Distributive laws: x + y ·z = (x + y)·(x + z) x · (y + z) = x ·y + x ·z De Morgan’s laws: (x · y) = x + y, (x + y) = x · y Absorption laws: x + x ·y = x, x · (x + y) = x the Unit Property: x + x = 1 and Zero Property: x ·x = 0

18 18 Boolean Identities Absorption law: Show that x ·(x + y) = x 1) x ·(x + y) = (x + 0) ·(x + y) identity 2) = x + 0 ·ydistributive * 3) = x + y · 0commutative 4) = x + 0 domination 5) = xidentity


Download ppt "Discrete Mathematics CS 2610 February 12, 2009. 2 Agenda Previously Finished functions Began Boolean algebras And now Continue with Boolean algebras."

Similar presentations


Ads by Google