11.001001000011111101101010100010001000 Arithmazium
Home

Division and remainder

Like multiplication, division in binary arithmetic is simpler than long division from school. It uses the multipication table we saw on the last page.

Example

Here is the quotient \( 100 \div 13 = 7 \; remainder \; 9 \). The leading zeros of the divisor 00001101 are omitted, to simplify the diagram.


              111             7
       +---------         +----
  1101 | 01100100      13 | 100
         - 1101            - 91
          ------            ---
           11000              9
          - 1101
           ------
            10110
           - 1101
            -----
             1001  remainder 9

Each step of the division is easy, because the only multiplications are by one. We compare the divisor with the partial remainder to decide whether to subtract or to plaze a 0 in the quotient, shift the divisor right one bit, and continue.

Just as a product might be computed into a two-byte field, so might a two-byte dividend be divided by a one-byte divisor. That would produce a one-byte quotient and one-byte remainder. We show just simple one-byte arithmetic here.

Home