Hi
Its not an addition, but an exclusive OR operation. At least the output confirms to the same, so the symbol of the operator.
cheers
Hi
Its not an addition, but an exclusive OR operation. At least the output confirms to the same, so the symbol of the operator.
cheers
The plus-symbol in a circle does not denote addition. It is a XOR operation.
I hope it makes more sense now..
That's the XOR operator, not the PLUS operator
XOR works bit by bit, without carrying over like PLUS does
1 XOR 1 = 0
1 XOR 0 = 1
0 XOR 0 = 0
0 XOR 1 = 1
People are saying that the symbol doesn't mean addition. This is true, but doesn't explain why a plus-like symbol is used for something that isn't addition.
The answer is that for modulo addition of 1-bit values, 0+0 == 1+1 == 0, and 0+1 == 1+0 == 1. Those are the same values as XOR.
So, plus in a circle in this context means "bitwise addition modulo-2". Which is, as everyone says, XOR for integers. It's common in mathematics to use plus in a circle for an operation which is a sort of addition, but isn't regular integer addition.
It's an exclusive or (XOR). If I remember correctly, when doing bitwise mathematics the dot (.) means AND and the plus (+) means OR. Putting a circle around the plus to mean XOR is consistent with the style used for OR.
I used the logic in the replies by rampion and schnaader. I will summarise how I confirmed the results. I changed the numbers to binary and then used the XOR-operation. Alternatively, you can use the Hexadecimal tables: Click here!