I try to resolve a problem, how to implement a xor gate with nand's gate.

A xor B = A'B + AB'

So, this becomes :

A xor B = A'B + AB' + AA' + BB' = A(A' + B') + B(A' + B') = (A + B)(A' + B') =

(with De Morgan apllied on the second term) = (A + B)(AB)' = ..... ?

In this point i am blocked. If someone can help me, please. Thank you.

  • \$\begingroup\$ apply Demorgans law on first term as well. \$\endgroup\$ – Plutonium smuggler Mar 5 '15 at 8:05

You've got a good start. Just re-distribute the second term over the first:

(A + B)(AB)' = A(AB)' + B(AB)'

And then apply De Morgan to the whole thing:

A(AB)' + B(AB)' = ((A(AB)')'(B(AB)')')'

The Boolean expression gets to be a little hard to read, but it translates to the following circuit:


simulate this circuit – Schematic created using CircuitLab

Note that the exact same network works if all of the NAND gates are changed to NOR gates, except that you get an XNOR gate — the output is high if the inputs are equal.

  • \$\begingroup\$ Or maybe he could just use demorgans on (a + b) to give ( a'.b')', right where he left..? \$\endgroup\$ – Plutonium smuggler Mar 5 '15 at 15:43
  • \$\begingroup\$ @Plutoniumsmuggler: How exactly does that help? Now you're left with creating A' and B', which requires two more inverters. \$\endgroup\$ – Dave Tweed Mar 5 '15 at 17:31
  • \$\begingroup\$ Right. It only "Looks" simpler. As they say 'All that glitters isnt gold'. My apologies. \$\endgroup\$ – Plutonium smuggler Mar 5 '15 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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