Is it possible to express the logical AND in terms of XOR, OR, or NOT?
The closest I can come is NOT (p XOR q); the only problem is that the case when both p and q are false, this will turn out to be true. Is there any way around it?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityIs it possible to express the logical AND in terms of XOR, OR, or NOT?
The closest I can come is NOT (p XOR q); the only problem is that the case when both p and q are false, this will turn out to be true. Is there any way around it?
Using De Morgan's laws, you can use:
$$A \wedge B = \neg(\neg A \vee\neg B)$$
Apart from using De Morgan's laws, you can come up with a combination of XOR, NOT and OR:
$$A \wedge B = \neg\big((A\oplus B) \vee \neg(A\vee B)\big)$$
I found this combination using Karnaugh maps. I used the map for $\neg(A \wedge B)$ and got $$\begin{array}{c|c|c} A\backslash B&0&1\\\hline 0&1&1\\\hline 1&1&0 \end{array}$$ and found which combinations were useful. Try it out!
Hint: Are you familiar with De Morgan's laws? One of them (if you negate both sides) is just what you want.