How to use xor properly I need to know how to use XOR properly on more than two variables.
I have following example.
a xor b xor c
Now, the way I understand it is that:
$a$ xor $b$ = $a$ * not $b$ + not $a$ * $b$
That part is fairly simple for me to understand but how does the next part work? I imagine it goes like this.
($a$ * not $b$ + not $a$ * $b$) xor $c$
So, how can I use XOR on more than one variable?
I will use $\oplus$ for exclusive OR and $\bar x$ for NOT $x$. Just expand the expression:

$$\begin{align*}
(x\oplus y)\oplus z&amp;=(x\bar y+\bar xy)\oplus z\\
&amp;=(x\bar y+\bar xy)\bar z+\overline{(x\bar y+\bar xy)}z\\
&amp;=x\bar y\bar z+\bar xy\bar z+\overline{(x\bar y)}\;\overline{(\bar xy)}z\\
&amp;=x\bar y\bar z+\bar xy\bar z+(\bar x+y)(x+\bar y)z\\
&amp;=x\bar y\bar z+\bar xy\bar z+(\bar xx+\bar x\bar y+xy+y\bar y)z\\
&amp;=x\bar y\bar z+\bar xy\bar z+(\bar x\bar y+xy)z\\
&amp;=x\bar y\bar z+\bar xy\bar z+\bar x\bar yz+xyz
\end{align*}$$

If you examine that final result, you’ll see that it has every product (conjunction) with an odd number of non-negated variables. This is true in general: $x_1\oplus x_2\oplus\ldots\oplus x_n$ is the sum (disjunction) of all expressions of the form $y_1y_2\ldots y_n$, where each $y_k$ is either $x_k$ or $\overline{x_k}$, and the number of $k\in\{1,\ldots,n\}$ such that $y_k=x_k$ is odd. Thus, for instance,

$$\begin{align*}
w\oplus x\oplus y\oplus z&amp;=wxy\bar z+wx\bar yz+w\bar xyz+\bar wxyz\\
&amp;\quad+w\bar x\bar y\bar z+\bar wx\bar y\bar z+\bar w\bar xy\bar z+\bar w\bar x\bar yz\;.
\end{align*}$$

This more general result can be proved by induction on the number of terms.
Ensure that niether (b+a or b+c or a+c) are larger than your max datatype allows for. In other words in 16bit you can have XOR 255 and XOR (2^16 -256). This would be bit masking. Note the ^ is sometimes used for shifting instead of "to the power of".

Use XOR when trying to find the 2's Complement "the opposite of which bits have been set." 

An example is 7 XOR 255 and may get you a byte of data for the number (248) 1111 1000 which is (15*16) + (8*1). However this is false if you dealing with 16 bit numbers 7 XOR 255 will be 0000 0000 1111 1000. Unless the byte order is swapped for 16 bit machines the same number might be stored as 1111 1000 0000 0000 which is very confusing. Like in 16 bit PCM data sounds. If you start multiplying these you might get unpredictable results especially if you start going beyond your MAX Integer value and mess around with "Casting" of datatypes. NEGATIVE 1 could be stored like 11111110

Search for "bit masking" and "two's complement" and karnaugh map. 

What do you mean by not b? That it doesnt exist or that If B is true !B is false but do you mean the 2's complement? In order to find the twos complement you need all the bits to be set or 1s. You can do that with OR X where X has 1's for every bit. to set bits and AND0 to clear them.

Usually you need to know the number of bits used in your data type. And how negative numbers are stored in computers specifically your computer or raspberry pi or arduino or arm or motorolla processor or .... foobar named machine.

This technique is more common in low level programming "Assembly Languages".

Note: In decmial numbers we can multiply by 10 to append a zero in binary thats like multiplying by 2 and called a shift. If your left hand is in binary consider it times 16. So if you multiply a by b you could be shifting and so I disagree with the other answers on this page.

Back to 7 XOR 255 if you multiply both by 2 you would get problems 1110 XOR 1 1111 1110 this might set an overflow bit. I dont think XOR is reliable look on here for XOR Encryption and see problems especially in 64 bits and xxd command versus hexdump.