I need to xor the every single bits each other in a variable using c++
Let's consider 4-bit values a and x where their bit-representation is a = a3a2a1a0
and x = x3x2x1x0
.
We dene the masking operation "." as a.x = a3x3(xor)a2x2(xor)a1x1(xor)a0x0
.
I did a&x and find a3x3 a2x2 a1x1 a0x0
now i need to xor them but how ? is there any special way to do that ? like '&' operation ? I searched but didn't find anything..any help will be appreciated!
I assume `a3a2a1a0` is `0xA3A2A1A0`. **Edit**: got it. – YSC Dec 22 '15 at 13:38