The Hexadecimal Number System

 
 
 

Hexadecimal Number System (Base-16)
The hexadecimal number system uses SIXTEEN values to represent numbers. The values are,
                                     0 1 2 3 4 5 6 7 8 9 A B C D E F
  with 0 having the least value and F having the greatest value. Columns are used in the same way as in the decimal system, in that the left most column is used to represent the greatest value.  As we have seen in the decimal system, the values in the set (0 and 1) repeat, in both the vertical and horizontal directions.
                                0 - F, 10 -1F, 20 - 2F, 30 - 3F ......
        Hexadecimal is often used to represent values (numbers and memory addresses) in computer systems.
 

Decimal Binary Hexadecimal
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
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F


Converting hexadecimal to decimal
Problem: Convert 176 in hexadecimal to decimal.
Each column represents a power of 16,

164 becomes
4 * 160 = 4
6 * 161 = 96
1 * 162 = 256
adding together gives 356

Converting binary to hexadecimal
Problem: Convert 110110 to hexadecimal.
Each hexadecimal digit represents 4 binary bits. Split the binary number into groups of 4 bits, starting from the right.
11   0110
=3   =6
=36 in hexadecimal

Converting decimal to hexadecimal
Problem: Convert 232 decimal to hexadecimal.
Use the same method used earlier to divide decimal to
binary, but divide by 16.
232 / 16 = 14 with a remainder of 8
14 / 16 = 0 with a remainder of E (14 decimal = E)
then answer is E816
Notice the suffix added to indicate the number base
 

   
                   
     
                   
 

.      .

 
 

Copyright pc-control.co.uk 2008