# Binary remainder not equal to the decimal remainder

I am having a weird result. I am dividing the binary number $10101010100000$ by $10011$.

In binary division. I get $R= 0100$ which is 4.

However, If I consider the decimal representation of the numbers then I will have that $10101010100000 = 10912$ and $10011 = 19$ And we all know that $10912$ divided $19$ gives a remainder of $6$ and not 4

I checked my results using all software you can imagine. And I still observe that the binary remainder is not equal to the decimal remainder. And I am going crazy !

          1000111110
--------------
10011)10101010100000
10011
-----
100101
10011
------
100100
10011
------
100010
10011
-----
11110
10011
-----
10110
10011
-----
110


As you can see, the remainder is $110_{\text{two}}=6$.

• I didn't make a mistake according to this ee.unb.ca/cgi-bin/tervo/… – alkabary Apr 13 '15 at 1:35
• @alkabary: That calculation is obviously wrong: its quotient is decimal $732$, and $732\cdot19=13908$, which is way too big. – Brian M. Scott Apr 13 '15 at 1:39

\begin{align*} 10101010100000 -10011000000000&=10010100000\\ 10010100000 - 1001100000 &= 1001000000\\ 1001000000 - 100110000 &= 100010000\\ 100010000 - 10011000 &= 1111000\\ 1111000 - 1001100 &= 101100\\ 101100 - 100110 &= 110 \end{align*} The remainder is 6.

• I didn't make a mistake according to this ee.unb.ca/cgi-bin/tervo/… – alkabary Apr 13 '15 at 1:35
• Their first step is wrong. You can see for yourself that $10101010100000-10011000000000=10010100000$, not what they listed ($0110010100000$). Their math is wrong. – pre-kidney Apr 13 '15 at 1:39

Evidently you've made a mistake in binary division.

• I didn't make a mistake according to this ee.unb.ca/cgi-bin/tervo/… – alkabary Apr 13 '15 at 1:35
• That site isn't doing binary arithmetic, it's doing polynomial computations over GF(2). – Robert Israel Apr 13 '15 at 2:31