我们最近的课是关于德摩根定律的。我有点明白它的概念了
(A+B)' = A'B'
(AB)' = A'+B'
我遇到了有关此类法律的这一具体问题,我想澄清一下
((A'B')+(AB))' = (A'B')(AB)
还是应该像
((A'B')+(AB))' = (A'B')'(AB)' = (A+B)(A'+B')
我们最近的课是关于德摩根定律的。我有点明白它的概念了
(A+B)' = A'B'
(AB)' = A'+B'
我遇到了有关此类法律的这一具体问题,我想澄清一下
((A'B')+(AB))' = (A'B')(AB)
还是应该像
((A'B')+(AB))' = (A'B')'(AB)' = (A+B)(A'+B')
您的第二个建议 ,(A+B)(A'+B')
相当于((A'B')+(AB))'
。
这是证明:
Take Ā as ~A
Take ~ as logical NOT
Take . as the logical operator AND
Take + as the logical operator OR
Take ≡ as "is equivalent to"
This is your original expression:
~(Ā.B̄ + A.B)
We can split the two terms...
≡ ~(Ā.B̄) . ~(A.B)
...since ~(A+B) = Ā.B̄ and we can take each bracket as one single term,
in this case A is the first bracket and B is the second
Now we can use ~(A+B) ≡ (Ā.B̄) on both brackets, and we get:
≡ (A+B).(Ā+B̄)
Which is your second suggestion.
我们可以使用简单的 JavaScript 进一步检查这一点,以确保:
let EqualityFound = true;
for(let i = 0; i <= 3; i++) {
const binary = (i).toString(2).padStart(2, 0);
const A = parseInt(binary[0]);
const B = parseInt(binary[1]);
const CurrentEquality = (~((~A&~B) + (A&B))) === ((A+B)&(~A+~B));
console.log("Checking with:", A, B);
if(!CurrentEquality) EqualityFound = false;
}
console.log("All equal:", EqualityFound);