CSCI 220: Computer Architecture-I Instructor: Pranava K. Jha Elements of Boolean Algebra Important Boolean Identities
1.
(i) x+x=x
(ii) x⋅x=x
2.
(x′)′ = x
3.
x+1=1
x⋅0=0
4.
x+0=x
x⋅1=x
5.
x + x′ = 1
x ⋅ x′ = 0
Idempotence Involution
6. Commutativity x+y=y+x x⋅y=y⋅x 7. x + (y + z) = (x + y) + z Associativity x ⋅ (y ⋅ z) = (x ⋅ y) ⋅ z Distributivity 8. x ⋅ (y + z) = x ⋅ y + x ⋅ z x + (y ⋅ z) = (x + y) ⋅ (x + z) 9. Absorption x ⋅ (x + y) = x x+x⋅y=x 10. Absorption x ⋅ (x′ + y) = x ⋅ y x + x′ ⋅ y = x + y 11. De Morgan’s law (x + y)′ = x′ ⋅ y′ (x ⋅ y)′ = x′ + y′
Q. Using the basic identities of Boolean algebra, prove the following relationships. At each step, state which postulate or theorem is applied. i. ii.
xy’ + yz’ + zx’ = x’y + y’z + z’x. (x + y)(y + z)(z + x) = xy + yz + zx.
i.
Identity used xy’ + yz’ + zx’ = xy’1 + yz’1 + zx’1
4(ii)
= xy’(z + z’) + yz’(x + x’) + zx’(y + y’)
5(i)
= xy’z + xy’z’ + yz’x + yz’x’ + zx’y + zx’y’
8(i)
= xy’z + xy’z’ + xyz’ + x’yz’ + x’yz + x’y’z
6(ii)
= xy’z + x’y’z + xy’z’ + xyz’ + x’yz’ + x’yz
6(i)
= (x + x’)y’z + x(y’ + y)z’ + x’y(z’ + z)
8(i)
= 1y’z + x1z’ + x’y1
5(i)
= y’z + xz’ + x’y
4(ii)
= x’y + y’z + z’x.
QED 1 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
ii.
Identity used (x + y)(y + z)(z + x) = (y + x)(y + z)(z + x)
6(i)
= (y + xz)(z + x)
8(ii)
= (y + xz)z + (y + xz)x
8(i)
= yz + xzz + yx + xzx
8(i)
= yz + xzz + yx + xxz
6(ii)
= yz + xz + yx + xz
1(ii)
= yz + yx + xz + xz
6(i)
= yz + yx + xz
1(i)
= yx + yz + xz
6(i)
= xy + yz + zx.
QED
6(ii)
Q. Simplify each of the following expressions using theorems of Boolean algebra. i. ii. i.
ii.
A + B + (A’ + B)C’D A’B’C + (AB’C)’
A + B + (A’ + B)C’D = A + B + A’C’D + BC’D = A + A’C’D + B + BC’D = A + C’D + B + BC’D = A + C’D + B(1 + C’D) = A + C’D + B = A + B + C’D A’B’C + (AB’C)’ = A’B’C + A’ + B + C’ = (A’ + A’B’C) + B + C’ = A’ (1 + B’C) + B + C’ = A’1 + B + C’ = A’ + B + C’
2 of 24
: commutativity of +. : absorption law. : distributivity of . over +. : 1 + x = 1 and x.1 = x. : De Morgan’s law. : commutativity of +. : distributivity of . over +. : 1 + x = 1.
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. True or false? In each case, justify your answer. i. If A + B + C = C + D, then A + B = D. ii. If A’B + A’C = A’D, then B + C = D. i. The given statement is false. Counterexample: Let A = 1, B = 1, C = 1 and D = 0. Under these truth assignments, A + B + C = 1 as well as C + D = 1, yet A + B = 1 and D = 0. ii. The given statement is false Counterexample: Let A = 1, B = 0, C = 0 and D = 1. Under these truth assignments, A’B + A’C = 0 as well as A’D = 0, yet B + C = 0 and D = 1. Q. Prove that that ab + a’c + bc = ab + a’c. Proof: ab + a’c + bc = ab + a’c + (a + a’)bc = ab + a’c + a bc + a’bc = ab + a bc + a’c + a’bc = ab(1 + c) + a’c(1 + b) = ab + a’c. QED Alternative Proof: Either bc = 0 or bc = 1. If bc = 0, then the claim is immediate. Suppose that bc = 1, in which case b = 1 and c = 1, and hence ab + a’c + bc = ab + a’c + 1 = 1; also, ab + a’c = a + a’ = 1. QED Third Proof: Build a truth table, and demonstrate that ab + a’c + bc and ab + a’c admit the same truth value for each truth assignment to a, b and c. The present identity is called consensus theorem. Q. Given that ab = 0 and a + b =1, prove that ac + a’b + bc = b + c. Proof: ac + a’b + bc = ac + bc + a’b = (a + b)c + a’b = c + a’b, since a + b = 1 = c + a’b + ab, since ab = 0 = c + (a’ + a)b =c+b = b + c. QED Alternative proof: Since ab = 0 and a + b = 1, either a = 0 and b = 1, or a = 1 and b = 0. • •
If a = 0 and b =1, then ac + a’b + bc = 0c + 1b + 1c = b + c. If a = 1 and b = 0, then ac + a’b + bc = 1c + 0b + 0c = c = 0 + c = b + c. QED 3 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Prove or present a counterexample: If x ⊕ y = x ⊕ z, then y = z, where ⊕ denotes the XOR (i.e., exclusive-OR) operation. The given statement is true. To that end, the following truth table details all cases. x 0 0 0 0 1 1 1 1
y 0 0 1 1 0 0 1 1
z x⊕y x⊕z 0 0 0 1 0 1 0 1 0 1 1 1 0 1 1 1 1 0 0 0 1 1 0 0
√
√ √
√
It is clear that whenever x ⊕ y = x ⊕ z (the cases marked with √), y = z. QED Alternative Proof: Either x = 0 or x = 1: (i) If x = 0, then x ⊕ y = y and x ⊕ z = z, hence x ⊕ y = x ⊕ z ⇒ y = z; (ii) If x = 1, then x ⊕ y = y’ and x ⊕ z = z’, hence x ⊕ y = x ⊕ z ⇒ y’ = z’, i.e., y = z. QED 1. The present exercise shows that XOR obeys cancellation property. Converse of the given statement is (trivially) true. 2. OR and AND do not obey cancellation property. What about NOR, NAND and EQUIVALENCE? XOR is an unusually important operation in mathematics, engineering and computer science. Applications abound and may be seen in areas such as addition, error detection, error correction and parity generation. The operation itself is commutative and associative. Further, it obeys the cancellation property. On the other hand, hardware realization of XOR is expensive: a. A Boolean expression consisting of XOR of literals is not amenable to function simplification. More precisely, x1 ⊕ L ⊕ xn is an odd function, i.e., it is TRUE if and only if the number of literals (among x1 , L , xi ) that are TRUE is odd. This kind of expression does not admit function simplification. b. The lazy evaluation that works nicely with respect to AND and OR does not work relative to XOR, i.e., the truth value of x1 ⊕ L ⊕ xn cannot, in general, be determined by inspecting the truth values of x1 , L , xi alone, where i < n. 4 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Determine whether or not the following identity holds in Boolean algebra: x(y ⊕ z) = (x + y) ⊕ (x + z). The given identity does not hold. Counterexample: For x = 0, y = 0 and z = 1, x(y ⊕ z) = 0, while (x + y) ⊕ (x + z) = 1. Q. Let ⊗ denote the equivalence operation given by x ⊗ y = xy + x’y’. Prove or present a counterexample: If x ⊗ y = x ⊗ z, then y = z. The given statement is true. Note that • •
If x = 0, then xy + x’y’ = y’ and xz + x’z’ = z’, and If x = 1, then xy + x’y’ = y and xz + x’z’ = z.
Thus, if x ⊗ y = x ⊗ z, then either y’ = z’ or y = z. Observe that y’ = z’ if and only if y = z. Accordingly, if x ⊗ y = x ⊗ z, then y = z. QED A more convenient method of proof is to build a truth table (presented below), and demonstrate that whenever x ⊗ y = x ⊗ z, it is necessarily the case that y = z. x
y
z
x⊗y
x⊗z
0
0
0
1
1
0
0
1
1
0
0
1
0
0
1
0
1
1
0
0
1
0
0
0
0
1
0
1
0
1
1
1
0
1
0
1
1
1
1
1
√
√ √
√
It is clear that whenever x ⊗ y = x ⊗ z (the cases marked with √ ), y = z. QED
1. The present exercise shows that equivalence obeys cancellation property. 2. Converse of the given statement is (trivially) true.
5 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. The inhibition operation in Boolean algebra is denoted by θ and is defined as follows: x θ y = x’y. Is this operation commutative? Explain. Note that x θ y = x’y and y θ x = y’x. For x = 0 and y = 1, it is clear that x’y = 1 and y’x = 0. Accordingly, x θ y ≠ y θ x. Conclusion: Inhibition operation is not commutative. Q. Is the inhibition operation associative? Explain. Note that (a θ b) θ c = (a’ ⋅ b ) θ c = (a’⋅ b )’⋅ c = (a + b’) ⋅ c = a⋅ c + b’⋅ c. Further, a θ (b θ c) = a’⋅ (b θ c) = a’⋅ (b’⋅ c) = a’⋅ b’⋅ c. For a = 1, b = 1 and c = 1, it is clear that a⋅ c + b’⋅ c = 1, while a’⋅ b’⋅ c = 0, hence (a θ b) θ c ≠ a θ (b θ c), i.e., inhibition operation is not associative. Just saying that a⋅ c + b’⋅ c is not equal to a’⋅ b’⋅ c (because they “look” different) is not an acceptable argument. Show explicitly that for a particular truth assignment to a, b and c, the two Boolean expressions a⋅ c + b’⋅ c and a’⋅ b’⋅ c admit distinct truth values, and then conclude that a⋅ c + b’⋅ c ≠ a’⋅ b’⋅ c. Meanwhile Boolean expressions x + x’⋅ y and x + y “look” different, yet x + x’⋅ y = x + y. Note: The surefire method of attack for a problem of this type is to construct a truth table that details truth values of (a θ b) θ c and a θ (b θ c) against all possible truth values of a, b and c. If there is even a single disagreement between (a θ b) θ c and a θ (b θ c), then conclude that θ is not associative. On the other hand, if there is an agreement between the two for every truth assignment to a, b and c, then conclude that θ is associative. For the given operation, the truth table (for testing associativity) is as follows. a 0 0 0 0 1 1 1 1
b 0 0 1 1 0 0 1 1
c 0 1 0 1 0 1 0 1
aθb 0 0 1 1 0 0 0 0
(a θ b) θ c 0 1 0 0 0 1 0 1
* Disagreement 6 of 24
bθc 0 1 0 0 0 1 0 0
a θ (b θ c) 0 1 0 0 0 0 0 0
* *
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Consider the following operation of ↑ in Boolean algebra: x ↑ y = x’ + y. Determine whether or not ↑ is associative. The given operation is associative if and only if (x ↑ y)↑ z = x ↑ (y ↑ z) for all x, y and z. Note that (x ↑ y)↑ z = (x ↑ y)’ + z = (x’ + y)’ + z = x y’ + z. Further, x ↑ (y ↑ z) = x’ + (y ↑ z) = x’ + (y’ + z) = x’ + y’ + z. For x = 0, y = 0 and z = 0, x y’ + z = 0 while x’ + y’ + z = 1. Conclusion: (x ↑ y)↑ z ≠ x ↑ (y ↑ z), and hence ↑ is not associative. A surefire recipe for a problem of this type is to build a truth table. Even a single disagreement between (x ↑ y)↑ z and x ↑ (y ↑ z) means that equality does not hold. On the other hand, if (x ↑ y)↑ z and x ↑ (y ↑ z) systematically agree for all truth assignments to x, y and z, then equality holds. Q. Prove the following Boolean identity using algebraic manipulation: AB' + A'C'D' + A'B'D +A'B'CD' = B' +A'C'D'.
AB' + A'C'D' + A'B'D +A'B'CD' = AB’ + A’ (B’ + B)C’D’ + A’B’(C’ + C)D + A’B’CD’ = AB’ + A’B’C’D’ + A’BC’D’ + A’B’C’D + A’B’CD + A’B’CD’ = AB’ + A’B’C’D’ + A’B’C’D’ + A’BC’D’ + A’B’C’D + A’B’CD + A’B’CD’ = AB’ + A’B’C’D’ + A’BC’D’ + A’B’C’D’ + A’B’C’D + A’B’CD + A’B’CD’ = AB’ + A’C’D’ (B’ +B) + A’B’C’(D’ + D) + A’B’C(D + D’) = AB’ + A’C’D’ + A’B’C’ + A’B’C = AB’ + A’C’D’ + A’B’ (C’ + C) = AB’ + A’C’D’ + A’B’ = AB’ + A’B’ + A’C’D’ = (A + A’)B’ + A’C’D’ = B’ + A’C’D’ .
QED
7 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Do the following circuits implement the same Boolean function? Explain.
Let F1 and F2 be the functions implemented by the two circuits, respectively.
Build a truth table for F1 and F2. A B C B·C F1 = A·(B·C) A·B F2 = (A·B)·C 0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
1
1
1
0
0
0
1
0
0
0
0
0
0
1
0
1
0
0
0
0
1
1
0
0
0
1
0
1
1
1
1
1
1
1
It is clear that F1 = F2 for each truth assignment to A, B and C. Conclusion: The two circuits implement the same Boolean function. This is basically a verification of the fact that the AND function is associative.
8 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Do the following circuits implement the same Boolean function? Explain.
Let F1 and F2 be the functions implemented by the two circuits, respectively.
Build a truth table for F1 and F2. A B C (B·C)' F1 = (A·(B·C)')' (A·B)' F2 = ((A·B)'·C)' 0
0
0
1
1
1
1
0
0
1
1
1
1
0
0
1
0
1
1
1
1
0
1
1
0
1
1
0
1
0
0
1
0
1
1
1
0
1
1
0
1
0
1
1
0
1
0
0
1
1
1
1
0
1
0
1
For A = 0, B = 0 and C = 1, F1 = 1 whereas F2 = 0, i.e., F1 ≠ F2. Conclusion: The two circuits do not implement the same Boolean function. This is basically a verification of the fact that the NAND function is not associative.
9 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Do the following circuits implement the same Boolean function? Explain.
The first circuit implements the function (A NOR B) NOR C = ((A + B)' + C)' = (A + B) · C' = A·C' + B·C'. The second circuit implements the function A NOR (B NOR C) = (A + (B + C)')' = A' · (B + C) = A'·B + A'·C. For A = 0, B = 0 and C = 1, A·C' + B·C' evaluates to 0 while A'·B + A'·C evaluates to 1. Therefore, the two circuits do not implement the same function. The mere fact that A·C' + B·C' and A'·B + A'·C "look" different is not an acceptable reason for their inequality. Show that for a particular truth assignment to the input variables A, B and C, the two expressions admit different truth values, and then conclude that they are indeed unequal. Whenever in doubt, build a truth table, and the result will surface immediately. A B C A·C' + B·C' A'·B + A'·C 0
0
0
0
0
0
0
1
0
1
0
1
0
1
1
0
1
1
0
1
×
1
0
0
1
0
×
1
0
1
0
0
1
1
0
1
0
1
1
1
0
0
×
×
The present exercise shows that the NOR operation is not associative.
10 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Do the following circuits implement the same Boolean function? Explain.
The answer to this problem is YES or NO depending on whether (((A ⊕ B)' ⊕ C)' is equal to (A ⊕ (B ⊕ C)' )' for all truth assignments to A, B and C. Accordingly, the problem is easily resolved by means of a truth table.
It follows that the two circuits implement the same Boolean function. Note: The foregoing conclusion may as well be reached by proving the equality between ((A ⊕ B)' ⊕ C)' and (A ⊕ (B ⊕ C)' )' by means of algebraic manipulation. Remark: (A ⊕ B)' is equal to A ⊗ B given by AB + A'B'.
11 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Consider the following gates.
Which pairs of these gates have the equivalent behavior? Explain. Reason A and H are equivalent.
X ·Y
= (X ’ + Y ’)’
B and G are equivalent.
(X ·Y)’
= X’+Y’
C and F are equivalent.
X ’·Y ’
= (X + Y)’
D and E are equivalent.
(X ’·Y ’)’ = X + Y
The equivalences themselves are based on De Morgan’s theorems. Q. A self-dual logic function is a function F such that F is dual of itself. Determine whether or not the following function is self-dual: F(A, B, C) = Σm(0, 3, 5, 6). It is clear that F(A, B, C) = A'B'C' + A'BC + AB'C + ABC'. The dual is obtainable by swapping AND and OR operations in the foregoing expression. Accordingly, Dual of F(A, B, C) = (A' + B' + C' )(A' + B + C)(A + B' + C)(A + B + C') = ΠM (7, 4, 2, 1) = Σm(0, 3, 5, 6). It follows that the given function is indeed self-dual.
12 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. For the following statement, present a proof or a counterexample: If x + y = x + z, then y = z. Counterexample: Let x = 1, y = 1 and z = 0. Under this truth assignment, x + y = 1 = x + z, yet y ≠ z. Q. Let ↑ be the operation given by x ↑ y = x’ + y. Determine whether or not this operation is associative. Note that (x ↑ y)↑ z = (x ↑ y)’ + z = (x’ + y)’ + z = x y’ + z. Further, x ↑ (y ↑ z) = x’ + (y ↑ z) = x’ + (y’ + z) = x’ + y’ + z. For x = 0, y = 0 and z = 0, note that x y’ + z evaluates to 0 while x’ + y’ + z evaluates to 1. Conclusion: (x ↑ y)↑ z ≠ x ↑ (y ↑ z), hence ↑ is not associative. A surefire recipe for a problem of this type is to build a truth table. Even a single disagreement between (x ↑ y)↑ z and x ↑ (y ↑ z) means that equality does not hold. On the other hand, if (x ↑ y)↑ z and x ↑ (y ↑ z) systematically agree for all truth assignments to x, y and z, then equality holds. x
y
z
x↑y
y↑z
1
(x ↑ y)↑ z 0
1
x ↑ (y↑ z) 1
0
0
0
0
0
1
1
1
1
1
0
1
0
1
0
0
1
0
1
1
1
1
1
1
1
0
0
0
1
1
1
1
0
1
0
1
1
1
1
1
0
1
0
0
1
1
1
1
0 1
1
1
Not equal
13 of 24
× ×
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Determine whether or not XOR distributes over AND. Objective is to ascertain whether or not x ⊕ (yz) = (x ⊕ y)(x ⊕ z) for all truth assignments to x, y and z. x
y
z
yz
x ⊕ (yz)
(x ⊕ y) (x ⊕ z)
(x ⊕ y)(x ⊕ z)
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
1
0
0
0
1
0
0
0
1
1
1
1
1
1
1
1
0
0
0
1
1
1
1
1
0
1
0
1
1
0
0
*
1
1
0
0
1
0
1
0
*
1
1
1
1
0
0
0
0
Since there are disagreements (indicated by ‘*’) between x ⊕ (yz) and (x ⊕ y)(x ⊕ z), the given identity does not hold. Accordingly, XOR does not distribute over AND. An alternative approach is to use algebraic simplification. To that end, x ⊕ (yz) = x’(yz) + x(yz)’ = x’(yz) + x(y’ + z’) = x’yz + xy’ + xz’, and (x ⊕ y)(x ⊕ z) = (x’y + xy’)(x’z + xz’) = x’yx’z + x’yxz’ + xy’x’z + xy’xz’= x’yz + xy’z’. For x = 1, y = 0 and z = 1, x’yz + xy’ + xz’ = 1 while x’yz + xy’z’ = 0. Accordingly, x’yz + xy’ + xz’ ≠ x’yz + xy’z’, and hence the given identity does not hold.
14 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Determine whether or not AND distributes over XOR. Objective is to ascertain whether or not the following identity holds in Boolean algebra: x(y ⊕ z) = (xy) ⊕ (xz). The following truth table details all possible truth assignments to x, y and z, and validates the identity. x 0 0 0 0 1 1 1 1
y 0 0 1 1 0 0 1 1
z 0 1 0 1 0 1 0 1
x(y ⊕ z) 0 0 0 0 0 1 1 0
(xy) ⊕ (xz) 0 0 0 0 0 1 1 0
Conclusion: AND distributes over XOR. Q. Determine whether or not XOR distributes over OR. Objective is to ascertain whether or not x ⊕ (y + z) = (x ⊕ y) + (x ⊕ z) for all truth assignments to x, y and z. Counterexample: Let x = 1, y = 0 and z = 1, and note that x ⊕ (y + z) = 0 whereas (x ⊕ y) + (x ⊕ z) = 1, hence XOR does not distribute over OR. Alternative proof: Use a truth table. x
y
z
(y + z)
x ⊕ (y + z)
0
0
0
0
0
0
1
0
1
0
0
(x ⊕ y) 0
(x ⊕ z) 0
(x ⊕ y) + (x ⊕ z) 0
1
1
0
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
0
0
0
1
1
1
1
1
0
1
1
0
1
0
1
∗
1
1
0
1
0
0
1
1
∗
1
1
1
1
0
0
0
0
Not identical 15 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Determine whether or not OR distributes over XOR. Objective is to determine whether or not x + (y ⊕ z) = (x + y) ⊕ (x + z). This is best done by means of a truth table. x 0 0 0 0 1 1 1 1
y 0 0 1 1 0 0 1 1
y⊕z 0 1 1 0 0 1 1 0
z 0 1 0 1 0 1 0 1
x + (y ⊕ z) 0 1 1 0 1 1 1 1
x+z 0 1 0 1 1 1 1 1
x+y 0 0 1 1 1 1 1 1
(x + y) ⊕ (x + z). 0 1 1 0 0 0 0 0
∗ ∗ ∗ ∗
It is clear that x + (y ⊕ z) ≠ (x + y) ⊕ (x + z). This is particularly true when x = 1, y = 0 and z = 0. Conclusion: OR does not distribute over XOR. Q. Illustrate the following identity using circuits of switches: X + YZ = (X + Y)(X + Z).
X
• Y
•
•
=
Z
X
•
•
Y
Z
Q. Illustrate the following identity using circuits of switches: X(X + Y) = X.
X
•
X
•
=
Y
16 of 24
X
X
•
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Illustrate the following identities using circuits of switches: i. ii.
XY + XY’ = X. X(X’ + Y)Y = XY.
•
X
X
•
Y
•
•
=
•
•
X
Y’ XY + XY’ = X
•
X
•
X’
Y
•
Y
•
•
=
X
•
Y
•
X(X’ + Y)Y = XY
Q. Present an algebraic proof of the following identity: xy + (x ⊕ y)z = xy + xz + yz. where ⊕ denotes the XOR (Exclusive-OR) operation. xy + (x ⊕ y)z
= xy + (x’y + xy’)z = xy + x’yz + xy’z = xy (z + z’) + x’yz + xy’z = xyz + xyz’ + x’yz + xy’z = xyz + xyz + xyz’ + x’yz + xy’z = xyz + xyz + xyz + xyz’ + x’yz + xy’z = xyz + xyz’ + xyz + x’yz + xyz + xy’z = xy(z + z’) + (x + x’)yz + xz(y + y’) = xy + yz + xz. = xy + xz + yz.
QED
Q. Simplify the Boolean expression: AB + ABC + ABCD + ABCDE + ABCDEF. AB + ABC + ABCD + ABCDE + ABCDEF = AB(1 + C + CD + CDE + CDEF) = AB.
17 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Given that ab = 0 and a + b =1, prove using algebraic manipulation that ac + a’b + bc = b + c. ac + a’b + bc
= ac + bc + a’b = (a + b)c + a’b = c + a’b = c + a’b + ab, = c + (a’ + a)b =c+b = b + c.
since a + b = 1 since ab = 0 QED
Alternative proof: Since ab = 0 and a + b =1, either (i) a = 0 and b =1, or (ii) a = 1 and b = 0. • •
If a = 0 and b =1, then ac + a’b + bc = 0c + 1b + 1c = b+ c. If a = 1 and b = 0, then ac + a’b + bc = 1c + 0b + 0c = c = 0+ c = b + c (as b = 0). QED
Q. Prove that X’Y + Y’Z + Z’X = XY’ + YZ’ + ZX’. X’Y + Y’Z + Z’X
= X’Y(Z’ + Z) + (X’ + X)Y’Z + Z’X(Y’ + Y) = X’YZ’ + X’YZ + X’Y’Z + XY’Z + Z’XY’ + Z’XY = XY’Z + XY’Z’ + X’YZ’ + XYZ’ + ZX’Y + ZX’Y’ = XY’(Z + Z’) + (X’ + X)YZ’ + ZX’(Y + Y’) = XY’ + YZ’ + ZX’. QED
A surefire recipe for this type of problem is to build a truth table and demonstrate that X’Y + Y’Z + Z’X and XY’ + YZ’ + ZX’ admit the same truth value for each truth assignment to X, Y and Z.
18 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Is it possible to build a three-input NAND gate by means of two numbers of two-input NAND gate? Justify your answer. Solution: The answer is NO. To that end, first recall that the three-input Boolean function, say, f is given by f(a, b, c) = (abc)’ = a’ + b’ + c’. The only way a three-input NAND gate could be implemented using two numbers of two-input NAND gates is to connect the two-input NAND gates as follows:
where the three input variables a, b and c may be assigned to the three input lines in an arbitrary way. Accordingly, there are six cases:
19 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
• • •
For a = 0, b = 0 and c = 1, (abc)’ = 1 while ab + c’ = ba + c’ = 0. For a = 0, c = 0 and b = 1, (abc)’ = 1 while ac + b’ = ca + b’ = 0. For b = 0, c = 0 and a = 1, (abc)’ = 1 while bc + a’ = cb + a’ = 0.
It follows that (abc)’ is not equal to any of the functions generated by the six arrangements. Consequently, a three-input NAND gate cannot be realized by means of two numbers of two-input NAND gates. Q. For the following truth table, write (i) the minterm canonical formula in algebraic form and in m-notation, and (ii) the maxterm canonical formula in algebraic form and in M-notation. x 0 0 0 0 1 1 1 1
y 0 0 1 1 0 0 1 1
z 0 1 0 1 0 1 0 1
f 1 1 0 1 0 1 1 0
i.
f(x, y, z) = x’y’z’ + x’y’z + x’yz + xy’z + xyz’ = Σm(0, 1, 3, 5, 6).
ii.
f(x, y, z) = (x + y’ + z)(x’ + y+ z) (x’ + y’ + z’) = ΠM(2, 4, 7).
Q. Express the Boolean expression (y + z’)(xy’ + z) as a maxterm canonical formula without constructing a truth table. (y + z’)(xy’ + z) = (y + z’)(x + z)(y’ + z) = (xx’ + y + z’)( yy’ + x + z)(xx’ + y’ + z) = (x + y + z’)(x’ + y + z’)(y + x + z)(y’ + x + z)(x + y’ + z) )(x’ + y’ + z) = (x + y + z’)(x’ + y + z’)(x + y + z)(x + y’ + z)(x + y’ + z)(x’ + y’ + z) = (x + y + z)(x + y + z’)(x + y’ + z)(x + y’ + z)(x’ + y + z’)(x’ + y’ + z) = (x + y + z)(x + y + z’)(x + y’ + z)(x’ + y + z’)(x’ + y’ + z) = ΠM(0, 1, 2, 5, 6).
20 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Express the complement of the following functions in disjunctive canonical form and conjunctive canonical form using decimal notation: i. ii.
f(x, y, z) = Σm(0, 2, 5). f(x, y, z) = ΠM(1, 2, 5, 7).
i. ii.
f’(x, y, z) = Σm(1, 3, 4, 6, 7) = ΠM(0, 2, 5). f’(x, y, z) = ΠM(0, 3, 4, 6) = Σm (1, 2, 5, 7).
Q. Prove that the following identities hold in Boolean algebra. (x + y) ⊕ (x + z) = x’(y ⊕ z). (x + y) : (x + z) = x + (y : z).
i. ii.
where : is the exclusive-NOR operation (also called the equivalence operation). Recall the truth table of each of exclusive-OR operation and exclusive-NOR operation: XOR x
y
x⊕y
XNOR x:y
0
0
0
1
0
1
1
0
1
0
1
0
1
1
0
1
The two identities are readily proved by means of a truth table. y⊕z
x’
0
(x + y) ⊕ (x + z) 0
0
1
x’(y ⊕ z) 0
0
1
1
1
1
1
0
1
0
1
1
1
1
1
1
1
1
0
0
1
0
1
0
0
1
1
0
0
0
0
1
0
1
1
1
0
1
0
0
1
1
0
1
1
1
0
1
1
1
1
1
0 0
0
0
0 0
x
y
z
x+y
x+z
0
0
0
0
0
0
1
0
1
0
Identical
21 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
x
y
z
x+y
x+z
(x + y) : (x + z)
y:z
x + (y : z)
0
0
0
0
0
1
1
1
0
0
1
0
1
0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
1
1
1
1
0
1
1
1
0
1
1
0
1
1
1
1
1
1 1
1 1
1 Identical
Q. i. ii.
Is the exclusive-NOR operation dual of the exclusive-OR operation? Explain. Is the exclusive-NOR operation complement of the exclusive-OR operation? Explain.
(i) Answer is YES. To that end, it is clear from the truth tables of exclusive-OR and exclusive-NOR that x ⊕ y = x’y + xy’ and x : y = xy + x’y’. Now, dual(x ⊕ y) = (x’ + y)(x + y’) = x’x + x’y’ + yx + yy’ = 0 + x’y’ + xy + 0 = xy + x’y’ =x:y (ii) exclusive-NOR is indeed the complement of exclusive-OR. This is clear from the truth table itself. Equivalently, it is easy to see that (x’y + xy’)’ = xy + x’y’. Q. Is the exclusive-NOR operation associative? Explain. Proof: x : (y : z) = x(y : z) + x’ (y : z)’ = x (yz + y’z’) + x’(yz + y’z’)’ = x (yz + y’z’) + x’(y’z + yz’) = xyz + xy’z’ + x’y’z + x’yz’ = (xy + x’y’)z + (x’y + xy’)z’ = (x : y)z + (x : y)’z’ = (x : y) : z. 22 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. Develop a Boolean expression for the following logic diagrams. (x(xy)’ )’ = x’ + xy = x’ + y x y
• •
• (xy)’
f
(y(xy)’ )’ = y’ + xy = x + y’ f = ((x’ + y)(x + y’ ))’ = (x’ y’ + xy)’ = x’ y + xy’ = x ⊕ y. (x + (x + y)’ )’ = x’(x + y) = x’ y x y
• •
• (x+ y)’
f
(y + (x + y)’ )’ = y’(x + y) = xy’ f = (x’ y + xy’ )’ = xy + x’ y’ = x: y. Q. Determine whether or not x: y : (x + y) = xy, where : is the exclusive-NOR operation. The problem is readily resolved by means of a truth table. x
y
x: y
x+y
x: y : (x + y)
xy
0 0 1 1
0 1 0 1
1 0 0 1
0 1 1 1
0 0 0 1
0 0 0 1
It is clear that for each truth assignment to the independent Boolean variables x and y, x: y : (x + y) = xy. Accordingly, the given identity holds in Boolean algebra. 23 of 24
Computer Architecture-I: Boolean Identities (Instructor: Pranava K. Jha)
Q. For each of the following gates, determine whether it is equivalent to an XOR gate, an XNOR gate, or none of the two.
Gate
Function performed by the gate f(x, y)
A f(x, y) B f(x, y) C
= x’ ⊕ y’ = (x’)’ y’ + x’ (y’)’ = xy’ + x’ y = x ⊕ y. = (x’ ⊕ y)’ = (x : y)’ = x ⊕ y.
f(x, y) D f(x, y) E f(x, y) F
= x’ ⊕ y = (x’)’ y + x’ y’ = xy + x’ y’ = x : y.
= x ⊕ y’ = x’ y’ + x( y’)’ = x’ y’ + xy = x : y. = (x’ ⊕ y’)’ = (x ⊕ y)’ = x : y. = (x ⊕ y’)’ = (x : y)’ = x ⊕ y.
——————o—————— 24 of 24
Conclusion XNOR gate
XOR gate
XOR gate
XNOR gate
XNOR gate
XOR gate