德摩根定律澄清



我们最近的课是关于民主党的法律。我已经知道它的概念了

(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);

最新更新