Professional Documents
Culture Documents
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)
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:
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.
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 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
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.
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:
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 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.
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.
Repeat the steps above, but add any carry. Remember that 1+1 = 10 and 1+1+1 = 11. Remember to
carry the "1".
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
Binary Subtraction
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
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