# Implementing function with NAND only quickest way

I'm trying to remind myself how to implement given function or karnaugh map with NAND or NOR gates. I remember how DeMorgan's laws work.

Let's say I have some Karnaugh Map and I want to implement the obtained function only with NAND gates.

To be efficient: should I group together zero's or one's? (Should I obtain PoS or SoP form of function to get to my result as fast as possible with least number of boolean algebra transformations?)

And same for NOR gates: should I group zero's or one's?

I understand that it all depends, but let's say that the Karnaugh Map is uniformly distributed with 0-s and 1-s and it is equally difficult (or easy) to group either.

## 1 Answer

Use the Karnaugh map to create an implementation that uses NOT, OR, and AND gates.

Then, recognize that you can wire a NAND or NOR so you get a NOT function. Use DeMorgan's theory to get an OR function from a NAND or to get an AND function from a NOR. Replace all of the NOT, OR, and AND gates in your circuit with these equivalents.

That should get you pretty far. Come back if you have more specific questions.