2
$\begingroup$

I'm trying to do a binary division to find a remainder. Here's what I've done:

10011100/1001 = 10001
1001
----
00001
    0
-----
    11
     0
   ----
    110
      0
   -----
    1100
    1001
    ----
    0011

This gives me a remainer of 0011 or 3 in decimal, which is correct when dividing 156/9. However, when I'm using online calculators, they all give me a remainder of 101 or 5 in decimal. What am I doing wrong?

$\endgroup$
4
  • $\begingroup$ Could you provide a link to an online calculator giving $101$? As it is, how could anyone know what a random calculator did? $\endgroup$ Apr 26 '18 at 13:36
  • $\begingroup$ Since your result in binary agrees with the remainder in decimal (which we can check by "casting out nines" in this problem), it is hard to know what you think is wrong. Perhaps identifying the "online calculators" you used (and double checking your data entry) would give Readers something more to go on. $\endgroup$
    – hardmath
    Apr 26 '18 at 13:39
  • 1
    $\begingroup$ @EricTowers Here's one: link Here's another one: link $\endgroup$ Apr 26 '18 at 13:40
  • $\begingroup$ Those calculators seem to be messing up on the last step, $1100- 1001$. I'm not sure why. They have the answer as $100 + 1$ when it should be $100 - 1$ $\endgroup$
    – John Lou
    Apr 26 '18 at 13:46
1
$\begingroup$

Both calculators are computing in GF(2), the Galois field of order $2$. In this field, subtraction does not involve carries -- subtraction is accomplished by XORing the operands.

For instance, at your first link, the last "subtraction" is "$1100 \underline{\vee} 1001 = 101$.

An actual binary calculator gets the result you are expecting.

$\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.