Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Boolean Theorems Investigating the various Boolean theorems (rules) can help us to simplify logic expressions and logic circuits. Multivariable Theorems The theorems presented below involve more than one variable: (9) (10) x + y = y + x (commutative law) x * y = y * x (commutative law) (11) (12) (13a) (13b) (14) (15) x+ (y+z) = (x+y) +z = x+y+z (associative law) x (yz) = (xy) z = xyz (associative law) x (y+z) = xy + xz (w+x)(y+z) = wy + xy + wz + xz x + xy = x [proof see below] x + x'y = x + y Proof of (14) x + xy = x (1+y) = x * 1 [using theorem (6)] = x [using theorem (2)] DeMorgan's Theorem DeMorgan's theorems are extremely useful in simplifying expressions in which a product or sum of variables is inverted. The two theorems are: (16) (x+y)' = x' * y' (17) (x*y)' = x' + y' Theorem (16) says that when the OR sum of two variables is inverted, this is the same as inverting each variable individually and then ANDing these inverted variables. Theorem (17) says that when the AND product of two variables is inverted, this is the same as inverting each variable individually and then ORing them. Example X = [(A'+C) * (B+D')]' = (A'+C)' + (B+D')' [by theorem (17)] = (A''*C') + (B'+D'') [by theorem (16)] = AC' + B'D Three Variables DeMorgan's Theorem (18) (x+y+z)' = x' * y' * z' (19) (xyz)' = x' + y' + z' Implications of DeMorgan's Theorem For (16): (x+y)' = x' * y' For (17): (x*y)' = x' + y' Boolean algebraic properties Another type of mathematical identity, called a "property" or a "law," describes how differing variables relate to each other in a system of numbers. One of these properties is known as the commutative property, and it applies equally to addition and multiplication. In essence, the commutative property tells us we can reverse the order of variables that are either added together or multiplied together without changing the truth of the expression: Along with the commutative properties of addition and multiplication, we have the associative property, again applying equally well to addition and multiplication. This property tells us we can associate groups of added or multiplied variables together with parentheses without altering the truth of the equations. Lastly, we have the distributive property, illustrating how to expand a Boolean expression formed by the product of a sum, and in reverse shows us how terms may be factored out of Boolean sums-of-products: To summarize, here are the three basic properties: commutative, associative, and distributive. Boolean Functions NOT. So is the complement of A, defined by the truth table A 0 1 1 0 A truth table defines the boolean function by specifying the boolean output value associated with each boolean input value. The circuit symbol for the NOT function is the inverter, Figure 148. The bubble denotes inversion (complement). Figure 148: NOT gate. Interestingly, in Quantum Computing there is a gate, but that is another story. OR. Here + denotes OR, defined by: A B X=A+B 0 0 0 0 1 1 1 0 1 1 1 1 OR is like two switches A, B is parallel; one or both open lets current flow. The circuit symbol is shown in Figure 149. Figure 149: OR gate. AND. Here denotes AND, defined by: A B 0 0 0 0 1 0 1 0 0 1 1 1 AND is like two switches A, B is series; both must be open for current to flow. The circuit symbol is shown in Figure 150. Figure 150: AND gate. These three are the most basic logic functions, and define the Boolean algebra on the set . Also important are the following functions. NAND. NAND is defined by: A B 0 0 1 0 1 1 1 0 1 1 1 0 NAND is the complement of AND. The circuit symbol is shown in Figure 151. (We encountered the physical NAND gate in section 10.3.) Figure 151: NAND gate. NOR. NOR is defined by: A B 0 0 1 0 1 0 1 0 0 1 1 0 NOR is the complement of OR. The circuit symbol is shown in Figure 152. Figure 152: NOR gate. NAND and NOR are very important building blocks. XOR. XOR is defined by: A B 0 0 0 0 1 1 1 0 1 1 1 0 XOR is true if one and only one of A, B is true; hence the term exclusive OR. . The circuit symbol is shown in Figure 153. Figure 153: XOR gate. XOR is useful in arithmetic circuits controlled inverter parity generation and checking EQV. EQV is defined by: A B 0 0 1 0 1 0 1 0 0 1 1 1 EQV is true only if both A and B are the same, and so is the complement of XOR. It is called equivalence or exclusive NOR. The circuit symbol is shown in Figure 154. Figure 154: EQV gate. EQV is useful for detecting equality. Basic Boolean Operations Basic Operations are AND, OR, and Complement (inverse) Truth Tables list all combinations of inputs and the corresponding outputs for combinational circuits. An AND gate produces a 1 iff all inputs are 1 An OR gate produces a 1 iff one or more inputs are 1 A NOT gate (inverter) produces an output opposite to the input X Y | XY | X+Y | X' -----+----+-----+--0 0| 0| 0 |1 0 1| 0| 1 |1 (provide symbols) 1 0| 0| 1 |0 1 1| 1| 1 |0 Combining AND with NOT and OR with NOT, we have NAND & NOR X Y | (XY)' | (X+Y)' -----+-------+------0 0| 1 | 1 0 1| 1 | 0 (provide symbols) 1 0| 1 | 0 1 1| 0 | 0 Show circuit diagram and truth table for F = XY + X'Y'Z Draw circuit for F = (AB + C)' and ask class for Boolean expression Ask class to draw circuit for F = (A + C)(B' + D) Real logic circuits behavior is a function of time. Logic values cannot change instantaneously. Also, there is a time delay associated with every logic gate. Axioms Axioms: minimal set of definitions assumed to be true X = 0 if X <> 1 X = 1 if X <> 0 If X = 0, X' = 1 If X = 1, X' = 0 0.0=0 1+1=1 1.1=1 0+0=0 0.1=1.0=0 1+0=0+1=1 The above five axioms completely define switching algebra.All other facts about the system can be proved starting with the axioms. Single-Variable Theorems: X+0=X X+1=1 X+X=X (X')' = X X + X' = 1 X(1) = X -- Identities X(0) = 0 -- Null elements XX = X -- Idempotency -- Involution XX' = 0 -- Complements These theorems are easily proved by showing that they are valid for both possible values of X.Any boolean expression can be substituted for the variable X in the above theorems. Two- and Three-Variable Theorems: XY = YX -- Commutativity X(YZ) = (XY)Z Y) + Z -- Associativity X+Y=Y+X X + (Y + Z) = (X + From the above we see that any number of boolean variables ANDed together will have a value of '1' iff every variable has a value of '1'. Likewise, any number of boolean variables ORed together will have a value of '0' iff every variable has a value of '0'. (D1): X(Y + Z) = XY + XZ (D2): X + YZ = (X + Y)(X + Z) -- Distributivity X + XY = X Covering X(X + Y) = X XY + XY' = X -- Combining (X + Y)(X + Y') = X (X + Y')Y = XY -- XY' + Y = X +Y Any boolean expression can be substituted for X and Y in the above theorems. Example: Simplify AB'(C + D) + (C + D)' AB'(C + D) + (C + D)' = AB' + (C + D)' by XY' + Y = X + Y, where X = AB' and Y = (C + D)' Multiplying Out and Factoring: SUM OF PRODUCTS: An expression is said to be in sum-of-products form when all products are the products of single variables only. Example: AB + AC + CD' + E is a sum of products A(B+C) + CD + E' is not a sum of products The distributive laws are used to multiply out an expression to obtain a sum-ofproducts form. Applying D2 first, when applicable, can reduce the amount of work required to arrive at a simplified sum-of-products form. Multiplying Out Example: (A + B)(B + C)(B + D')(ACD' + E) = (A + B)(B + CD')(ACD' + E) by D2 = (B + ACD')(ACD' + E) by D2 & Comm. law = ACD' + BE by D2 & Comm. law (A + B')(A + D' + C)(A + D' + B) = (A + B')(A + D' + BC) D2 = A + B'(D' + BC) D2 = A + B'D' D1 PRODUCT OF SUMS: An expression is said to be in product-of-sums form when all sums are sums of single variables. Example: (A + B')CD is a product of sums (AB + C)(B + C) is not a product of sums The distributive laws can be used to factor an expression repeatedly until the expression is in a productof-sums form. Applying D1 first can reduce the amount of work required to fully factor an expression. Factoring Example: ABC + A'B'C + CD' = C(AB + A'B') + CD' by D1 = C(AB + A'B' + D') by D1 = C((AB + A')(AB + B') + D') by D2 = C((A + A')(B + A')(A + B')(B + B') + D') by D2 = C((B + A')(A + B') + D') = C(B + A'+ D')(A + B'+ D') by D2 ABC + A'B'C = C(AB + A'B') D1 = C((AB + A')(AB + B')) D2 = C((A' + A)(A' + B)(B' + A)(B' + A)) D2 = C(A' + B)(B' + A)