布爾表達式和正規表達式
Example 1: Simplify the given Boolean Expression to minimum no. of variables or literals. 示例1:将給定的布爾表達式簡化為最小編号。 變量或文字。-
(A+B). (A+B)
(A + B)。 (A + B )
-
ABC + AB + ABC
ABC + A B + AB C
= A.A + A. B + B.A + B.B
= A + A. B + B.A + 0
= A (1 + B + B) = A
2) ABC + AB + ABC 2)ABC + A B + AB C = ABC + ABC + AB
= AB (C + C) + AB
= AB + AB
= B (A + A) = B. 1 = B
Example 2: Prove that: (A + C) (A.B +C) = 0 示例2:證明:( A + C)( A .B + C )= 0 Solution: 解: LHS = A.(A + C) (A.B + C)
= (A. A + AC) (A.B + C)
= AC (A.B + C) [Since, A.A = 0]
= AC. A.B + AC. C
= 0 = RHS [Since, A. A = 0 and C. C = 0]
Hence, our result is proved.
Example 3: Reduce the expression (B +BC) (B + BC) (B + D) 示例3:減少表達式(B + BC)(B + B C)(B + D) Solution: 解: = (B +BC) (B + BC) (B + D)
= (BB +BBC) (B + D)
= (B +0) (B +D) [Since, B.B =0]
= BB +BD [Since, B.B =1]
= B + BD
= B (1+D) =B [Since, 1+D =1].
Example 4: Reduce the expression 示例4:簡化表達式 Solution: 解: = A.BC. (AB +ABC) [De-Morgan's Law]
= A.BC (AB+ABC)
= A.BC. AB + A.BC. ABC
= A.A.B.B.C + A.A.B.B.C.C [Manipulation]
= 0 + 0 = 0
Example 4: Prove the Associative Law for XOR operation. 示例4:證明XOR運算的關聯律。 Solution: 解: We know that XOR operation is given as: A⊕B = AB + AB
我們知道XOR運算為: A⊕B = A B + A B
To prove associativity for XOR operation we are required to prove:
為了證明XOR運算的關聯性,我們需要證明:
(A⊕B) ⊕C =A⊕(B⊕C). Therefore,
( A⊕B ) ⊕C = A⊕ ( B⊕C )。 是以,
From equation 1 and 2 we can see
LHS = RHS, thus associative law holds true for
XOR operation.
從等式1和2可以看出
LHS = RHS,是以對于
XOR運算,關聯律成立。
翻譯自: https://www.includehelp.com/basics/solved-examples-on-reduction-of-boolean-expression.aspx
布爾表達式和正規表達式