Binary Numbers


Binary numbers (base-2 system) are the ones and zeros now comonly used used in computers. The Binary code is well suited to describe the two possible states an electrical circuit can be in at any given time - on and off, or 1 and 0. 1 for on and 0 for off.

0 = "OFF" or "FALSE" or Zero Volts, 1 = "ON" or "TRUE" or 3.5 / 5.0 Volts

Using various groupings of 1's and 0's together, a computer, or electrical circuit can create letters and/or numbers using the "True" and "False" test. The information in a computer has a binary code assigned to it. For example, the letter "A" converts to "01000001" in binary.

For example:

Number
1
2
3
4
5
6
7
8
9
10
Binary Equivalent
1
10
11
100
101
110
111
1000
1001
1010


Converting Binary Numbers to Decimal Numbers

To convert a Binary number to a Decimal number, you use the position value system. In the following example, an 8 place binary number is shown with the equivalent position values. (Larger numbers are made by simply continuing the progression shown below)

In example, Binary 10110011:

Progressing from right to left, starting with the first position, create a new value for the position by doubling each previous value. (Every other "bit" has a value two times the value of the bit to its right).

Binary Number
1
0
1
1
0
0
1
1
Associated Value
(128)
(64)
(32)
(16)
(8)
(4)
(2)
(1)
Exponential
2^7
2^6
2^5
2^4
2^3
2^2
2^1
2^0

To determine the value in Binary, if the value is 1, (TRUE), the corresponding number is added to the total. If the value is 0, (FALSE), the corresponding number is not added the total.

From the above example, the following number is developed:
Binary Number
1
0
1
1
0
0
1
1
Associated Value
(128)
(64)
(32)
(16)
(8)
(4)
(2)
(1)
Resulting State
True
False
True
True
False
False
True
True
Generated Value
+128
0
+32
+16
0
0
+2
+1

The generated values are then added together: 10110011 = (128+32+16+2+1) = 179.


Converting Decimal to Binary

The above process is also performed in reverse to detrmine the Binary numbers from any given number.

First the number of binary places needed to cover the decimal amount must be determined. If the case of a long binary number, the numbers may be split them into groups of 8.

In this example, the given number is 41. By process of elimination, we can converge on a binary number as follows:

The number is less than 128, therefore the first position is "0" 0 x x x x x x x
The number is less than 64, therefore position 2 is "0" 0 0 x x x x x x
The number is greater than 32, therefore position 3 is "1" 0 0 1 x x x x x
The difference between 32 and the given number is less than 16, therefore position 4 is "0" 0 0 1 0 x x x x
The difference between 32 and the given number is more than 8, therefore position 5 is "1" 0 0 1 0 1 x x x
The difference between 40 and the given number is less than 4, therefore position 6 is "0" 0 0 1 0 1 0 x x
Since the difference between 40 and the given number is equal to 1, the final position is "1" 0 0 1 0 1 0 0 1