Hexadecimal
Like Binary, Hexadecimal is a number system. It was created because binary is not particularly friendly to use.
Programmers need to be able to identify and refer to specific places in the computer memory. The computer knows them by their 8 numeral binary address . Hexadecimal allows programmers to use just two numerals .
Once you are used to working with it, Hexadecimal (Hex) can be read as easily as Denary, and you can convert between Binary and Hex quickly and easily.
Hex has 16 numerals:
As well as having different numerals that include A,B, C etc. It has different place values too.
Place value | 1,000 10^3 | 100 10^2 | 10 10^1 | 1 10^0 |
Numerals | 3 | 4 | 1 | 9 |
(3*1000)+ (4*100) + (1*10) + (9*1)
Place value | 4096 (16^3) | 256 (16^2) | 16 (16^1) | 1 (16^0) |
Numerals | 1 | 1 | 4 | A |
(1*4096)+(1*256)+(4*16)+(10*1). Remember A is 10
- Denary has place values of 1, 10, 100, 1000
- These are powers of 10.
- This number is 3419
- Hex has place values of 1, 16, 256, 4096
- These are powers of 16.
- This number is 4426 (Den)
To convert from Hexadecimal to Denary
Step | Outcome | Explanation / Notes | ||
1) Write down the Hex place values | 256 | 16 | 1 | |
2) Write the Hex value into the columns | 4 | A | 7 | |
3) Convert any Letters to their number equivalent | 4 | 10 | 7 | A is 10 |
4) Write down the sums to multiply each numeral by its place value | 4 * 256 10 * 16 7 * 1 | |||
5) Calculate the sums | 1024 160 7 | 4*256 =1024 10 * 16 = 160 7 * 1 = 7 | ||
6) Add up the your answers to get final answer | 1191 | 1024 + 160 +7 = 1191 |
To convert from Denary to Hexadecimal
Step | Outcome | Explanation / Notes |
1) Take the Denary number | 171 | |
2) Divide it by 16 (it helps to know your 16 times table here) | 10 r 11 | 171/16 = 10 remainder 11 |
3) Write down the remainder as its Hex equivalent | B | The remainder is 11 11 in Hex is B |
4) Take the quotient - the main part (the 10), If it is less than 16:
| A | 10 is less than 16 10 is A in Hex |
5) Final answer | AB |