I was wondering why there is no XAND operator? Wikipedia certainly doesn't mention one. I found some comments to answer on this question but there seems to be wide spread disagreement. I would have that XAND would always result in false EXCEPT for false XAND false, but on second thought this is probably wrong.
-
1Because no-one's found a useful concept that it would express? – Don Roby Mar 01 '14 at 19:38
-
Is [that](http://en.wikipedia.org/wiki/Sheffer_stroke) your XAND? – Egor Skriptunoff Mar 01 '14 at 19:44
-
Just because I don't see a point doesn't mean others won't use it. I can just as easily say what's the point of XOR because it can be made from AND, OR, NOT – Celeritas Mar 01 '14 at 20:06
-
Wait, you want an operator that expresses 0*0=1 ? We already have a name for that operator, it's called NOR. – slebetman Mar 05 '14 at 04:46
4 Answers
Wikipedia mentions NOR though, which has exactly the same truth table as what you call XAND, and a probably more intuitive name. The "exclusive" in XOR means that we exclude the case where both inputs are true
. The "exclusive and" term doesn't make much sense since an AND is only true
for one combination of inputs, so what would you exclude?

- 6,207
- 1
- 26
- 36
-
2I don't think it's called exclusive because we exclude something, but rather that in `xor` exclusively one of the terms could be true, not both. – Leeor Mar 01 '14 at 21:55
-
@Leeor Okay, but "exclusively one of the terms is true" basically means "if one term is true, we exclude the case of the other being true", which amounts to excluding the case where both are true. Different formulation, same meaning, as I see it. – Trillian Mar 01 '14 at 23:43
-
I've always understood the exclusivity to be like this: whereas `OR` means either disjunct being true *including* the case where they are both true, `XOR` means either disjunct being true *excluding* the case where they are both true." – MattClarke Mar 03 '14 at 03:16
The current binary operations we have exist because a critical mass of software and hardware designers found them useful. They were clearly defined before they had a name: someone made an AND because they needed a binary operation such that "A (operation) B" would be 1 only if A and B were both 1, and they named this operation "AND".
What strikes me with your question is that you do not make a case for a XAND and neither do you clearly define it. In essence, you're asking two questions:
- Is there a well-defined binary operation called a XAND?
- Assuming that there is indeed a well-defined XAND, what's its truth table?
None of the 6502, PowerPC, MIPS, AVR32 or x86/amd64 instruction sets have a "xand", but they all have AND, OR, XOR and NOT atomic operations. None of the languages with binary operations that I know have an atomic (as in semantically indivisible) XAND operation. Because of that, the second question is unanswerable. There is no consensus on what a XAND should be because nobody bothered to define it and have other people use it.
Luckily, it's rather easy to express just about any binary operation with the four ones we already have. As you correctly noted, we could even get rid of at least the XOR; but we don't, because a critical mass of people found it useful to have as an atomic operation.

- 134,922
- 42
- 253
- 328
Well, let see. In OR we have 3 cases, where the result is 1. In XOR we exclude one of them -
- 0 xor 0 = 0
- 0 xor 1 = 1
- 1 xor 0 = 1
- 1 xor 1 = 0 - the excluded case.
In AND we have 3 cases where the result is 0. In XAND we exclude one of them
- 0 xand 0 = 1 - the excluded case
- 0 xand 1 = 0
- 1 xand 0 = 0
- 1 xand 1 = 1
As you can see this is actually XOR+NOT (also known as XNOR) operation.
The algebraic signs for these operations are:
OR: A + B
AND: A.B
XOR: A⊕B (U+2295 CIRCLED PLUS)
XAND: A⊙B (U+2299 CIRCLED DOT)

- 6,857
- 4
- 31
- 60
-
Would you say that `0 and 0 = 0` was "included" and regular AND? Considering `0 xand 0 = 1` to be the "excluded" case seems like an abuse of terminology. – Trillian Mar 01 '14 at 21:24
-
Would you say that 1 or 1 = 1 was "included" in the regular OR? All "exclusive" operations has special attitude to the case where the two input arguments are equal. – johnfound Mar 01 '14 at 21:28
-
Well yes, I see "included/excluded" as implying "from the set of inputs which yield true", but maybe that's only me... – Trillian Mar 01 '14 at 21:38
-
Considering there's just one widely recognized exclusive operation, inferring properties about *all of them* seems like a stretch to me. OP also does not define XAND the same way as you do. – zneak Mar 01 '14 at 21:44
-
If the OP knew what XAND is, he wouldn't ask the question. I am not inventing definitions. Naming it XAND or XOR-NOT does not change its nature. – johnfound Mar 01 '14 at 21:59
-
1If you are not inventing the definition, could you cite a source that defines XAND as you do? – zneak Mar 01 '14 at 22:03
-
The OP defines his XAND as 0*0=1, 0*1=0, 1*0=0, 1*1=0 (his words paraphrased, the operator always produces false except when both inputs are false). So basically the OP was looking for NOR. – slebetman Mar 05 '14 at 04:49
-
@slebetman the OP then said: "but on second thought this is probably wrong.", so he is not confident and that is why he asked. – johnfound Mar 05 '14 at 05:39
The conventional name is XNOR, and it can be found in TTL and CMOS chips. Wiki article
Alternative names for binary operations were used on old computers like CDC 3000 series, Univac 1100 series, ... . Using RSLT to mean result operand and OPR1 and OPR2 to mean operands:
selective set => RSLT = OPR1 OR OPR2
selective complement => RSLT = OPR1 XOR OPR2
selective copy => RSLT = OPR1 AND OPR2
selective clear => RSLT = (NOT OPR1) AND OPR2
selective substitute ?? RSLT = ((NOT OPR1) AND RSLT) OR (OPR1 AND OPR2)

- 27,407
- 3
- 36
- 61