Verify XOR Gate Incorrectness on Wikipedia - Expert Help Needed

  • Thread starter Thread starter PsychonautQQ
  • Start date Start date
  • Tags Tags
    Gate
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 2K views
PsychonautQQ
Messages
781
Reaction score
10
http://en.wikipedia.org/wiki/XOR_gate
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.
 
Engineering news on Phys.org
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.
 
so as an xor gate, if b is 1 and A is zero the output should be one,... right?
 
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.
 
PsychonautQQ said:
so as an xor gate, if b is 1 and A is zero the output should be one,... right?

Yup

Code:
A B  |  XOR Result
0  0 |  0 
0  1 |  1
1  0 |  1
1  1 |  0
 
In words - XOR = one or the other but not both
 
PsychonautQQ said:
so as an xor gate, if b is 1 and A is zero the output should be one,... right?

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.