Convert expression to NAND/NOR only

1k Views Asked by At

I have to convert the following to NAND/NOR only

(A $\wedge$ B) $\vee$ (A $\wedge$ C) $\vee$ (B $\wedge$ C)

I understand how to do this problem if it was only

(A $\wedge$ B) $\vee$ (A $\wedge$ C)

but I can't seem to make a logical negation for the third AND.

EDIT: I seem to have forgot to include that I want to get the result by only using two input NAND gates.

2

There are 2 best solutions below

0
On

Just "invert" every single logical symbol, hence you will get:

\begin{align*} &\neg ( (A \land B) \lor (A\land C) \lor (B \land C))\\ \iff &(\neg(A \land B) \land \neg(A\land C) \land \neg(B \land C))\\ \iff &(\neg A \lor \neg B) \land (\neg A \lor \neg C) \land (\neg B \lor \neg C) \end{align*}

Meaning, when is your first expression wrong? Iff all of your brackets are wrong iff 2 of A,B,C are wrong.

0
On

Hint. We have that $\neg A=\mbox{NAND}(A,A)$. Moreover $$A\wedge B\equiv \neg\mbox{NAND}(A,B)\equiv \mbox{NAND}(\mbox{NAND}(A,B),\mbox{NAND}(A,B))$$ and $$A\vee B\equiv\neg(\neg (A\vee B))\equiv\neg((\neg A)\wedge (\neg B)) \equiv \mbox{NAND}(\neg A,\neg B)\\\equiv \mbox{NAND}(\mbox{NAND}(A,A),\mbox{NAND}(B,B)).$$

So you can convert your logic expression using only NAND.

P.S. Note that $$X\vee Y\vee Z\equiv (X\vee Y)\vee Z\equiv \mbox{NAND}(\neg X\wedge \neg Y,\neg Z).$$