
An Introduction to Numerical Bases
What is Base Ten?
Our common method of representing numbers is known as base ten or decimal. In base ten, each digit of a number represents some power of ten (e.g. ten, a hundred, a thousand). The diagram below illustrates how a baseten number (in this case 186,282.397) is represented.
This number can be broken down as:

1 × 
100,000 
+ 
8 × 
10,000 
+ 
6 × 
1,000 
+ 
2 × 
100 
+ 
8 ×
 10 
+ 
2 ×
 1 
+ 
3 × 
1/10 
+ 
9 × 
1/100 
+ 
7 × 
1/1,000 
Decimal is only one of many ways to represent numbers. Any other whole number can also be used as a base. The ancient Babylonians used base sixty (sexagesimal). The Maya used base twenty (vigesimal). Today, many applications in computer science employ base two, base eight, or base sixteen (hexadecimal). Want to know how these bases work? Let's take a look at the mathematics.


Exponents
An exponent is a shorthand way of writing multiplication. For example, consider the following:
7 × 7 × 7 × 7 × 7
We are multiplying 7 by itself 5 times. We can shorten this to:
7^{5}
In our example, 7 is the base, and 5 is the exponent. We say we are raising 7 to the 5th power or simply 7 to the 5th. Exponents are always written smaller and to the upper right of the base. Take a look at a few more examples:
2 raised to the 3rd power 
= 2^{3} 
= 2 × 2 × 2 
= 8 
10 raised to the 4th power 
= 10^{4} 
= 10 × 10 × 10 × 10 
= 10,000 
9 raised to the 7th power 
= 9^{7} 
= 9 × 9 × 9 × 9 × 9 × 9 × 9 
= 4,782,969 
Negative Exponents
An exponent doesn't have to be a positive number. We can also raise any base to a negative power. Consider this example:
3^{2}
This is three raised to the negative second power, which is equivalent to writing:
1/3^{2}
This is one third raised to the second power, which is equal to:
1/3 × 1/3 = 1/9
We can see from the above example that a negative exponent simply means we take the inverse of our base and multiply that by itself. Consider a few more examples:
2 raised to the negative 5th power 
= 2^{5} 
= 1/2^{5} 
= 1/2 × 1/2 × 1/2 × 1/2 × 1/2 
= 1/32 
10 raised to the negative 3rd power 
= 10^{3} 
= 1/10^{3} 
= 1/10 × 1/10 × 1/10 
= 1/1,000 
12 raised to the negative 2nd power 
= 12^{2} 
= 1/12^{2} 
= 1/12 × 1/12 
= 1/144 
Exponents of 1 and 0
Anything raised to the first power equals itself. For instance, 8^{1} equals 8. This logic can be applied to the rule for negative exponents. For instance, 8^{1} equals 1/8^{1}, which is simply 1/8.
Any nonzero number raised to the zeroth power equals one. For example:
3^{0} = 1
Similarly, 23^{0} and 42^{0} and 1,000,000^{0} all equal 1. (Note that we specify any nonzero number raised to the zeroth power. 0^{0} is mathematically undefined.)
Multiplying and Dividing with Exponents
Whenever you multiply two numbers with the same base, you simply add their exponents together. For example:
13^{3} × 13^{4} = 13^{3 + 4} = 13^{7}
This also works with negative exponents. Here are a few more examples:
2^{5} × 2^{4} 
= 2^{5 + 4} 
= 2^{9} 
= 512 
10^{3} × 10^{4} 
= 10^{3 + 4} 
= 10^{1} 
= 10 
5^{1} × 5^{3} 
= 5^{1  3} 
= 5^{4} 
= 1/625 
Similarly, whenever you divide by a number with the same base, you subtract the exponent:
4^{6} ÷ 4^{4} = 4^{6  4} = 4^{2}
You may have been wondering why any base raised to the zeroth power is 1. Is it just convention? No. We can see this by understanding multiplication and division. Consider this example:
9^{3} ÷ 9^{3} = 1
From basic arithmetic, we know that any number divided by itself equals 1. We also now know that when dividing by a number with the same base, we subtract the exponent. So, our example above evaluates to:
9^{3  3} = 9^{0} = 1
The same property holds true for 13^{453} ÷ 13^{453} or 51^{9962} ÷ 51^{9962} and so on.
Powers of Ten
Now that we understand bases and exponents, let's take a look at some of the powers of ten.
10^{3} = 1/10 × 1/10 × 1/10 = 1/1,000
10^{2} = 1/10 × 1/10 = 1/100
10^{1} = 1/10
10^{0} = 1 (any nonzero number raised to the zeroth power equals one)
10^{1} = 10
10^{2} = 10 × 10 = 100
10^{3} = 10 × 10 × 10 = 1,000
10^{4} = 10 × 10 × 10 × 10 = 10,000
10^{5} = 10 × 10 × 10 × 10 × 10 = 100,000
As you will see in the next section, the powers of ten form the basis of the decimal system.


Radices
A radix is another term for a base. Base ten, or decimal, uses a radix of ten. As mentioned previously, we can set our base, or radix, to any whole number we choose. To understand the relationship between a number and its radix, let's return to our graphic showing the decimal representation of 186,282.397. This time, the placeholders are labeled with corresponding powers of ten written beneath them.
From the graphic, we see that this number can be broken down as:
(1×10^{5}) + (8×10^{4}) + (6×10^{3}) + (2×10^{2}) + (8×10^{1}) + (2×10^{0}) + (3×10^{1}) + (9×10^{2}) + (7×10^{3})
The baseten pattern should now be apparent. Each place to the left of the decimal point represents an incremental power of ten starting with 10^{0}, continuing to 10^{1}, 10^{2}, and so on. The places to the right of the decimal point are just the opposite: decremental powers of ten starting with 10^{1}, 10^{2}, 10^{3}, and so on.
We can use the same pattern for any radix we choose. Let's take a look at base two, which is more commonly called binary. To express a number in binary, we let the first place to the left of the point (technically it's not a decimal point since we're using binary) represent 2^{0}. To the left of that is 2^{1}, 2^{2}, 2^{3}, etc. To the right of the point is 2^{1}, 2^{2}, 2^{3}, and so forth.
Let's look at a number written in binary. The diagram at right depicts the binary number 110100.101 with the powers of two written beneath it. From the diagram, we see that this number can be broken down as:
(1×2^{5}) + (1×2^{4}) + (0×2^{3}) + (1×2^{2}) + (0×2^{1}) + (0×2^{0}) + (1×2^{1}) + (0×2^{2}) + (1×2^{3}).
Let's see what that would be in decimal:
(1×2^{5}) + (1×2^{4}) + (0×2^{3}) + (1×2^{2}) + (0×2^{1}) + (0×2^{0}) + (1×2^{1}) + (0×2^{2}) + (1×2^{3})
= 2^{5} + 2^{4} + 0 + 2^{2} + 0 + 0 + 2^{1} + 0 + 2^{3}
= (2×2×2×2×2) + (2×2×2×2) + (2×2) + (½) + (½×½×½)
= 32 + 16 + 4 + 0.5 + 0.125
= 52.625
So, 110100.101 in binary is equal to 52.625 in decimal.
Number of Digits
Notice in the example above that the binary number uses only ones and zeros. This is true of all binary numbers and brings up another important point. The number of digits required for a given radix is equal to that radix. For example, binary, which has a radix of two, requires only two digits (0 and 1) to represent a number. Decimal, which has a radix of ten, requires ten digits (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9). Octal, which is base eight, requires eight digits (0, 1, 2, 3, 4, 5, 6, and 7).
Denoting Base
Now that we have discussed so many different bases, we need to be sure to indicate which one we are using when we write a number. It is customary to write the radix (expressed in base ten) as a subscript after the number. For example, the decimal number 79 would be written as 79_{10} to indicate that it is base ten. The binary number 1101 would be written as 1101_{2} to indicate that it is base two. The octal number 3673 would be written as 3673_{8} to indicate that it is base eight. Decimal is usually the assumed base if no subscript is given.
Pronunciation
When pronouncing a number in a base other than decimal, it is important to avoid confusion. For that reason, it is considered improper to pronounce a number such as 10_{2} as "ten" because that word refers to 10_{10}. It is better form to enunciate the digits. For example, pronounce 10_{2} as "one zero". Instead of pronouncing 120_{3} as "onehundred twenty", say "one two zero".


Hexadecimal
Hexadecimal is base sixteen and is often called hex for short. With a radix of sixteen, hex obviously needs sixteen digits, but there are only ten Arabic numerals. How do we make up the difference? Conventionally, hex uses the first six letters of the alphabet in addition to our ten numerical digits, which gives us 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. Look at the chart to the right to see a comparison between the hex digits A through F and their decimal equivalents.
Hex works just like any other base. The first place to the left of the point represents 16^{0}. Then comes 16^{1}, 16^{2}, 16^{3} and so on. To the right of the point is 16^{1}, 16^{2}, 16^{3}, and so on. Let's look at a diagram of a hex number (4A37CF.01E_{16}) to understand hexadecimal representation.
Using the comparison chart above to substitute for the hex digits, you should see that the number at left yields a decimal equivalent of: (4×16^{5}) + (10×16^{4}) + (3×16^{3}) + (7×16^{2}) + (12×16^{1}) + (15×16^{0}) + (0×16^{1}) + (1×16^{2}) + (14×16^{3})
which equals 4863951.00732421875_{10} to be exact.
By now you should understand what hexadecimal is and how it works. Don't worry if you can't immediately count in hex or multiply hex numbers in your head. At this point, it is only important that you see how different bases work and how they relate to each other.


