If we have:
x = 1101 and y = 101
How to XORing these numbers?
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.Sign up to join this community
There are multiple ways to interpret this XOR.
The most common one is that you XOR bit-wise, and that these strings represent numbers, so adding 0 to the left doesn't change their value.
Then $5 \equiv 101 \to 0101$ and then you XOR bit-wise.
x 1101 y 0101 ------- XOR 1000
which gives 8, if we are talking about unsigned numbers. However, the above depends on my understanding of your system. Change the assumptions, change the results.
Look first you should know is your numbers in Signage system value or not if they are in Signage system value you should do some stuff 1_ your number is positive (it means the last bit is zero such as 101 this number is -3) so in this case if you want to increase the number of bits you should add 1 to last bit . in your case the number 101 turns into 1101 and 1101 xor 101 turns into 1101 xor 1101 and the answer is 0000 2_ but if your numbers were normal (not in Signage system value mode) very easy you add zero to last bit . in your case 1101 xor 101 become 1101 xor 0101 and the answer is 1000