# Pass a logic function using only NAND

So I had a truth table and using a Karnaugh map I simplified a function. I obtained.

$f = \overline{A_3}A_2\overline{A_1} + \overline{A_2}\overline{A_0} + A_3\overline{A_0}$

Then using the distributive property of boolean algebra:

$f = \overline{A_3}A_2\overline{A_1} + \overline{A_0} (\overline{A_2} + A_3)$

Ok, with this we have the minimum of logic gates to use.

Now I need to convert this to NAND. What seemed easier to me was to take the logigram (or electrical scheme) and directly change the gates to their equivalents with NAND. I obtained:

$f = \overline { \overline{\overline{A_3}A_2\overline{A_1}} + \overline{\overline{A_0} \overline{A_2 \overline{A_3}}} }$

• I'm thinking if there is any way to simplify the NAND expression... I see that I have \$A_2 \$ twice and also \$\overline{A_3} \$ twice... I'm thinking if there is any way to go even further in the simplification... If someone could also give a tip on how to proceed to not ruin the rule of using NAND only. Thanks very much!
$ab+c \longleftrightarrow \overline {\overline{a b} \overline c}$