Division of binary numbers, confusing

842 Views Asked by At

I am trying my best to divide the following:

Perform the following computations in binary arithmetic (Show how you perform the computations):

enter image description here

My attempt:

enter image description here

I watched:

Question: What is a more easy way, or approach to perform this, without really getting lost and confused?


EDIT: Due to confusion of the question above, I am simplifying this: N.B. It's not about straightly calculating it, but, documenting the exact steps how you arrive to that solution.

It states in the task,

Perform the following computations in binary arithmetic (Show how you perform the computations):


According to the solution paper, this is what I see.

enter image description here

2

There are 2 best solutions below

12
On BEST ANSWER

Loosely phrased, the long division algorithm is performed as follows:

First, write the numbers with the number you are dividing by on the left and the number you are dividing into on the right, the number you are dividing into inside of a portion of a box for organizational sake.

       _________
110000 | 1111011

Now, pull the first digit down of the number you are dividing into. Check to see if the number you are dividing by is less than or equal to that digit you pulled down. If it is, then subtract the number you are dividing by out of that digit you have pulled down as many times as you can so as to have the result still be non-negative. In binary, this can only be once or not at all, but in decimal it could be several times. Keep track of the result of the subtraction as well.

Write the number of times you subtracted your number in the corresponding position above the bar at the top, writing zero instead if you were not able to subtract the number.

Continue the process by using the result of the subtraction of the previous iteration (or the same digits/bits as were available the previous step in the case that no subtraction occurred) and append the next single additional digit/bit from the original number being divided into.

This is where you appear to have confused yourself in your work pictured. You suddenly one of the times increased the number of digits twice, having skipped a step, when you went from the line with 11110 to the next with line 1111011 having not had a line with 111101 between.

Again, repeat the process, check if the number you are dividing by is less than or equal, writing the number of times it can be subtracted away at the top, and keeping the result of that subtraction available for the next line to use.

The process ends when all digits of the number you are dividing into have been used up and the result of the subtraction is zero. This may mean that you need to continue past where the digits would normally have ended, at which point you should include the decimal point and append only as many zeroes after the decimal point as you need and drop those down.

The result after the first several iterations should look something like this:

         0000010.1~~~
       __________
110000 | 1111011.   \
         1      .    \
        -0      .     \
        __             |
         11     .      |
         -0     .      | --  For what its worth, all of this could be
        ___            |  skipped since we know we need at least as
         111    .      |  many digits as what we are dividing by
          -0    .      |
        ____           |
         1111   .      |
           -0   .     /
        _____        /
         11110  .   /
            -0  .  /
        ______
         111101 .   <------ You skipped this step
        -110000 .
        _______
         0011011.
              -0.
        ________
           110110
          -110000
        _________
           000110

If we were to complete the process we get as a final picture... this:

         0000010.1001
       ______________
110000 | 1111011.0000    <---- We added the decimal point and enough zeroes as we needed to complete
         1      .  
        -0      .  
        __         
         11     .  
         -0     .  
        ___        
         111    .  
          -0    .  
        ____       
         1111   .  
           -0   .  
        _____      
         11110  .  
            -0  .  
        ______
         111101 .   
        -110000 .
        _______
         0011011.
              -0.
        ________
           11011 0    <--- this empty space doesn't mean anything, it is just there to let numbers line up correctly
          -11000 0        If writing by hand, the decimal point would have not used up an entire column
        _________
           00011 0
                -0
              ____
              11 00
                 -0    <---- 1100 is not larger than 110000 so we subtract nothing, writing a zero at the top in this position
              _____
              11 000   <---- we then pull down an extra digit
                  -0
              ______
              11 0000
             -11 0000  <---- what we are dividing by is less than or equal, so we subtract it from the running remainder
              _______
                    0   <---- equal to zero so we are done, so write the 1 at the top in this position

This is, again, annoying to do with such large numbers and such wide spaces between doing things. Graph paper where you can keep things perfectly lined up and your vision doesn't get blurred is helpful... but it can be better to break this up into larger meta-steps.

A much better thing to here is to recognize $110000$ is equal to $11\cdot 10000$, and recognize that $1111011\div 110000$ is equal to $(1111011\div 11)\div 10000$

Doing the same as above but dividing by $11$ instead gives more regular interaction and smaller numbers to deal with at each step:

     0101001
   __________
11 | 1111011.
     1      .
    -0
    __
     11     .
    -11     .
     __
      01    .
      -0    .
      __
       11   .
      -11   .
      ___
       000  .
        -0  .
        __
         01 .
         -0 .
         __
          11.
         -11.
          __
           0.

After this, we divide by $10000$, but dividing by a number of this form is well known to be equivalent to just moving the decimal place an appropriate number of spaces.

5
On
         0000010 

       |-------- 
110000 | 1111011
         110000
         ------
         0011011
          000000
          ------
           11011 : Remainder

In the above long division example, where each of the numbers is in base 2 format, first, you are dividing the SIX digit number 111101 by the divisor of 110000, to yield a quotient of 1.

Then, you compute the product of 1 $\times$ 110000, and place it below the six digit portion of the dividend 111101.

Then, you perform the subtraction, and your new partial dividend is 011011.

Then, you rinse and repeat. The steps exactly analogize to the steps that you would take in a standard base 10 long division problem.