Dividing binary numbers
Dividing binary numbers
Example
1000101/1100 (this is 69/12 in decimal.)
1100 √1000101
1
1100 √1000101
1100
---------
101
Next, we bring down the next digit and move one place to the right.
Can 1100 go into 1010?
No, so we record a 0 in the quotient and carry down the next bit, like
this:
10
1100 √1000101
1100
---------
10101
1
Moving over another place, can 1100 go into 10101? Yes, so we record a
1 in the quotient and subtract:
101
1100 √1000101
1100
---------
10101
1100
---------
1001
We can also write that as 101 1001/1100 (5 9/12 decimal) by putting the
remainder over the divisor. That fraction can be reduced to 101 11/100 (5
3/4 decimal) by dividing the numerator and denominator by 3.
101.
1100 √1000101
1100
---------
10101
1100
---------
1001
Now we can continue the long division process. We carry down the next
digit (the first of our trailing zeros) and check: Can 1100 go into
10010?
Note that for the subtractions, we'll ignore the radix point. Again, the
answer is yes, so we record a 1 (this one is to the right
of the radix point in the quotient) and subtract:
2
101.1
1100 √1000101
1100
---------
10101
1100
---------
1001 0
110 0
---------
11 00
We'll carry down the next digit one more time and move over another
place. Can 1100 go into 1100?
Again, the answer is yes, so we record another 1 and subtract. Since the
result of this subtraction is zero, we're done and we have an exact
answer:
101.1
1100 √1000101
1100
---------
10101
1100
-----------
1001 0
110 0
-------------
11 00
11 00
-------------
0
Just as with decimal, some values won't divide evenly, and we'll get a
repeating fractional part. We can stop at any time, but realize that
we've only found an approximation, not an exact value.
One final note: If the divisor (the 1100 in this example) has a radix
point in it, move the radix points in BOTH the dividend and divisor to
the right an equal number of places sufficient to remove it from the
divisor. For example, to divide 11001.1 by 11.001, first move both
radix points right 3 places (you'll have to add zeros to the
dividend.) Then divide 11001100 by 11001.