Number and Number Systems
A number system is a way to represent numbers.
Ten is an important number for us humans. Most of us have ten of fingers and toes, and we certainly prefer to have all ten of each. Because the fingers are convenient for counting, people started using their fingers to count from 1 to 10. It is decimal system, which is also called base10 number system. Even if a lot of number systems are in base 10, human did not always count in base 10 and we are still using other numeral bases. Here are few examples:
 Base60 counting system is still used today with this "60 seconds in a minute; 60 minutes in a hour".
 Base24 system is used for counting 24 hours to be one day.
 Base12 system is used for counting one dozen.
Figure 1: Ten fingers on two hands, the possible starting point of the decimal counting
If humans had 6 fingers on their hands, would we be using the Senary system (also known as heximal or Seximal) of numbers?
In a digital system, each digit (bit, wire) has only two possible values: 0 or 1. It is called Binary, or base2 number system. If there is a longer binary number, for example: (101110100101)_{binary}, it is not suitable for humans to remember it, and it is easily confused. One good way reducing the length of binary number is grouping consecutive binary digits into groups of other number system. Therefore, we are using Octal (a base8 number system) and Hexadecimal (a base16 number system) to represent a binary number in the digital system.
In mathematics, a 「base」 or a 「radix」 is the number of different digits or combination of digits and letters that a system of counting uses to represent numbers. ~Wiki~
Decimal
Characteristics of the decimal number system are as follows:
 Also called denary
 Base10
 Uses decimal digits: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
 Positional System — position gives power of the base
 Example:
3845.2 = (3 x 10^{3}) + (8 x 10^{2}) + (4 x 10^{1}) + (5 x 10^{0}) + (2 x 10^{1})
 Positions: …5 4 3 2 1 0 . 1 2 3 …
The base10 system is a Positional Number System. it means each digit has s different value according to its positions. For example: 255 is (2 x 100) + (5 x 10) + (5 x 1). There are a lot of other numeral systems which does not work that way. One of most famous is Roman numerals, which is not really a positional system. In the Roman number system,The X stands for 10, the V stands for 5, and the I is a one. Twentyseven in Roman numerals is XXVII ; it is 10 + 10 + 5 + 1 + 1 = 27 in decimal.
Binary
In a computer, all the information are stored using digital signals that translate to binary numbers. A single bit can represent two possible state: on (1) or off (0).
Characteristics of the binary number system are as follows:
 Base2
 Digits: {0, 1}
 Binary Digits are called bits
 Positional system
 Example:
1101.1_{2} = (1 x 2^{3}) + (1 x 2^{2}) + (0 x 2^{1}) + (1 x 2^{0}) + (1 x 2^{1})
Octal
Characteristics of the binary number system are as follows:
 Base8
 Digits: {0, 1, 2, 3, 4, 5, 6, 7}
 Group of 3 binary digits can be used to represent each octal digit
 Positional system
 Example:
357_{8} = (3 x 8^{2}) + (5 x 8^{1}) + (7 x 8^{0})
Hexadecimal
Characteristics of the hexadecimal number system are as follows:
 Base16
 Digits: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}
 Groups of 4 bits represent each base 16 digit
 Positional system
 Example:
1F4_{16} = (1 x 16^{2}) + (F x 16^{1}) + (4 x 16^{0})
Table1: Decimal, Binary, Octal and Hexadecimal
Decimal 
Binary 
Octal 
Hexadecimal 
0 
0 
0 
0 
1 
1 
1 
1 
2 
10 
2 
2 
3 
11 
3 
3 
4 
100 
4 
4 
5 
101 
5 
5 
6 
110 
6 
6 
7 
111 
7 
7 
8 
1000 
10 
8 
9 
1001 
11 
9 
10 
1010 
12 
A 
11 
1011 
13 
B 
12 
1100 
14 
C 
13 
1101 
15 
D 
14 
1110 
16 
E 
15 
1111 
17 
F 
16 
10000 
20 
10 
Conversions between Different Number Systems
Humans want to see and enter number in decimal, but computers must store and compute with bits. Therefore, we need to know how to convert a number into different number systems.
Baser Numbers to Decimal
To convert any baser number to decimal:
 Expand baser number using positional scheme
 Perform computation using decimal arithmetic
Baser system to decimal system:
 Determine the positional value of each digit (this depends on the position of the digit and the base of the number system)
 Multiply the obtained positional values (in step 1) by the digits in the corresponding positions.
 Sum the products calculate in Step 2. The total is the equivalent value in decimal.
Ex1: Binary to Decimal
Convert (1101.01)_{2} to decimal.


2^{3} 
2^{2} 
2^{1} 
2^{0} 

2^{1} 
2^{2} 
Position 

3 
2 
1 
0 

1 
2 
(1101.01)_{2} 
= 
1 
1 
0 
1 
. 
0 
1 
(1101.01)_{2} = (1 x 2^{3}) + (1 x 2^{2}) + (0 x 2^{1}) + (1 x 2^{0}) + (0 x 2^{1}) + (1 x 2^{2}) = (13.25)_{10}
Ex2: Octal to Decimal
Convert (432.2)_{8} to decimal.


8^{2} 
8^{1} 
8^{0} 

8^{1} 
Position 

2 
1 
0 

1 
(432.2)_{8} 
= 
4 
3 
2 
. 
2 
(432.2)_{8} = (4 x 8^{2}) + (3 x 8^{1}) + (2 x 8^{0}) + (2 x 8^{1}) = (282.25)_{10}
Ex3: Hexadecimal to Decimal
Convert (B65F)_{16} to decimal.


16^{3} 
16^{2} 
16^{1} 
16^{0} 
Position 

3 
2 
1 
0 
(B65F)_{16} 
= 
B 
6 
5 
F 
(B65F)_{16} = (11 x 16^{3}) + (6 x 16^{2}) + (5 x 16^{1}) + (15 x 16^{0}) = (46,687)_{10}
Ex4: Base5 to Decimal
Convert (142.2)_{5} to decimal.


5^{2} 
5^{1} 
5^{0} 

5^{1} 
Position 

2 
1 
0 

1 
(142.2)_{5} 
= 
1 
4 
2 
. 
2 
(142.2)_{5} = (1 x 5^{2}) + (4 x 5^{1}) + (2 x 5^{0}) + (2 x 5^{1}) = (47.4)_{10}
Decimals to Baser Number
Use Radix Divide Method
The equation for decimal to baser number:
Integral Part
 Divide (integral part) by the base r number:
 Take the remainder as a coefficient
 Take the quotient and repeat the division, until the quotient is equal to zero
Fractional Part
 Multiply the number by the base r number
 Take the integer (either 0 or 1) as a coefficient
 Take the resultant fraction and repeat the multiplication
Ex1: (315.312510)_{10} to Octal
Converting Integral Number
Converting Fractional Number
∴ (315.3125)_{10} = (437.24)_{8}
Binary ↔ Octal
 8 = 2^{3}
 Each group of 3 digits in binary represents an Octal digit
Binary to Octal Conversion
 Divide the binary digits into groups of 3 (starting from position 0)
 Convert each group of 3 binary digits to one octal digit.
Example: (10110.01)_{2} to Octal
Octal to Binary Conversion
 Convert each octal digit to a 3 digit binary number (the octal digits my be treated as decimal for this conversion).
 Combine all the resulting binary groups (of 3 digits each) into a single binary number.
Example: (25)_{8} to Binary
Octal 
Binary 
0 
000 
1 
001 
2 
010 
3 
011 
4 
100 
5 
101 
6 
110 
7 
111 
Binary ↔ Hex
 16 = 2^{4}
 Each group of 4 binary bits represents an Hexadecimal digit
Binary to Hexadecimal
 Divide the binary digits into groups of 4 (starting from the position 0)
 Convert each group of 4 binary digits to one hexadecimal symbol.
Example: (11010.01)_{2} to Hex
Hexadecimal to Binary
 Convert each hexadecimal digit to a 4 digit binary number (the hexadecimal digits may be treated as decimal for this conversion)
 Combine all the resulting binary group (of 4 digits each) into a single binary number
Example: (15)_{16} to Binary
Hex 
Binary 
Decimal 
0 
0000 
0 
1 
0001 
1 
2 
0010 
2 
3 
0011 
3 
4 
0100 
4 
5 
0101 
5 
6 
0110 
6 
7 
0111 
7 
8 
1000 
8 
9 
1001 
9 
A 
1010 
10 
B 
1011 
11 
C 
1100 
12 
D 
1101 
13 
E 
1110 
14 
F 
1111 
15 
Octal ↔ Hex
Convert to Binary as an intermediate step
Example: (26.2)_{8} to Hex
Works both ways (Octal to Hex & Hex to Octal)
Basically, the number systems can be cataloged into two groups: decimal and binary systems.
Figure 1: Number Systems
We can easily convert numbers between decimal and binary systems. If you need to convert a BCD number to another system, such as octal, the best solution is to convert the BCD number it to decimal first, then convert to binary, and finally to octal number.
Common Powers
Most of common powers of base10 and base2 number system are shown as follows:
Base 10:
Power 
Preface 
Symbol 
Value 
10^{12} 
pico 
p 
0.000000000001 
10^{9} 
nano 
n 
0.000000001 
10^{6} 
micro 
µ 
0.000001 
10^{3} 
milli 
m 
0.001 
10^{3} 
kilo 
K 
1,000 
10^{6} 
mega 
M 
1,000,000 
10^{9} 
giga 
G 
1,000,000,000 
10^{12} 
tera 
T 
1,000,000,000,000 
Base 2:
Power 
Preface 
Symbol 
Value 
2^{10} 
kilo 
K 
1,024 
2^{20} 
mega 
M 
1,048,576 
2^{30} 
giga 
G 
1,073,741,824 
2^{40} 
tera 
T 
1,099,511,627,776 
2^{50} 
peta 
P 

2^{60} 
exa 
E 

2^{70} 
zetta 
Z 

2^{80} 
yotta 
Y 

Negative Number in Binary