# 4 input NAND w/ 2 input NANDs?

Discussion in 'Electronic Basics' started by Shawn, Sep 20, 2005.

1. ### ShawnGuest

Hello all..

I'd like to verify my thinking here and make sure I'm not missing
something simple. I have a circuit that requires a 4 input NAND, but I
only have 2 or 3 input NANDs on hand. If I take each of 2 inputs into
2 separate NANDs, invert the outputs, and run them through another 2
input NAND, I'll get the result that I want - low only when all 4
inputs are high.

The logic works out correctly, but I'm wondering if there is a
better/easier way to make a 4 input NAND out of 2 input NANDs, or if
that's a generally acceptable way of doing it.

Thanks for any suggestions.

Chris

3. ### Rich GriseGuest

What's "generally accepted" is usually "what works". Also, lots of
times, "uses what you have on hand". There are very many ways to
make a 4 input NAND, if you have other logic gates available. Do
a truth table, or Venn diagram, or whatever they call it, and
work out some logic equations and see what you can come up with.

If all you're allowed to use is NANDs, then what you've got is
pretty much it.

Hope This Helps!
Rich

4. ### John PopelishGuest

The essence of a NAND is any low input causes a high output.
You can tie the outputs of a pair of 2 input NANDs with an OR gate and
make a 4 input NAND. Or you can connect the 4 inputs to a pair of
AND gates and tie those together with a NAND. If you only have NANDs,
your way (using 5 2 input NANDS) is the best you can do.

5. ### ShawnGuest

Yes, that helps a lot, Rich. I appreciate the quick response.
Contrary to what some believe, I'm actually building a circuit, not
doing a homework problem.

6. ### ShawnGuest

Actually, John, 2 input NANDs is all I have handy. I considered
ordering 4 inputs from Digikey, but with a \$25 minimum for no handling
charge, or paying \$6 for 50 cents worth of parts, it seemed wiser to
just try and use what I had here. I do have inverters, so I'll use
those in conjunction with the NANDs, and should only need 3 NANDs and
2 inverters as I originally spec'd.

Thanks again for such a quick response. I'll be sniffing the sweet
smell of solder tonight!

7. ### PeteSGuest

Merely as a comment, you can make anything out of NAND gates (or out of
NOR gates) - provided you have enough, of course

They're known as universal gates.

For two input gates -

A NAND obviously gives Y = NOT(A AND B), but could also be said to give
Y = NOT A OR NOT B (DeMorgan's theorem).
INVERT) from the one gate. The same applies to NOR [ Y = NOT A AND NOT
B, Y = NOT(A OR B) ]

For a fundamental gate, invert all inputs and outputs and swap the gate
type between AND <-> OR to implement DeMorgan's theorem.

Good explanation at Wikipedia

http://en.wikipedia.org/wiki/Boolean_logic

Cheers

PeteS

8. ### Kitchen ManGuest

Indeed. NAND gates also form the basis for software modeling. Since,
as you say, a combination of NAND gates can form *any* logic equation,
once one has a successful software model of the NAND, all one needs to
form any other software logic circuit is a proper multiple combination
of the original model.