Home |
Base Ten |
Binary |
Finger Counter |
Decimal to Binary |
Binary to Hex
Converter |
Exercises |
Binary Tables |
Conversion Tables
Hexadecimal Numbers
Decimal is good for humans. Binary is good for machines. Half way between is the Base sixteen system also called "hexa-decimal".
(Hex means six, decimal means ten. Hexadecimal is six plus ten, i.e. sixteen.)
Hexadecimal would probably be our
counting system if we had eight digits on each hand, instead of five. Hexadecimal (also
called just "Hex") follows the same 'place' value system as all the others we have looked
at. Each place value is sixteen times the value to the right.
i.e. ... 65536 4096 256 16 1
A simpler way to write the place values is using the 'powers' ...
Remember ... any value to the power of zero is "1".
You can start to see the simple relationship between binary and Hex in the following ...
Hexadecimal is a bit strange if you have been brought up with five fingers on each hand instead of eight. It's advantage is the ease
with which you can move between binary numbers and numbers we can understand (with a bit of effort).
Hopefully you have realized that if we have sixteen 'places' we need more numerals.
Hexadecimal uses the letters
A,
B,
C,
D,
E and
F for the extra six numerals.
A typical counting sequence is:
1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20 ...
A = 10 decimal, B = 11 decimal, C = 12 decimal, D = 13 decimal, E = 14 decimal, F = 15 decimal.
This means 10Hex = 16 decimal.
A hexadecimal number is shown with an
0x in from to it. That lets us tell the difference between decimal and hexadecimal numbers.
Converting between Hexadecimal and Decimal
0x20 = 2 x 16 + 0 x 1 = 32 + 0 = 32 decimal
0x203 = 2 x 256 + 0 x 16 + 3 x 1 = 512 + 0 + 3 = 515 decimal
0x378 = 3 x 256 + 7 x 16 + 8 x 1 = 768 + 112 + 8 = 888 decimal
Click
HERE to go to a Javascript Decimal to Hex Converter
Converting between Hexadecimal and Binary
Each place in a Hex number represents 4 binary 'bits'. (4 bits is called a "quartet")
Consider 0x378
Hexadecimal |
3 |
7 |
8 |
Binary "quartet" |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
Decimal quartet |
8 |
4 |
2 |
1 |
8 |
4 |
2 |
1 |
8 |
4 |
2 |
1 |
Decimal - place |
2048 |
1024 |
512 |
256 |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
i.e.
0x378 = 001101111000 binary
= 0x2048 + 0x1024 + 1x512 + 1x256 + 0x128 + 1x64 + 1x32 + 1x16 + 1x8 + 0x4 + 0x2 + 0x1 decimal
= 512 + 256 + 64 + 32 + 16 + 8 = 888 decimal
The reason is is so easy to convert from Hexadecimal to binary is that each numeral in a Hex number translates into a simple binary "quartet".
All you need to do is focus on ONE Hex digit and convert it to 4-bit binary. You then add the quartets to make the full binary "word".
Consider 0x29B
Hexadecimal |
2 |
9 |
B (11 decimal) |
Binary "quartet" |
0 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
Decimal quartet |
8 |
4 |
2 |
1 |
8 |
4 |
2 |
1 |
8 |
4 |
2 |
1 |
Decimal - place |
2048 |
1024 |
512 |
256 |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
i.e.
0x29B = 001010011011 binary
Open the worksheet table above in MS Word format
HERE
Top