# Why is equivalence in logic said to work similar as a XOR gate?

An if equivalence is shown in logical statement, it means that it both the statements are logically same but we refer to it as XOR gate(which is 1 when the inputs are different). Shouldn't it be XNOR gate representing equivalence?

-
Please don't use abbreviations like "i/p" for "inputs". Your saving of three keys typed stands in no relation to the effort it causes everyone who reads the question and isn't familiar with the abbreviation. – joriki Sep 4 '11 at 9:59
Changed, thanks for the suggestion :) – Fahad Uddin Sep 4 '11 at 10:06
The English here isn't exactly clear. Also, what logically equivalence should get denoted as depends on which operations you take as primitives, and which notation you work in. If you take "XOR" as a primitive, then logical equivalence makes sense as "XNOR". But, usually logical equivalence gets taken as a primitive, so "XNOR" seems strange in that context. This isn't, in my opinion, so much a matter of math or logic though. – Doug Spoonwood Sep 4 '11 at 15:10

Well, an XOR gate with inputs $A$ and $B$ can be described by the table:

$$\begin{array}{ c | c || c | } A & B & A \textrm{ XOR } B \\ \hline 0 & 0 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 0 \end{array}$$

whilst $A \Leftrightarrow B$ has truth table: $$\begin{array}{ c | c || c | } A & B & A \Leftrightarrow B \\ \hline F & F & T \\ F & T & F \\ T & F & F \\ T & T & T \end{array}$$

If you interpret 0 as "false" and 1 as "true", then, yes, an inverted XOR gate would be more appropriate. But if you interpret 0 as "true" and 1 as "false", then a regular XOR gate will do.

-
On the other hand, the the names "AND", "OR" and so forth only make sense under the convention that 0 is false and 1 is true. – Henning Makholm Sep 4 '11 at 15:26

Yes, XNOR would be more appropriate. If you tell us which "we" refers to it as an XOR gate, there might be more to say.

-

That's probably why it was said that it is similar. The pattern is the same, but the ones and zeros are reversed.

-