Line 1,499: |
Line 1,499: |
| | | |
| '''Generalized''' or '''n-ary''' XOR is true when the number of 1-bits is odd. | | '''Generalized''' or '''n-ary''' XOR is true when the number of 1-bits is odd. |
| + | |
| + | A + B = (A ∧ !B) ∨ (!A ∧ B) |
| + | = {(A ∧ !B) ∨ !A} ∧ {(A ∧ !B) ∨ B} |
| + | = {(A ∨ !A) ∧ (!B ∨ !A)} ∧ {(A ∨ B) ∧ (!B ∨ B)} |
| + | = (!A ∨ !B) ∧ (A ∨ B) |
| + | = !(A ∧ B) ∧ (A ∨ B) |
| + | |
| + | |
| + | p + q = (p ∧ !q) ∨ (!p ∧ B) |
| + | |
| + | = {(p ∧ !q) ∨ !p} ∧ {(p ∧ !q) ∨ q} |
| + | |
| + | = {(p ∨ !q) ∧ (!q ∨ !p)} ∧ {(p ∨ q) ∧ (!q ∨ q)} |
| + | |
| + | = (!p ∨ !q) ∧ (p ∨ q) |
| + | |
| + | = !(p ∧ q) ∧ (p ∨ q) |
| + | |
| + | |
| + | p + q = (p ∧ ~q) ∨ (~p ∧ q) |
| + | |
| + | = ((p ∧ ~q) ∨ ~p) ∧ ((p ∧ ~q) ∨ q) |
| + | |
| + | = ((p ∨ ~q) ∧ (~q ∨ ~p)) ∧ ((p ∨ q) ∧ (~q ∨ q)) |
| + | |
| + | = (~p ∨ ~q) ∧ (p ∨ q) |
| + | |
| + | = ~(p ∧ q) ∧ (p ∨ q) |
| + | |
| + | : <math>\begin{matrix} |
| + | p + q & = & (p \land \lnot q) & \lor & (\lnot p \land q) \\ |
| + | & = & ((p \land \lnot q) \lor \lnot p) & \and & ((p \land \lnot q) \lor q) \\ |
| + | & = & ((p \lor \lnot q) \land (\lnot q \lor \lnot p)) & \land & ((p \lor q) \land (\lnot q \lor q)) \\ |
| + | & = & (\lnot p \lor \lnot q) & \land & (p \lor q) \\ |
| + | & = & \lnot (p \land q) & \land & (p \lor q) |
| + | \end{matrix}</math> |
| | | |
| ====[[Logical implication]]==== | | ====[[Logical implication]]==== |
Line 1,568: |
Line 1,604: |
| |} | | |} |
| <br> | | <br> |
− |
| |
− | ===Exclusive Disjunction===
| |
− |
| |
− | A + B = (A ∧ !B) ∨ (!A ∧ B)
| |
− | = {(A ∧ !B) ∨ !A} ∧ {(A ∧ !B) ∨ B}
| |
− | = {(A ∨ !A) ∧ (!B ∨ !A)} ∧ {(A ∨ B) ∧ (!B ∨ B)}
| |
− | = (!A ∨ !B) ∧ (A ∨ B)
| |
− | = !(A ∧ B) ∧ (A ∨ B)
| |
− |
| |
− |
| |
− | p + q = (p ∧ !q) ∨ (!p ∧ B)
| |
− |
| |
− | = {(p ∧ !q) ∨ !p} ∧ {(p ∧ !q) ∨ q}
| |
− |
| |
− | = {(p ∨ !q) ∧ (!q ∨ !p)} ∧ {(p ∨ q) ∧ (!q ∨ q)}
| |
− |
| |
− | = (!p ∨ !q) ∧ (p ∨ q)
| |
− |
| |
− | = !(p ∧ q) ∧ (p ∨ q)
| |
− |
| |
− |
| |
− | p + q = (p ∧ ~q) ∨ (~p ∧ q)
| |
− |
| |
− | = ((p ∧ ~q) ∨ ~p) ∧ ((p ∧ ~q) ∨ q)
| |
− |
| |
− | = ((p ∨ ~q) ∧ (~q ∨ ~p)) ∧ ((p ∨ q) ∧ (~q ∨ q))
| |
− |
| |
− | = (~p ∨ ~q) ∧ (p ∨ q)
| |
− |
| |
− | = ~(p ∧ q) ∧ (p ∨ q)
| |
− |
| |
− | : <math>\begin{matrix}
| |
− | p + q & = & (p \land \lnot q) & \lor & (\lnot p \land q) \\
| |
− | & = & ((p \land \lnot q) \lor \lnot p) & \and & ((p \land \lnot q) \lor q) \\
| |
− | & = & ((p \lor \lnot q) \land (\lnot q \lor \lnot p)) & \land & ((p \lor q) \land (\lnot q \lor q)) \\
| |
− | & = & (\lnot p \lor \lnot q) & \land & (p \lor q) \\
| |
− | & = & \lnot (p \land q) & \land & (p \lor q)
| |
− | \end{matrix}</math>
| |
| | | |
| ==Relational Tables== | | ==Relational Tables== |