5
\$\begingroup\$

A question that had popped up in my head once - how many NAND gates would it take to build a larger, "meta-NAND" gate?

Your task is to build a black-box circuit that takes two input wires A and B and returns one output wire that satisfies A NAND B, subject to the following restrictions:

  • You must use at least two NAND gates in this construction (and no gates other than NAND).
  • You may not have null configurations of gates - that is, systems of gates that are equivalent to a gateless wire. (For example, two NOT gates in series are a null configuration.)
  • You cannot have any stray wires (discarded values or constants).

Fewest gates wins.

\$\endgroup\$
0

3 Answers 3

13
\$\begingroup\$

Three gates. Compute (((A nand A) nand B) nand B). Unlike the four-gate solution above in which three of the four gates compute A nand B, two of them simultaneously, and substituting one of the simultaneous outputs for the other would yield two consecutive inverters, the three-gate solution uses the three gates to compute different functions: "not A", "A or not B", and "A nand B". Only the last gate computes the desired function.

\$\endgroup\$
7
\$\begingroup\$

4 gates

(A NAND B) AND-using-NAND (A NAND B)

A---NAND        _
 \ /    \      / \
  X      NAND-<   NAND-->
 / \    /      \_/
B---NAND

\$\endgroup\$
7
\$\begingroup\$

3 gates

   /-----------\
A-<             \
   \-----\       \
          \       NAND--
           NAND--/
B-<NAND---/
\$\endgroup\$
1
  • \$\begingroup\$ Duplicate of this answer, (but with A and B switched) \$\endgroup\$
    – mbomb007
    Commented Mar 1, 2017 at 21:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.