Hexadecimal Numbers |
Navigation |
|
|
Hexadecimal Numbers
The one main disadvantage of Binary Numbers is that the binary equivalent of a large decimal
number can be quite long, which makes it difficult to both read or write without producing errors especially when working
with 16 or 32-bit numbers. One common way of overcoming this problem is to arrange the binary numbers into groups of four
as a Hexadecimal Number, starting with the least significant digit at the right hand side. This Hexadecimal or
simply "Hex" numbering system uses the Base-16 system with a combination of numbers and letters to represent
its Binary or Decimal equivalent.
For example: the following group of numbers
1101 0101 1100 11112
are much easier to read and understand than 11010101110011112 when all grouped together.
By dividing a binary number up into groups of 4 bits, each group or set of 4 digits can now have a
possible value of between "0000" (0) and "1111" (8+4+2+1 = 15) giving
a total of 16 different number combinations from 0 to 15, this system is commonly called Hexadecimal, and now
q = "16".
The numbers 0 to 9 are still used as in the original
decimal system, but the numbers from 10 to 15 are now represented by letters of the alphabet from A
to F inclusive and an example of this Hexadecimal system is given below.
Hexadecimal Numbering System
| Decimal |
4-bit 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 |
| 16 | 0001 0000 | 10 (1+0) |
| 17 | 0001 0001 | 11 (1+1) |
| Continuing upwards in groups of four |
Using the original binary number from above 1101 0101 1100 11112
this can now be converted into an equivalent hexadecimal number of D5CF16
which is much easier to read and understand than a long row of 1īs and 0īs. Similarly, converting Hex based numbers back
into binary is simply the reverse operation.
Then the main characteristics of a Hexadecimal Numbering System is that there are 16
distinct counting digits from 0 to F with each digit having a weight
or value of 16 starting from the least significant bit (LSB). In order to distinguish Hexadecimal numbers from Denary
numbers, a prefix of either a "#", (Hash) or a "$" (Dollar sign) is
used before the actual Hexadecimal value.
Example No1.
Convert the following Binary number 111010102 into its Hexadecimal
number equivalent.
| 111010102 | |
Group the bits into fours starting from the right hand side
|
= |
1110 |
1010 |
|
= |
E |
A |
|
Then, the hexadecimal equivalent of the binary number
111010102 is #EA16 |
Example No2.
Convert the following Hexadecimal number #3FA716
into its Binary equivalent, and also into its Decimal or Denary equivalent.
| #3FA716 | |
| | = 0011 1111 1010 01112 |
| | = (8192 + 4096 + 2048 + 1024 + 512 + 256 + 128 + 32 + 4 + 2 + 1) |
| | = 16,29510 |
Then, the Decimal number of 16,295 can be represented as:-
#3FA716 in Hexadecimal
or
0011 1111 1010 01112 in Binary.
|