1

For some cases, modulo 2 binary division is giving the same remainder as a base 10 modulus but for some cases it is not. Is there some relationship between the two remainders? Example:-

1.) q = 101000110100000
p = 110101
modulo 2 binary division remainder = 01110
and  In base 10,
q = 20896
p = 53
and q%p = 14 which is the same as 01110

2.) q = 11001001000
p = 1001
modulo 2 binary division remainder is 011
and In base 10,
q = 1608
p = 9
and q%p = 6 which is different from 011.

So is there some relationship or it is totally unrelated? I want to know if I can derive base 2 modulo division remainder by doing decimal modulus.

Krash
  • 111
  • 3
  • The numbers themselves do not depend on the representation you choose to use, be it decimal, binary, or roman numerals for that matter. The quotient and remainder are numbers defined by the Euclidean division rules, so if you get different results in different bases then you must be doing something wrong. What you posted is not enough to tell where exactly you went wrong. – dxiv May 04 '18 at 06:40
  • This is the method i followed for modulo 2 binary division https://en.wikipedia.org/wiki/Cyclic_redundancy_check#Computation . I am trying to compute the CRC. Here are my steps https://imgur.com/a/cL5vH9Q – Krash May 04 '18 at 06:43
  • Sorry, not sure what that's supposed to mean. Try to write the decimal equivalent side-by-side, and it should become apparent where they diverge. – dxiv May 04 '18 at 06:46

1 Answers1

1

The ramainder doesn't depend upon the base that you choose to express it. Given two natural numbers $p$ and $q$, the remainder of the division of $p$ by $q$ is the only number $r\in\{0,1,\ldots,q-1\}$ which can be written as $p-d\times q$ for some non-negative integer $d$.

  • I am sorry, I meant I am doing modulo 2 binary division(like we do in calculation of CRC where we use XOR instead of subtraction) in the first case and normal division in the second. – Krash May 04 '18 at 06:20
  • Also, you can check , in my second example, the two methods are giving different remainders – Krash May 04 '18 at 06:21
  • In your second example, the remainder is $6$, not $3(=110_2)$. – José Carlos Santos May 04 '18 at 06:24
  • I a certain that the remainder is 011, also, please note i am doing modulo 2 binary division. Here are my steps, https://imgur.com/a/cL5vH9Q . Also, this is similar to a crc calculation which is mentioned here https://en.wikipedia.org/wiki/Cyclic_redundancy_check#Computation – Krash May 04 '18 at 06:37