Alternative to xor(A,B,C)

1.4k Views Asked by At

How can we make a comprehensive statement, which will correspond to the truth table of xor (A, B, C) by combining logical operators AND (&), OR (|), XOR (xor) and NOT (!)? In other words, the result should be true if an odd number of the terms is true, and false otherwise.

1

There are 1 best solutions below

4
On

See Exclusive or :

$p ⊕ q \equiv (p \lor q) \land \lnot (p \land q)$.

If you want that $XOR(p,q,r)$ must be true when exactly one is, you must start from :

$(p \land \lnot(q \lor r)) \lor (q \land \lnot(p \lor r)) \lor (r \land \lnot(p \lor q))$

i.e.

$(p \land \lnot q \land \lnot r) \lor (q \land \lnot p \land \lnot r) \lor (r \land \lnot p \land \lnot q)$.

Select from the truth-table all the rows with exactly one true and form the CNF.