Binary long division for polynomials in CRC computation

36.1k Views Asked by At

I am trying to learn binary long division, and I am confused. An example in my book gives that $10011010000/1101 = 11111001$ plus a remainder of $101$, which doesn't make sense, since $1001$ is not divisible by $1101$, and so the first digit should be $0$. When I use an online calculator, it gives me a result of $01011110$, which makes more sense. Could anybody enlighten me, please?

To add some context, this is the polynomial long division involved in CRC computation. Maybe the numbers, which represent the coefficients of polynomials, aren't supposed to be converted to decimal? The number being divided had already been extended by the degree of the divisor.

2

There are 2 best solutions below

3
On BEST ANSWER

If it is polynomials, you can't transform to decimal. What you have is: $$ x^{10} + x^7 + x^6 + x^4 / x^3 + x^2 + 1 $$ The coefficients are in $\mathbb{Z}_2$ (they are 0 or 1, and $1 \cdot 1 = 1$, $1 + 1 = 0$). Do the polynomial long division.

Or work similar to what you would do when dividing integers, sliding the divisor against the dividend. Just that it is much simpler: Next bit is the first bit of what comes next, and in $\mathbb{Z}_2$ addition is substraction (and is the XOR operation for bitwise operations e.g. in C).

 10011010000/1101 = 111001
-1101
 -----
  1001
 -1101
  -----
   1000
  -1101
   -----
    1010
   -0000
    -----
     0100
    -0000
     -----
      1000
     -1101
      -----
       101

Thus the quotient is 111001 (i.e., $x^5 + x^4 + x^3 + 1$) with remainder 101 (i.e., $x^2 + 1$).

3
On

$1232 = 94 * 13 + 10$

$10011010000 = 1011110 * 1101 + 1010$

The example is wrong and your online calculator is calculating correctly.