January 2018

Saturday, January 20, 2018

Binary number division: how to divide binary numbers simply


Description

Binary number division is simple and easy! In this short episode of House of Hacks, Harley shows how to divide binary numbers. This is one in the Bits of Binary series on binary arithmetic.

Are you interested in making things around the home and shop? You’ve found the right place. Here at the House of Hacks, we do tutorials, project overviews, tool reviews and more. Generally this involves wood and metal working, electronics, photography and other similar things. If this sounds interesting to you, go subscribe and click the bell to get notifications.

Multiplying binary numbers
Bits of Binary playlist

There's a playlist containing videos talking about the House of Hacks' values.

And here’s the most recent video.

For a written transcript, go to Binary number division: how to divide binary numbers simply

Music under Creative Commons License By Attribution 3.0.
Intro/Exit: "Hot Swing" by Kevin MacLeod at http://incompetech.com

Transcript

In this previous video, we saw how multiplying binary numbers is almost trivial compared to multiplying decimal numbers.

In this episode of the House of Hacks, I'll show how division is just as easy!

[Intro]

Hi Makers, Builders and Do-it-yourselfers. Harley here.

Here at House of Hacks I hope to inspire, educate and encourage people who like to make things with a mechanical or technical bent to them.

Binary numbers are the foundation of much of our modern world and fall into the technical side of things.

This is one in an introductory series on binary numbers where I talk about how to read them, count in them and do basic math operations on them.

In this video we're going to be looking at division.

First a refresher for terminology.

Division involves dividing a dividend by the divisor and getting a quotient.

Remember in grade school how we had to memorize this multiplication table to know how to multiply and divide decimal numbers?

And remember how in the last episode we found out binary number multiplication was just these four elements of that table and how that made multiplication really easy?

Well the same thing holds true for division.

Let's get into this with some examples.

We'll start with 21 divided by 7.

Written as long division that looks like this.

Because our multiplication table only has two result values, one number can only be divided by another one 0 or 1 times.

This means a simple size comparison is really all that we need to look at when calculating the quotient.

Working through this, 111 is obviously larger than 1 so we start with 0.

111 is larger than 10, so we write down another 0.

111 is larger than 101. And again we write down 0.

Finally, 111 is less than 1010, so we write a 1 in the quotient, put the 111 under the 1010 and subtract.

The subtraction result is 11. Now we bring down the other 1.

And 111 is equal to 111 so we write a 1 in the quotient, put the 111 under the 111 and subtract.

Of course this is zero and we're done.

The resulting quotient is 11 which is three.

We know 3 times 7 is 21, confirming that the process works.

Let look at another example of 1011 divided by 10.

10 is greater than 1, so we start with a 0.

10 is equal to 10, so we put 1 in the quotient and 10 underneath and subtract giving us 0.

We bring down the 1 from the dividend.

10 is greater than 1, so we put a 0 in the quotient and we bring down the next 1.

11 is greater than 10, so we put a 1 in the quotient and 10 underneath, subtract, giving us 1.

There's nothing left of the dividend to bring down so we have a couple options that are the same as we have with decimal remainders.

We can either write the remainder as part of the quotient.

Or we can write the remainder as a binary fraction.

Or we can place a radix point and continue the division.

If we do this, we place a dot in the quotient and bring down a 0 next to our remainder giving us 10.

10 is equal to 10 so we place a 1 in the quotient and subtract the dividend from the working value.

The result is zero and we're done.

If the result was greater than zero, we'd bring down another 0 and continue expanding the radix part of the quotient, just like we do when working in decimal.

In the next episode of Bits of Binary, we'll take another look at subtraction by introducing negative numbers.

If you're interested in making things with a mechanical or technical bent to them, consider subscribing for future videos showing DIY projects, home and shop tutorials and other things related to wood working, metal working, photography, electronics and similar materials.

Thanks for joining me on our creative journey.

Now, go make something. Perfection's not required. Fun is!