You are on page 1of 9

Binary Numbers Overview

Binary is a number system used by digital devices like computers, cd players, etc. Binary is Base 2, unlike our
counting system decimal which is Base 10 (denary). In other words, Binary has only 2 different numerals (0
and 1) to denote a value, unlike Decimal which has 10 numerals (0,1,2,3,4,5,6,7,8 and 9)

Here is an example of a binary number: 10011100

Humans think in decimal numbers largely because the vast majority of human hands have ten fingers, and that
is how humans learned to count. Thus, counting in "base 10" is a natural extension of the human body.

So, then, why do we want to learn binary numbers (Base-2)? Because that's the best way for a computer to
think (and even though we modelled computers in our own image, they are decidedly not human). Using binary
representations of numbers is the best way for a computer to transfer information throughout its circuits with
minimal error.

Decimal Numbers
Let's take a closer look at something most of us take for granted.  Counting in decimal numbers.  For example,
when you see the decimal number:

4275

it means that you sum the following to get a concept of the total quantity of things represented by that number:

Thousands Hundreds Tens Ones


4 x 1000 plus    2 x 100 plus    7 x 10 plus    5 x 1

which is the same as:

4 x 103 plus    2 x 102 plus    7 x 101 plus    5 x 100

(Remember that in mathematics, any number raised to the zero power equals 1)

The number that is on the far right is in the "ones" place holder (called the least significant digit).  To the left of
that is the "tens" place holder.  To the left of that is the "hundreds" place holder, and so on.  They are all powers
of 10.  Whatever digit is sitting in a particular place holder, you multiply that place holder amount (power of 10)
by the digit, and then add them all up.

Thousands column Ones column


Hundreds column Tens column
(most significant digit) (least significant digit)

103 102 101 100


digit from 0-9 x 1000 digit from 0-9 x 100 digit from 0-9 x 10 digit from 0-9 x 1
4 2 7 5

= 4 thousand, 2 hundred, and seventy-five


= 4275
Binary Numbers
Similarly, in binary (Base-2), all the columns are powers of 2.  Think of the following table as the four least
significant digit place holders for the binary number system just like the tables above using the decimal number
system:

Eights column Ones column


Fours column Twos column
(most significant digit) (least significant digit)
23 22 21 20

The far right column is the "ones" place holder.  To the left of that is the "twos" place holder.  To the left of that
is the "fours" place holder (22 = 4).  To the left of that is the "eights" place holder (23 = 8).  They are all powers
of 2.  Whatever digit is sitting in a particular place holder, you multiply that place holder amount ( power of 2)
by the digit, and then add them all up.  However, remember that a binary digit has only two options, 0 or 1, so
it's very easy.

For example, let's look at the binary number: 1011

You would thus interpret in decimal as:

  Eights Fours Twos Ones


  1 x 23 plus   0 x 22 plus   1 x 21 plus   1 x 20
which equals 1x8 plus   0 x 4 plus   1 x 2 plus   1 x 1
which equals 8 plus   0 plus   2 plus   1

The total is:  11 (in decimal)  which equals   8 + 0 + 2 + 1

In other words, 10112  =  1110

For this example, let's convert the binary number 100110112 to decimal. List the powers of two from right
to left. Start at 20, evaluating it as "1". Increment the exponent by one for each power. Stop when the amount of
elements in the list is equal to the amount of digits in the binary number. The example number, 10011011, has
eight digits, so the list, to eight elements, would look like this: 128, 64, 32, 16, 8, 4, 2, 1

Write first the binary number below the list.

Here is this step written on paper using the example binary number, 10011011.

Draw lines, starting from the right, connecting each consecutive digit of the binary number to the power
of two that is next in the list above it. Begin by drawing a line from the first digit of the binary number to the
first power of two in the list above it. Then, draw a line from the second digit of the binary number to the
second power of two in the list. Continue connecting each digit with its corresponding power of two.

Here is this step written on paper using the example binary number, 10011011.

Move through each digit of the binary number. If the digit is a 1, write its corresponding power of two below
the line, under the digit. If the digit is a 0, write a 0 below the line, under the digit.

Here is this step written on paper using the example binary number, 10011011.

Add the numbers written below the line. The sum should be 155. This is the decimal equivalent of the binary
number 10011011. Or, written with base subscripts: 100110112 = 15510

Here is this step written on paper using the example binary number, 10011011. The sum of the bottom row,
155, is its decimal equivalent. Or, written with base subscripts: 100110112 = 15510

Repetition of this method will result in memorization of the powers of two, which will allow you to skip
step 1.

Practice: Try converting the binary numbers 110100012, 110012, and 111100012. Respectively, their decimal
equivalents are 20910, 2510, and 24110.

How to Convert from Decimal to Binary


This method is much easier to understand when visualized on paper. It relies only on division by two.

EXAMPLE 1: For this example, let's convert the decimal number 15610 to binary. Write the decimal
number as the dividend inside an upside-down "long division" symbol. Write the base of the destination system
(in our case, "2" for binary) as the divisor outside the curve of the division symbol.

2)156

Write the integer answer (quotient) under the long division symbol, and write the remainder (0 or 1) to
the right of the dividend.

2)156 = 0 Remainder 78

Continue downwards, dividing each new quotient by two and writing the remainders to the right of each
dividend. Stop when the quotient is 0.

2)156   0
 2)78    0
 2)39    1
 2)19    1
  2)9    1
  2)4    0
  2)2    0
  2)1    1
    0

Starting with the bottom remainder, read the sequence of remainders upwards to the top. You should
have 10011100. This is the binary equivalent of the decimal number 156. Or, written with base subscripts: 15610
= 100111002

EXAMPLE 2: To convert decimal to binary is very simple, you simply divide the decimal value by 2 and
then write down the remainder, repeat this process until you cannot divide by 2 anymore, let's take another
example the decimal value 157:

157 ÷ 2 = 78 with a remainder of 1


78 ÷ 2 = 39 with a remainder of 0
39 ÷ 2 = 19 with a remainder of 1
19 ÷ 2 = 9 with a remainder of 1
9÷2=4 with a remainder of 1
4÷2=2 with a remainder of 0
2÷2=1 with a remainder of 0
1÷2=0 with a remainder of 1 <--- to convert write this remainder first.

Next write down the value of the remainders from bottom to top (in other words write down the bottom
remainder first and work your way up the list) which gives: 10011101 = 157

Practice: Try converting the decimal numbers 17810, 6310, and 810. The binary equivalents are 101100102,
001111112, and 000010002. Try converting 20910, 2510, and 24110 to, respectively, 110100012, 000110012, and
111100012.

Adding Binary Numbers

Adding binary numbers is very similar to adding decimal numbers, but with a few minor exceptions.
Consider the addition of decimal numbers:

23
+48
___

We begin by adding 3+8=11. Since 11 is greater than 10, a one is put into the 10's column (carried), and a 1 is
recorded in the one's column of the sum. Next, add {(2+4) +1} (the one is from the carry)=7, which is put in the
10's column of the sum. Thus, the answer is 71.

Binary addition works on the same principle, but the numerals are different. Begin with one-bit binary addition:

0 0 1
+0 +1 +0
___ ___ ___
0 1 1

1+1 carries us into the next column. In decimal form, 1+1=2. In binary, any digit higher than 1 puts us a column
to the left (as would 10 in decimal notation). The decimal number "2" is written in binary notation as "10".
Record the 0 in the ones column, and carry the 1 to the twos column to get an answer of "10." In our vertical
notation,

1
+1
___
10

Always remember

 0+0=0
 1+0=1
 1+1=10
Add the following binary numbers 0111 and 1110

Steps

1.

Align the numbers you wish to add as you would if you were adding decimal
numbers.

2. Start with the two numbers in the far right column

Add the numbers following the rules of decimal addition (1+0 = 1, 0+0 = 0) unless both numbers
are a 1.

3.

Add 1+1 as "10" if present. (it is not "ten" but "one zero"). Write "0" below and
carry a "1" to the next column.

4. Start on the next column to the left

Repeat the steps above, but add any carry. Remember that 1+1 = 10 and 1+1+1 = 11. Remember to
carry the "1".

Rule for Adding binary numbers


Adding binary numbers is very similar to adding decimal numbers, first an example:
Let's look at the above example step by step:

1 + 1 = 0 (carry one)
1 + 1 (+ the carry) = 1 (carry one)
0 + 1 (+ the carry) = 0 (carry one)
1 + 0 (+ the carry) = 0 (carry one)
1 + 0 (+ the carry) = 0 (carry one)
0 + 1 (+ the carry) = 0 (carry one)
1 + 0 (+ the carry) = 0 (carry one)

The last carry is placed at the left hand side of the result giving: 10000010

Now Try a few examples of binary addition:

111 101 111


+110 +111 +111
______ _____ _____

Binary Subtraction

Example 6 Subtract 310 = 11 from 510 = 101 in binary form.

Solution The subtraction procedure is shown below.

Starting from the right, the first array is the subtraction in the right hand column. In the second array, a 1 is
borrowed from the third column for the middle column at the top and paid back at the bottom of the third
column. The second array is the subtraction 10 − 1 = 1 in the middle column. The final array is the subtraction 1
− 1 = 0 and the final answer is thus 102 = 210.
Quiz on Binary Numbers
Begin Quiz

1. Which of the following is the binary form of 3010?


(a) 10111 (b) 10101, (c) 11011, (d) 11110.

2. Which of the following is the binary sum 1011 + 1101?


(a) 11010, (b) 11100, (c) 11000, (d) 10100.

3. Which of the following is the binary subtraction 1101 − 1011?


(a) 11, (b) 110, (c) 101, (d) 10.
Binary to Octal Conversion

To convert from an integer binary number to octal you do the following:


1. Split the binary numbers into 3 bits sections from the least significant bit to the most significant bit.
2. Convert each 3 bit binary numbers to obtain the octal representation.

Convert the binary n umber 011001011010001 into its octal equivalent.

Step 1
011/001/011/010/001 note: the right most group may sometimes have 1 or 2 values.

Step 2
4 2 1 /4 2 1 /4 2 1/4 2 1/4 2 1
0 1 1 /0 0 1 /0 1 1/0 1 0/0 0 1
0+2+1/0+0+1/0+2+1/0+2+0/0+0+1
=3 / =1 / =3 / =2 / =1

Octal equivalent is 313318

You might also like