Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Is this an xor gate?

  1. Dec 16, 2013 #1
    scroll down a little bit on this article and there is a picture labeled "xor gate made out of nands"

    Can somebody verify that this wikipedia article is incorrect for me? The truth table I came up with is the exact opposite of an xor. When a and b are both 0 then the output is 1 and when a and b are both 1 the output is 1, but when a is 1 and b is 0 the output is 0.
  2. jcsd
  3. Dec 16, 2013 #2


    User Avatar
    Science Advisor

    It's a XOR. Easy enough to analyze. Take the last NAND gate with the inversions on inputs from previous NAND gates. So the last NAND becomes an OR gate (by De Morgan's), and the two NANDs before it become ANDs. So now if A AND B, then the input to the two AND gates is zero, and the whole thing is zero. Otherwise, A AND gate is high if A, and B AND is high if B. So the OR gate gets A OR B. So the whole thing reads (A OR B) AND (A NAND B). That's obviously a XOR.
  4. Dec 16, 2013 #3
    so as an xor gate, if b is 1 and A is zero the output should be one,.... right?
  5. Dec 16, 2013 #4


    User Avatar
    Science Advisor

    Of course. The states of the four NANDS are going to be: Leftmost, 0 NAND 1 = 1. Top, 0 NAND 1 = 1. Bottom, 1 NAND 1 = 0. Rightmost, 0 NAND 1 = 1. And that's your output.
  6. Dec 16, 2013 #5

    Code (Text):

    A B  |  XOR Result
    0  0 |  0
    0  1 |  1
    1  0 |  1
    1  1 |  0
  7. Dec 16, 2013 #6
    In words - XOR = one or the other but not both
  8. Dec 16, 2013 #7
    Exclusively or so only (or exclusively) either input can be high and the other has to be low. If both inputs are high your output is low and if both inputs are low your output is low.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Is this an xor gate?
  1. XOR Gates (Replies: 2)

  2. AND gate (Replies: 1)