A number base is a specific collection of numbers on which a number system can be built. Following are different number bases used.
List of Number Bases
Base 2: The Binary Number System
Base 2 has exactly two numbers, 0 and 1. All numbers in the binary number system must be formed using these two symbols. Numbers in the binary system become long quickly.
Base 8: The Octal Number System
The Octal number system uses exactly eight numbers: 0,1,2,3,4,5,6 and 7 . Base 8 is a convenient shorthand for base 2 numbers because 8 is the power of 2:23 = 8. One Octal digit is the equivalent of exactly three binary digits. The use of Octal (or Hexadecimal) as a shorthand for binary is common in the printed output of main storage and, in some cases in programming.
Base 10: The Decimal Number system
The number base familiar to us is base 10, upon which the decimal number system is built. There are 10 numbers (0 through 9) used in the decimal number system. We normally use base 10, which is the number system most of us can understand and use easily.
Base 16: The Hexadecimal Number system
The Hexadecimal number system uses exactly 16 numbers. Base 10 uses the familiar 0 through 9, and bases 2 and 8 use a subset of these numbers. Base 16, however, needs those 10 numbers (0 through 9) and six more. The six additional numbers used in the Hexadecimal number system are represented by letters A through F. So the base 16 numbers are 0,1,2,3,4,5,6,7,8,9, A B,C,D,E and F. It takes some adjusting to think of A or D as a digit instead of a letter. It also takes little time to become accustomed to numbers such as 6A2F or even ACE. Both of these examples are valid numbers in Hexadecimal.
Conversion between number bases
The following four steps are used to convert a number from base 10 to a new base.
- Divide the decimal number to be converted by the value of the new base.
- Record the remainder from Step 1 as the rightmost digit.
- Divide the quotient of the previous by the new base.
- Record the remainder from Step 3 as the next digit (to the left) of the new base number.
- Bottom to top sequence of remainder will be the required converted number. Repeat Step 3 and 4, recording remainders from right to left, until the quotient becomes less than the digit of new base so that it cannot be divided.