0
$\begingroup$

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 !

$\endgroup$
2
$\begingroup$

Your binary remainder is wrong.

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

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

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

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

Evidently you've made a mistake in binary division.

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

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.