2

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?

  • Could you provide a link to an online calculator giving $101$? As it is, how could anyone know what a random calculator did? – Eric Towers Apr 26 '18 at 13:36
  • 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. – hardmath Apr 26 '18 at 13:39
  • 1
    @EricTowers Here's one: link Here's another one: link – Sander Lindberg Apr 26 '18 at 13:40
  • 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$ – John Lou Apr 26 '18 at 13:46

1 Answers1

1

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.

Eric Towers
  • 67,037