MHB Divide Binary: Learn & Get Tricks!

  • Thread starter Thread starter bergausstein
  • Start date Start date
  • Tags Tags
    Binary Division
AI Thread Summary
To divide a smaller binary number by a larger binary number, long division is the primary method, similar to decimal division. An example is provided where 10111 is divided by 1110001, resulting in a binary quotient of 0.1001, which corresponds to the decimal fraction 9/16. While long division is effective, it can be lengthy, and there is a suggestion that dividing by a power of two can be simplified by moving the binary point, akin to decimal division. However, no faster general-purpose algorithm beyond long division is widely known, indicating a need for further exploration of quicker methods.
bergausstein
Messages
191
Reaction score
0
Hello! Can you teach me how to divide a smaller binary by a bigger binary. For example, 10111÷ 1110001.
If you can also share tricks for a much faster solution it would be very much appreciated.
 
Technology news on Phys.org
You can use long division in the same way you divide decimal numbers. For example, let's divide 9 by 16 in binary notation:

$$\begin{array}{r}0.1001\hspace{-4px}\\10000\enclose{longdiv}{1001.000} \\ -\underline{10000} \hspace{21px} \\ 10000 \\ -\underline{10000} \\ 0 \end{array}$$

We see the quotient in binary is 0.1001 which is:

$$\frac{1}{2^1}+\frac{1}{2^4}=\frac{1}{2^4}\left(2^3+1\right)=\frac{9}{16}$$
 
MarkFL said:
You can use long division in the same way you divide decimal numbers. For example, let's divide 9 by 16 in binary notation:

$$\begin{array}{r}0.1001\hspace{-4px}\\10000\enclose{longdiv}{1001.000} \\ -\underline{10000} \hspace{21px} \\ 10000 \\ -\underline{10000} \\ 0 \end{array}$$

We see the quotient in binary is 0.1001 which is:

$$\frac{1}{2^1}+\frac{1}{2^4}=\frac{1}{2^4}\left(2^3+1\right)=\frac{9}{16}$$

I tried it and it was too long. By any chance, do you know a faster way?
 
bergausstein said:
I tried it and it was too long. By any chance, do you know a faster way?

Dividing by a power of two (as I did in my example) simply means moving the decimal point (just as dividing by a power of 10 works in decimal notation), however, the only general purpose algorithm I know of is long division. However, it's not something I have ever spent any time studying, and so someone else may know of a quicker method. :)
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
2
Views
1K
Replies
42
Views
5K
Replies
34
Views
21K
Replies
4
Views
2K
Replies
32
Views
3K
Back
Top