How do you convert a number from denary to hexadecimal?

The simplest route to take when converting any number from denary to another number system is to first convert it to binary. The method for binary conversion is to divide the number in question by 2 repeatedly, recording the remainder you get each time. Once you have a string of 1s and 0s, just reverse this and that's the number in binary!
For example, if you wanted to convert 57 (denary) to binary, these are the calculations you would take:
57/2 = 28 r 1
28/2 = 14 r 0
14/2 = 7 r 0
7/2 = 3 r 1
3/2 = 1 r 1
1/2 = 0 r 1
The string of 1s and 0s reads as 100111 from top to bottom, which reversed is 111001 - this is 57 in binary!
The final step of going from binary to hexadecimal is very straight forward. From right to left, separate your binary figure into blocks of four digits, adding 0s to the left-hand side if there is not a complete block. Next just treat these blocks as individual values and cross-reference those with the hexadecimal characters. This will give you the hexadecimal value!
Returning to our example, this is what we would do:
111001 would become 00111001 (so the amount of digits is a multiple of four).
This would then be separated to 0011 1001 (two blocks of four digits).
0011 equates to 3 (the 3rd character in the hex number system) and 1001 equates to 9 (the 9th character in the number system).
57 in hexadecimal is therefore 39!
Remember that the characters in hexadecimal are 0123456789ABCDEF, so there is a possibility there are letters in your answer!

Answered by Josh C. Computing tutor

33427 Views

See similar Computing GCSE tutors

Related Computing GCSE answers

All answers ▸

James would like to store a video clip that is 20 frames per second and has a duration of 76 seconds. The resolution of this video is 1280x720 with a colour depth of 24 bits. Calculate the storage requirement for the uncompressed video clip.


What is SQL? I know it's a 'query' language, but what does that mean?


Explain what is meant by "volatile" and "non-volatility" memory, their uses, and the difference between them


In terms of programming software, what is a translator? Describe the differences between the following three translators: assembler, compiler, interpreter.


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy