Number System
A number system defines a set of values used to represent quantity. You may regard each digit as a box that can hold a number. In the binary
system, there can be only two choices for this number  either a
"0" or a "1". In the octal system, there can be
eight possibilities:
"0", "1", "2", "3",
"4", "5", "6", "7".
In the decimal system, there are ten different numbers that can enter
the digit box:
"0", "1", "2", "3",
"4", "5", "6", "7",
"8", "9".
In the hexadecimal system, we allow 16 numbers:
"0", "1", "2", "3",
"4", "5", "6", "7",
"8", "9", "A", "B",
"C", "D", "E", and "F".
As demonstrated by the following table, there is a direct correspondence
between the binary system and the Hexa system, with four binary digits
translate directly into one hexadecimal digit. In computer usage,
hexadecimal notation is especially common because it easily replaces the
binary notation, which is too long and human mistakes in transcribing
the binary numbers are too easily made.
Base Conversion Table
BIN HEX DEC

0000 0 0
0001 1 1
0010 2 2
0011 3 3
0100 4 4
0101 5 5
0110 6 6
0111 7 7

1000 8 8
1001 9 9
1010 A 10
1011 B 11
1100 C 12
1101 D 13
1110 E 14
1111 F 15
Let's think more carefully what a decimal number means. For example,
1234 means that there are four boxes (digits); and there are 4 one's in
the rightmost box (least significant digit), 3 ten's in the next box, 2
hundred's in the next box, and finally 1 thousand's in the leftmost box
(most significant digit). The total is 1234:
Original Number: 1 2 3 4
   
How Many Tokens: 1 2 3 4
Digit/Token Value: 1000 100 10 1
Value: 1000 + 200 + 30 + 4 = 1234
or simply, 1*1000 + 2*100 + 3*10 + 4*1 = 1234
Thus, each digit has a value: 10^^{0}=1 for the least
significant digit, increasing to 10^^{1}=10, 10^^{2}=100,
10^^{3}=1000, and so forth.
Likewise, the least significant digit in a hexadecimal number has a
value of 16^^{0}=1 for the least significant digit, increasing
to 16^^{1}=16 for the next digit, 16^^{2}=256 for the
next, 16^^{3}=4096 for the next, and so forth. Thus, 1234 means
that there are four boxes (digits); and there are 4 one's in the
rightmost box (least significant digit), 3 sixteen's in the next box, 2
256's in the next, and 1 4096's in the leftmost box (most significant
digit). The total is:
1*4096 + 2*256 + 3*16 + 4*1 = 4660
Example. Convert the hexadecimal number 4B3 to decimal
notation.
Solution:
Original Number : 4 B 3
  
How Many Tokens : 4 11 3
Digit/Token Value: 256 16 1
Value: 1024 +176 + 3 = 1203
Another way is to think of a cash register with different slots, each
holding bills of a different denomination
Again, let's think about what you do to obtain each digit. As an
example, let's start with a decimal number 1234 and convert it to
decimal notation. To extract the last digit, you move the decimal point
left by one digit, which means that you divide the given number by its
base 10.
1234/10 = 123 + 4/10
The remainder of 4 is the last digit. To extract the next last digit,
you again move the decimal point left by one digit and see what drops
out.
123/10 = 12 + 3/10
The remainder of 3 is the next last digit. You repeat this process until
there is nothing left. Then you stop. In summary, you do the following:
Quotient Remainder

1234/10 = 123 4 +
123/10 = 12 3 + 
12/10 = 1 2 +  
1/10 = 0 1 +    (Stop when the quotient is 0)
   
1 2 3 4 (Base 10)
Now, let's try a nontrivial example. Let's express a decimal number 1341
in binary notation. Note that the desired base is 2, so we repeatedly
divide the given decimal number by 2.
Quotient Remainder

1341/2 = 670 1 +
670/2 = 335 0 + 
335/2 = 167 1 +  
167/2 = 83 1 +   
83/2 = 41 1 +    
41/2 = 20 1 +     
20/2 = 10 0 +      
10/2 = 5 0 +       
5/2 = 2 1 +        
2/2 = 1 0 +         
1/2 = 0 1 +           (Stop when the
           quotient is 0)
1 0 1 0 0 1 1 1 1 0 1 (BIN; Base 2)
Let's express the same decimal number 1341 in hexadecimal notation.
Quotient Remainder

1341/16 = 83 13 +
83/16 = 5 3 + 
5/16 = 0 5 +   (Stop when the quotient is 0)
  
5 3 D (HEX; Base 16)
Example. Convert the decimal number 3315 to hexadecimal
notation.
Solution:
Quotient Remainder

3315/16 = 207 3 +
207/16 = 12 15 + 
12/16 = 0 12 +   (Stop when the quotient is 0)
  
C F 3 (HEX; Base 16)
Thus, 3315 (DEC) > CF3 (HEX)
Note that from the Base Conversion Table, you can easily get the
binary notation from the hexadecimal number by grouping four binary
digits per hexadecimal digit, or from or the octal number by grouping
three binary digits per octal digit, and vice versa.
HEX 5 3 D
BIN 0101 0011 1101
OCT 2 4 7 5
BIN 010 100 111 101
