1
\$\begingroup\$

I am a programmer and I was thinking about some logic I was just writing and the logical statement started out as a negated exclusive or, but this simplifies to a logical equality check, e.g. var x = a == b. That is to say, we can express this as x <- a XNOR b.

Since I was looking at the XOR page i found that there is an XNOR gate which is just an XOR gate negated. It got me to wondering because XNOR seems like such a convoluted way to refer to the concept of what this gate does.

I wonder if this is just how history played out, or if there is something subtle that I'm missing.

\$\endgroup\$
8
  • \$\begingroup\$ well, it's equality because it's only true if both A and B are included. No logic discrimination happening! \$\endgroup\$
    – KyranF
    Commented Dec 18, 2015 at 23:57
  • \$\begingroup\$ @KyranF I know, I'm saying that it is in fact equality. why isn't it just called that? Like nobody refers to a XNOR gate as an EQ gate. \$\endgroup\$
    – Steven Lu
    Commented Dec 18, 2015 at 23:58
  • \$\begingroup\$ As far as I know, nobody refers to an XNOR gate at all... at least in my education and experience, it's not something that comes up. \$\endgroup\$
    – Daniel
    Commented Dec 19, 2015 at 0:03
  • 1
    \$\begingroup\$ That's an XOR gate with an inverting bubble on it... \$\endgroup\$
    – Daniel
    Commented Dec 19, 2015 at 0:14
  • 1
    \$\begingroup\$ @Daniel oh that is a good point. Hmmmm okay i guess this question doesn't really need an answer since it isn't such a great question after all \$\endgroup\$
    – Steven Lu
    Commented Dec 19, 2015 at 0:21

4 Answers 4

6
\$\begingroup\$

I think that's a valid observation.

The reason it's called an XNOR is that all logic gates are based on boolean algebra. The boolean operations of conjunction, disjunction and negation map isometrically to AND, OR and NOT. Combining negation with conjunction and disjunction gives you NAND and NOR and exclusive disjunction gives you XOR. Naturally then, when you add negation, you get XNOR (which is simply easier to say than NXOR).

The fact that XOR performs an inequality operation and XNOR performs equality operation is a by-product, but a valid one nonetheless. Note that it is no more remarkable then the fact that AND is modulo two multiplication and XOR is modulo two addition. You're free to use the representation that is most convenient to the task at hand. If you're programming, then converting your result into arithmetic operators makes sense.

\$\endgroup\$
2
  • \$\begingroup\$ Actually AND and XOR are pretty remarkable because they form a Boolean ring. \$\endgroup\$ Commented Dec 19, 2015 at 1:17
  • \$\begingroup\$ +1 for the notes on 1 bit mult and 1 bit add \$\endgroup\$
    – Paebbels
    Commented Dec 19, 2015 at 1:20
3
\$\begingroup\$

I disagree with the accepted answer that "XNOR performs equality operation is a by-product". Although you cannot expect more than uninformed upvotes for this statement on a EE site (you should have really asked on Math.SE if you expected that), in math or logic contexts it is more likely to be called a biconditional (that's because equality in a logic context is equivalent with if and only if); You can find that in several math or CS textbooks which don't even mention xnor:

https://books.google.com/books?id=M5dBBAAAQBAJ&pg=PA73 https://books.google.com/books?id=yJIMx9nXB6kC&pg=PA13 https://books.google.com/books?id=6cMSAAAAQBAJ&pg=PA40 https://books.google.com/books?id=FS-sCQAAQBAJ&pg=PA15 https://books.google.com/books?id=jgJQce_GRyEC&pg=PA48

Others call it just equivalence:

https://books.google.com/books?id=TQ1n03kEBOkC&pg=PA8 https://books.google.com/books?id=UQ7NSn4UOAsC&pg=PA160

It's usually only when you get to circuit engineering books that you usually start to encounter the xnor terminology:

https://books.google.com/books?id=3zcgIKPl8L0C&pg=PA130 https://books.google.com/books?id=XQjVBQAAQBAJ&pg=PA102 https://books.google.com/books?id=-ZAccwyQeXMC&pg=PA81 https://books.google.com/books?id=rguQ-SNgkNIC&pg=PA93

Some of these engineering books call it concidence [gate] as well (or say it implements the coincidence function), although they have a preference for xnor, no doubt.

https://books.google.com/books?id=sZYJAAAAQBAJ&pg=PT204 https://books.google.com/books?id=o7enSwSVvgYC&pg=PA131 https://books.google.com/books?id=o7enSwSVvgYC&pg=PA97

And some engineering books call it equivalence in addition to xnor

https://books.google.com/books?id=eQrlBwAAQBAJ&pg=PA225 https://books.google.com/books?id=QypINJ4oRI8C&pg=PA102 https://books.google.com/books?id=1msXLZ360m0C&pg=PA67

So it depends who (or where) you ask. I haven't found this written explicitly somewhere, but I think the established symbol for the xnor gate being generally used only in circuit contexts and being absent in more abstract math/logic contexts facilitates this terminology divergence. Furthermore, there are introductory logic texts that don't even mention xor [thus calling something xnor would be a big huh for the students]; for example Suppes explicitly refutes the need to introduce a symbol for xor in his introductory logic textbook. But it's hard to discuss logic without ever getting to equivalence (iff aka biconditional).

As an aside, perhaps if Latin were Suppes' [or other logician's] first language, he/they would be more inclined to accept [something like] xor, because (quoting from Copi's textbook): "Although disjunctions are expressed ambiguously in English, they are unambiguous in Latin. ... The Latin word "vel" expresses weak or inclusive disjunction, and the Latin word "aut" corresponds to the word "or" in its strong or exclusive sense." This uniform interpretation of Latin is disputed by others though because aut in negated sentences like neo timebat tribunos aut plebes "no one feared the magistrates [x]or the mob" doesn't sound genuine with aut interpreted as xor instead of or because then you can read that as allowing for "everyone feared both the magistrates and the mob" as being possibly true.

\$\endgroup\$
1
  • \$\begingroup\$ I don't see how your answer disagrees. As you correctly state, xnor is equivalent to a biconditional/equivalence/coincidence/equality operation in other fields. But that's just a consequence of working through the logic. Perhaps it would be clearer to replace "by-product" with "coincidence" or "happenstance"? English is tricky... \$\endgroup\$ Commented Dec 23, 2015 at 23:45
0
\$\begingroup\$

It would make more sense to have the biconditional gate be the normal one and the XOR be the negated one. That way we could have IFF and NIFF gates. However, what I wonder is why we go with XNOR instead of NXOR since the latter is much easier to say (ex-nor vs. nexor) and more descriptive of the situation. Exclusive nor by this description is equivalent to an exclusive or, which would imply that the gate isn't any different.

\$\endgroup\$
0
\$\begingroup\$

Fundamentally, the answer to your question is a historical one and not a mathematical one. If George Boole thought the concept of "fundamental logical operations" was best described by "negation", "conjunction" and "If and only if" (equality) and everything else could be described as combinations of those fundamentals then the term for XNOR would be NIFF in modern Boolean algebra (since that is a functionally complete set). Because, instead, George Boole felt that "negation", "conjunction" and "disjunction" were a fundamental set we derive terms from that set.

But another issue is the confusion caused by the name XNOR being used instead of NXOR since XNOR is calculated as NOT(a XOR b). People often say it's because XNOR is easier to say, I'm not sure, "nexor" is just fine for me. But, more confusingly, people also sometimes say that it is more congruent with XOR and that we can think of NOR as fundamental, meaning "neither" in English (people don't always make this association). And XNOR means "exclusive neither". I have no idea how you apply the word "exclusive" to the word "neither" using either dictionary definitions of the adjective form of "exclusive". This is an unfortunate confusion and I wish we used NXOR or just updated Boolean Algebra to add IFF and NIFF so that the derivation of the terms were congruent with NAND and NOR.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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