Mathematics in the Workplace

Binary Arithmetic

by

Alison Hays


We are very familiar with the base-10 number system.  Almost all of the numbers that we deal with are base-10, or decimal numbers.  

What exactly does this mean?

When we see a number that is written in decimal notation, it is very easy to break it down into its component parts.  This relates to the idea of place value.  For example, take the number 485,103.  We know that this number is made up of the following:

4 one hundred thousands

8 ten thousands

5 thousands

1 hundreds

0 tens

and

3 ones.

The number can also be written as the following:

4 * 100,000 + 8 * 10,000 + 5 * 1,000 + 1 * 100 + 0 * 10 + 3 * 1

or

4 * 105 + 8 * 104 + 5 * 103 + 1 * 102 + 0 * 101 + 3 * 100.

This is familiar to most people because many people learn mathematics in elementary school by discussing place value.

As you can see, the above number can be written as the sum of multiples of various powers of ten.


The Binary Number System

and 

Converting Binary Numbers to Decimal Numbers

The binary number system is very similar to the decimal number system.  Instead of having ten digits (0 1 2 3 4 5 6 7 8 and 9), there are only two digits (0 and 1).  Instead of thinking of numbers as the sum of multiples of various powers of ten, the numbers can be written as the sum of multiples of various powers of two.

For example, a number that is written in binary notation is 10011.

This number can be written as the following:

1 * 24 + 0 * 23 + 0 * 22 + 1 * 21 + 1 * 20

or

1 * 16 + 0 * 8 + 0 * 4 + 1 * 2 + 1 * 1.

This number consists of

1 sixteen

0 eights

0 fours

1 two

and

1 one

Compare this to the different ways that we wrote the number 485,103 above.

If we complete the addition above, we see that the binary number 10011 is the same as the decimal number 19.


Converting Decimal Numbers to Binary Numbers

Converting decimal numbers to binary numbers is a bit more complicated than converting binary numbers to decimal numbers.

The process can be explained best by using an example.

Suppose we want to convert the decimal number 90 to a binary number.  First we ask ourselves what is the largest power of two that goes into 90?
It is 64, and 90 - 64 = 26.

Thus, we will have a 1 in the "64s place," or the "26 place," or the seventh digit to the left of the decimal point.  Thus, or number so far looks like this:

1 __ __ __ __ __ __

To find the digit that goes in the "32s place," we ask ourselves how many 32's are in 26.  The answer is 0 (26/32 = 0), so we write a 0 in the next place.  We now have

1 0 __ __ __ __ __

The next place is the "16s place."  26 divided by 16 is 1 with 10 left over.  Thus we now have

1 0 1 __ __ __ __

The next place is the "8s place" and 10 divided by 8 is 1 with 2 left over, so we have

1 0 1 1 __ __ __

The next place is the "4's place" and 2 divided by 4 is 0, so we have

1 0 1 1 0 __ __

The next place is the "2's place" and 2 divided by 2 is 1 with 0 left over, we can now fill in the rest of our number

1 0 1 1 0 1 0.

We can check that this is the right number by converting this binary number back to a decimal number:

1 * 26 + 0 * 25 + 1 * 24 + 1 * 23 + 0 * 22 + 1 * 21 + 0 * 20

=

1 * 64 + 0 * 32 + 1 * 16 + 1 * 8 + 0 * 4 + 1 * 2 + 0 * 1 

90

This is the number that we started with, so we know that we converted the decimal number 90 to the binary number 1011010 correctly.


Essay 3 | Alison's EMAT 6690 web page | Alison's web page | Student Web Pages | EMAT 6690 Page