-1
$\begingroup$

I am trying to perform the bitwise XOR operation on a 32-bit system where both numbers are 16-digit decimals (base 10).

However, the largest unsigned integer number enterable in the 32-bit system is 4,294,967,295. My background isn't really in computational theory. Is there a way I can still do the XOR operation using two 16-digit numbers even though my system is 32-bit?

If not, I assume the only way is to write my own XOR operation?

$\endgroup$
4
  • 4
    $\begingroup$ You might want to post this in stackoverflow.com instead. $\endgroup$
    – Théophile
    Jun 12, 2020 at 0:07
  • $\begingroup$ How are these numbers represented on your $32$-bit system in the first place? $\endgroup$
    – saulspatz
    Jun 12, 2020 at 0:12
  • $\begingroup$ Currently, the numbers are split up into 3 pieces. So for example, for 1,123,456,789,123,456, it is split into 11,234 and 567,891 and 23,456. $\endgroup$
    – Rui Nian
    Jun 12, 2020 at 0:24
  • 1
    $\begingroup$ If we put 16 bit in rightmost of 32 and fill left side bits with 0-s, then 32 bit xor gives result in rightmost 16 bit. $\endgroup$
    – zkutch
    Jun 12, 2020 at 0:25

1 Answer 1

0
$\begingroup$

If you convert your $16$ digit numbers to binary they will have about $52$ bits. If you can store the lower $32$ in one variable and the higher ones in another, you can perform the XORs on a chunk of $32$ bits at a time. The XOR does not carry, so you don't have to worry about that. The problem with having the number split in three decimal chunks is the chunks interact to determine the binary expansion. You can't just express each of the three chunks in binary and XOR those.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.