Chapter 7 - Boolean Algebra Boolean Boolean Algebra:...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Boolean Algebra Boolean Boolean Algebra: Structure Boolean In studying propositional logic (true, false), false), we learned about certain operators, that can be viewed as functions f:{T, F}2→{T, F}. For example, o (T, T) = T, o (T, F) = T, W W For o (F, T) = T, and o (F, F) = F. W and W From there, we learned about certain From fundamental properties of wff's: Boolean Algebra: Structure Boolean A ∨B ↔ B ∨A A ∧B ↔ B ∧A commutative laws (A ∨ B) ∨ C ↔ A ∨ (B ∨ C) (A ∧ B) ∧ C ↔ A ∧ (B ∧ C) associative laws associative laws A ∨ (B ∧ C) ↔ (A ∨ B) ∧ (A ∨ C) A ∧ (B ∨ C) ↔ (A ∧ B) ∨ (A ∧ C) distributive laws distributive laws A ∨F ↔ A laws A ∧ T ↔ A identity laws A ∨ A' ↔ T A ∧ A' ↔ F complement laws Boolean Algebra: Structure Boolean We also studied sets, and within Set Theory we discovered that given sets A, B and C within a universe U: Boolean Algebra: Structure Boolean A( B=B( A ( ( A( B=B( A ( ( commutative laws (A ( B) ( C = A ( (B ( C) ( ( ( ( (A ( B) ( C = A ( (B ( C) ( ( ( ( A( ( A( ( A( ( associative laws associative laws (B ( C) = (A ( B) ( (A ( C) ( ( ( ( A ( (B ( C) = (A ( B) ( (A ( C) ( ( ( ( ( distributive laws distributive laws F=A laws A ( U = A identity laws ( A' = U A ( A' = ( complement laws ( ( Boolean Algebra: Structure Boolean One of the beauties of mathematics is that One there is a lot of consistency and many recurring patterns. recurring Many different models satisfy the same (or Many similar) properties. similar) Systems like the ones we have just seen are Systems examples of a model called a Boolean algebra. algebra Boolean Algebra: Structure Boolean A Boolean algebra is a set B on which are Boolean defined two binary operations: + and o W two and one unary operation ' and 0 (additive identity) (additive and 1 (multiplicative identity and in which there are two distinct elements and such that the following properties hold for all such x, y, z o B: W Boolean Algebra: Structure Boolean x+y=y+x (x + y) + z = x + (y + z) x( y=y( x ( ( commutative laws (x ( y) ( z = x ( (y ( z) ( ( ( ( associative laws associative laws x + (y ( z) = (x + y) ( (x + z) ( ( x ( (y + z) = (x ( y) + (x ( z) ( ( ( distributive laws distributive laws x+0=x laws x ( 1 = x identity laws ( x ( x' = 0 complement laws ( x + x' = 1 Boolean Algebra: Structure Boolean Example: Consider the set B = {0, 1} and define the Consider operations + and o to be x + y = max(x, y) and x , W ( max( y = min(x, y). Let 0' = 1 and 1' = 0. min( The above forms a Boolean algebra. • commutative: obviously max(x,y) = max(y,x) and the obviously max( and same for min. same • associative: intuitively true. intuitively • distributive: max(x, min(y,z)) = min(max(x,y), max(x, min( max(x,z)) max( • identity Boolean Algebra: Structure Boolean The idempotent property: x + x = x The idempotent multiplicative identity x + x = ( x + x) o 1 W additive complement = (x + x) o (x + x') W distributive property = x + (x o x'') Wx multiplicative complement =x+0 additive identity =x Boolean Algebra: Structure Boolean The Principle of Duality: If some equality holds within a Boolean algebra, If then the corresponding equality obtained by substituting • + for o, for W o o for +, W • 0 for 1 for • and 1 for 0 will also be true. Boolean Algebra: Structure Boolean 1 1 1 Uniqueness: If x + x = 1 and x o x = 0, x = W If x'. De Morgan: (x + y)' = x' o y', (x r y)' = x' + y' W ( )' Morgan )' Absorption: x + (x r y) = x, x r (x + y) = x ( ( Double negation: (x'')' = x )' negation Boolean Algebra: Structure Boolean One more thing: If (B, + , , , ') is a Boolean algebra, then |B| = 2n ( Homework on 7.1: Problems 1, 2, 4, 5a Logic Networks Logic Claude Shannon (1938) Boolean algebras and logic circuits. x=0 x=1 x=0 x=1 1 Logic Networks Logic A 1 1 0 0 OR gate B 1 0 1 0 Ar B 1 0 0 0 A 1 0 A' 0 1 inverter AND gate Logic Networks Logic A 1 1 0 0 B 1 0 1 0 (A + B)' 0 0 0 1 A 1 1 0 0 B 1 0 1 0 (A r B)' 0 1 1 1 NOR gate NAND gate Logic Networks and Truth Tables Logic Consider a truth table involving three variables. There will be 23 = 8 lines. 23 There are 2 = 28 = 256 unique truth tables. Each truth table can be represented by logic circuits Each using the basic gates shown earlier. using Logic Networks and Truth Tables Logic Consider the following table: x1 1 1 1 1 0 0 0 0 x2 1 1 0 0 1 1 0 0 x3 1 0 1 0 1 0 1 0 f(x1,x2,x3) 1 0 1 1 0 0 1 0 Logic Networks and Truth Tables Logic The truth table on the previous slide can be The implemented by any number of logic circuits using AND, OR and inverter gates in combination. in One such circuit can be built using the sumof-products notation. Let's go back to that table. Logic Networks and Truth Tables Logic x1 1 1 1 1 0 0 0 0 x2 1 1 0 0 1 1 0 0 x3 1 0 1 0 1 0 1 0 f(x1,x2,x3) 1 0 1 1 0 0 1 0 sum of sum products products Logic Circuits and Truth Tables Logic Logic Circuits and Truth Tables Logic But is this the only circuit that corresponds to But the earlier truth table? the Not by a long shot! 13 1 2 23 Consider the expression x x + x x' + x' x Consider Logic Circuits and Truth Tables Logic x1 1 1 1 1 0 0 0 0 x2 1 1 0 0 1 1 0 0 x3 1 0 1 0 1 0 1 0 x1x3 1 0 1 0 0 0 0 0 x1x'2 0 0 1 1 0 0 0 0 x'2x3 0 0 1 0 0 0 1 0 x1x3 + x1x'2+x'2x3 1 0 1 1 0 0 1 0 Logic Circuits and Truth Tables Logic The truth table on the previous slide is The identical to the earlier one. identical Note that it only requires three AND gates Note leading to the OR gate. leading Note that each of these AND gates requires Note only 2 (not 3) inputs. only It's simpler. It's cheaper. Logic Circuits Logic Section 7.2, Problems 1-4 and 9 Minimization Minimization There is a technique for finding the minimal There circuit for a given truth table. circuit It involves a special map called the Karnaugh It Map. Map. Here are the general pictures for Karnaugh Here Maps corresponding to two-variable, threeMaps variable and four-variable expressions. Karnaugh Maps Karnaugh x1 x'1 x2 x'2 x1x2 x3x4 x3x'4 x'3x'4 x'3x4 1 1 x1x2 x3 x'3 x1x'2 x'1x'2 1 1 x1x'2 1 1 x'1x2 x'1x'2 1 x'1x2 1 1 Karnaugh Maps Karnaugh Note that adjacent squares have only one Note variable that changes (e.g. – x1 to x'1) Note that Karnaugh Maps "wrap around", top- to-bottom, left-to-right. We look for sub-rectangles (perhaps wrapping We around) with both the number of rows and the number of columns being powers of two (1, 2, 4, etc.) 4, Karnaugh Maps Karnaugh Find the smallest number of largest rectangles Find that cover all the 1's and only the 1's. that Each rectangle is a product of variables (or Each inverses of variables). The simplest expression is the sum of these The rectangles. rectangles. Karnaugh Maps Karnaugh Consider the following map: x1x2 x3x4 x3x'4 x'3x'4 x'3x4 1 1 x1x'2 1 1 1 x'1x'2 1 x'1x2 Homework Homework 7.1/1, 2, 4, 5a 7.2/1-4, 9 7.3/1-7 ...
View Full Document

Ask a homework question - tutors are online