3

Using DeMorgans I get:

~~(abc)  // ~ is the not.

My problem is when I try to build the circuit the NAND gate takes only 2 inputs. So how would I split it for 3? If it was an AND gate I would just use two and the equation would be:

(a AND b) AND c

However, this will not work with my NAND, since

~((a NAND b) NAND c) != (abc)
Kit Ostrihon
  • 824
  • 2
  • 14
  • 36
Robert Mac
  • 31
  • 1
  • 2

3 Answers3

1

I would suggest using the Rott's grids. A Rott's grid is a graphical application of De Morgan's laws and it is particularly useful for solving problems like yours. Some logic gates require more transistors than others. The need to reduce potential delays at the logic gates may be the motivation for optimizing the design using gates NOR or NAND. Finding a corresponding function – with the logic gates you need – can be done really quickly using Rott's grids:

Every Rott's grid is created according to these three principles:

  • the De Morgan's laws are respected by switching between the ⋅ (the conjunction) and the + (the disjunction) and dividing them with the horizontal lines (negations),
  • the vertical lines separate the individual inputs, changing the number of logic gates' inputs,
  • on the last line are placed the input variables either in their prime or negated form – that is determined individually by the number of horizontal lines above them.

All of the five following grids are different representations of the given function:

 a ⋅ b ⋅ c      a ⋅ b ⋅ c      a ⋅ b ⋅ c      a ⋅ b ⋅ c      a ⋅ b ⋅ c 
   |   |       -----------    -----------    -----------    -----------
 a | b | c        +   +          +   +          +   +          +   + 
               -----------    -----------       | ------       | ------
                  ⋅   ⋅          ⋅   ⋅          |   ⋅          |   ⋅
                  | ------    ------ |          | ------       |   |
                  |   +          +   |          |   +       ¬a | b | c
                  | ------    ------ |          |   |
                  |   ⋅          ⋅   |       ¬a | ¬b|¬c
                  |   |          |   |
                a | b | c      a | b | c

Equivalent boolean expressions to the given function

The first grid is not really useful, it is just the original function implemented by a 3-input AND:

f = a ⋅ b ⋅ c

The second Rott's grid is implemented using only 2-input NANDs. You can use either two 2-input NANDs and two inverters or four 2-input NANDs – two of them in the inverters' place, because a 2-input NAND with the same input on both pins, inverts the signal.

f = ¬(nand(a,¬(nand(b,c))))

The third Rott's grid is just a variation on the first one.

f = ¬(nand(¬(nand(a,b)),c))

The fourth Rott's grid can be realized by using two 2-input NORs and four inverters. The inverters can be substituted by 2-input NORs or 2-input NANDs.

f = nor(¬a,¬(nor(¬b,¬c))))

The fifth Rott's grid can be realized by combination of one 2-input NOR, one 2-input NAND and one inverter.

f = nor(not(a),nand(b,c))

(The picture was generated using online latex tool.)

Kit Ostrihon
  • 824
  • 2
  • 14
  • 36
0

If all you want is a circuit which outputs 0 when all inputs are 1...

You can simply check if any of them are 0, then negate that.

You already said the answer: De Morgan's laws. Just apply them: ~(a^b^c) = ~a or ~b or ~c

Though maybe I missed something. Are there other restrictions I might not have picked up on?

amarunowski
  • 103
  • 2
  • 9
  • I want to use NAND only. I read somewhere CPU has only NAND gates. Eitherway, I only want to use NANDs. – Robert Mac Feb 14 '13 at 02:29
  • I think what you ready might have been that a cpu CAN be made using only NAND gates and tricky wiring. Give me a minute to sketch up how this would be accomplished using NAND only – amarunowski Feb 14 '13 at 02:33
  • So, keep in mind that you can connect 'a' to both inputs on a NAND gate and get an inverter (or a "not gate"). If you do that, you can easily make an or gate out of 3 NAND gates. – amarunowski Feb 14 '13 at 02:41
0

Do the 2 ~'s mean you want to NOT the output twice? If so, ~~(abc) = (abc), (the two NOT's cancel each other out) so you can just do (a AND b) AND c.

If you want to just take the NOT of (abc) once, you can first do (a AND b) AND c, and then you can pass that output through an inverter. You would need two chips instead of one.

PhoenixWing156
  • 382
  • 1
  • 8