Binary division, with reminder

869 Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

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.