The base of any number system is determined by the number of digits in the system. For example, we know that binary is a base-2 number system since it uses two digits and decimal is a base-10 system since it uses ten digits. Throughout our lessons, we will distinguish between various number systems by putting a small subscript after the number to indicate the base. For example, a typical decimal number would be written like 462.15_{10} and a typical binary number would be written like 110.11_{2}.
In order to convert between binary and decimal numbers, we need to understand the relationship between the digits of a given number, the position of those digits, and the base of the number system. Let's take another look at our example number in the decimal system.
Hundreds | Tens | Ones | Tenths | Hundredths | |
10^{2} | 10^{1} | 10^{0} | 10^{-1} | 10^{-2} | |
4 | 6 | 2 | . | 1 | 5 |
The first digit of our number is 4, but because this digit is located in the hundreds column, we know it really represents the value 4 * 10^{2} or 400. Similarly, the 6 in the tens column represents the value 6 * 10^{1} or 60. Continuing this pattern, we can express the number 462.15_{10} as follows:
4*10^{2 } = 4*100 = 400. 6*10^{1 } = 6*10 = 60. 2*10^{0 } = 2*1 = 2. 1*10^{-1} = 1*.1 = 0.1 5*10^{-2} = 5*.01 = + 0.05 ^{ } 462.15 |
In general, the relationship between a digit, its position, and the base of the number system is expressed by the following formula:
DIGIT * BASE^{ POSITION #} |