Why the binary division of the two has the same quotent

457 Views Asked by At

I am trying to divide 110000 with 1101 in binary (long division). I use XOR each time. The divisions above should have quotent 100. However I might must misunderstood something. Could please anyone help me with that?

basically I am doing the following

     ---011
1101/110000
     0000
     11000
      11010
       1101
       ----
       0111
2

There are 2 best solutions below

1
On BEST ANSWER
110000 : 1101 = 11 rem 1001
 1101
-----
 10110
  1101
 -----
  1001
7
On

OP has clarified his question to explain that he is doing long division of polynomials over $\Bbb Z_2$; here 1101 represents $x^3+x^2 +1$ and the coefficients are elements of $\Bbb Z_2$ where $1\oplus1=0$.

     ------
1101/110000

In ordinary division, $1101>1100$, so we would have to start dividing one place to the right of 1100. But in polynomial long division we have $\deg(1101)\le \deg(1100)$, so 1101 does divide into 1100, because $$x^3+x^2 = (x^3+x^2+1) \cdot 1 \oplus 1$$ so the quotient is 1 and the remainder is 1:

        1
     ------
1101/110000
     1101

        1
     ------
1101/110000
     1101
     ----
        1       (subtract mod 2)

Here "subtract mod 2" is the same operation as "XOR". It is also the same as addition mod 2, which I am writing as $\oplus$.

        1
     ------
1101/110000
     1101 \
     ----- |  bring down next digit
        10<'

Now $\deg(1101) = 3$ but $\deg(10) = 1$, so we cannot divide, and we bring down the next digit:

        10
     ------
1101/110000
     1101  \
     ------ |  bring down next digit
        100<'

Again we can't divide because $\deg(1101) > \deg(100)$.

        100
     ------
1101/110000
     1101  
     ------ 
        100

That was the last digit, so we're done; the quotient (at the top) is 100 and the remainder (at the bottom) is 100. Or put in terms of the original polynomials, we should have

$$x^5 + x^4 = (x^3+x^2 + 1)\cdot x^2 \oplus x^2$$

where the first $x^2$ is the quotient and the second $x^2$ is the remainder.

You should check that this equality holds. (It does.) If not, we got the wrong answer.