tags:

views:

783

answers:

5

What are XAND and XOR? Also is there an XNot

+6  A: 

XOR is Exclusive Or. It means "One of the two items being XOR'd is true, but not both of them."

TRUE XOR TRUE : FALSE
TRUE XOR FALSE : TRUE
FALSE XOR TRUE : TRUE
FALSE XOR FALSE: FALSE

Wikipedia's XOR Article

XAND I have not heard of.

Austin Fitzpatrick
+12  A: 

XOR is short for exclusive or. It is a logical, binary operator that requires that one of the two operands be true but not both.

So these statements are true:

TRUE XOR FALSE
FALSE XOR TRUE

And these statements are false:

FALSE XOR FALSE
TRUE XOR TRUE

There really isn't such a thing as an"exclusive and" (or XAND) since in theory it would have the same exact requirements as XOR. There also isn't an XNOT since NOT is a unary operator that negates its single operand (basically it just flips a boolean value to its opposite) and as such it cannot support any notion of exclusivity.

Andrew Hare
XAND would be the same as XNOR not XOR.
Matthew Whited
It would also confuse the crap out of most people which is why it is typically listed as XNOR.
Matthew Whited
Exclusive "Not Or" should actually be Not "Exclusive Or"
Arlen Beiler
That doesn't stop it from be noted as XNOR.
Matthew Whited
You could also call XOR XNAND... of course that would be confusing to have two names for the same gate and XOR is much easier to understand at a glance.
Matthew Whited
+1  A: 

There is no such thing as Xand or Xnot. There is Nand, which is the opposite of and

TRUE and TRUE   : TRUE
TRUE and FALSE  : FALSE
FALSE and TRUE  : FALSE
FALSE and FALSE : FALSE


TRUE nand TRUE   : FALSE
TRUE nand FALSE  : TRUE
FALSE nand TRUE  : TRUE
FALSE nand FALSE : TRUE
Mongo
Actually, even though 'nand' and 'nor' are the opposite of 'and' and 'or' respectively, you would think they were just implemented with a 'not' gate attached to the output of and/or. But 'nand' and 'nor' can actually be implemented with less cmos gates than their more conventional counterparts. One way of optimizing circuits is to replace as many 'and' and 'or' gates as you can with 'nand' and 'nor' gates.
Mongo
+3  A: 

Hmm.. well I know about XOR (exclusive or) and NAND and NOR. These are logic gates and have their software analogs.

Essentially they behave like so:

XOR is true only when one of the two arguments is true, but not both.

F XOR F = F
F XOR T = T
T XOR F = T
T XOR T = F

NAND is true as long as both arguments are not true.

F NAND F = T
F NAND T = T
T NAND F = T
T NAND T = F

NOR is true only when neither argument is true.

F NOR F = T
F NOR T = F
T NOR F = F
T NOR T = F
itsmatt
A: 

XOR behaves like Austin explained, as an exclusive OR, either A or B but not both and neither yields false.

There are 16 possible logical operators for two inputs since the truth table consists of 4 combinations there are 16 possible ways to arrange two boolean parameters and the corresponding output.

They all have names according to this wikipedia article

Ernelli