# XOR gate with NAND

I am attempting to build an XOR gate with NAND ICs. This schematic

is how I am wiring up the IC (I know the schematic is a little confusing but I tried to construct it best I can).

I am attempting to recreate this logic circuit: http://i42.tinypic.com/n4weo6.jpg

Data sheet for CD4011B IC: http://www.ti.com/lit/ds/symlink/cd4011b.pdf

It is not operating as expected, the LED is always on when I expect it to be off by default, off when both switches are pressed and only on when one or the other switch is pressed.

Have I wired this circuit incorrectly? Can anybody tell me where I have gone wrong?

• A proper schematic with gates would be much easier to follow. – Leon Heller Jul 5 '13 at 18:25
• The link is not accessble: 'remote linking not available' – Wouter van Ooijen Jul 5 '13 at 18:33
• Sorry, please see image here: i42.tinypic.com/n4weo6.jpg – Jacob Clark Jul 5 '13 at 18:35
• Provide a real schematic. -1 and voting to close in the mean time. – Olin Lathrop Jul 5 '13 at 18:44
• Would benefit from a current limiting resistor 470 ohm to the LED. – pjc50 Jul 5 '13 at 19:20

## 1 Answer

The circuit looks fine

The XOR table should be

                          A     B          Q
0     0          0
0     1          1
1     0          1
1     1          0

• Strange as the LED is always on! Thanks so much for your reply though, it may be a faulty IC. – Jacob Clark Jul 5 '13 at 18:59
• @JacobClark Make yourself a simple logic probe to test around the circuit - 470R resistor with LED in series (or use a voltmeter). Connect the LED cathode to ground and test the pins of the IC. Start with the first gate and see if the output (pin 3) changes when you operate the switches. Make a note of the truth table. Then try pin 11 and then pin 10. Work your way through the circuit and follow the signal. It may simply be a bad connection somewhere. – JIm Dearden Jul 5 '13 at 19:12