How do you represent the (decimal) integer 50 in, oh, "hexadecimal," otherwise known as base-16? Recall that decimal is simply base-10, and binary is simply base-2.
32
(5b16 × 16^1) + (0b16 × 16^0)
\[(5_{16}+16^{1})+(0_{16}+16^{0})\]
\(\begin{array}{|r|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \text{Decimal:}&0&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15\\ \hline \text{Hex:}&0&1&2&3&4&5&6&7&8&9&A&B&C&D&E&F\\ \end{array} \) This means that the hex number 10 is 16, 11 is 17, and so on. 100 in hex is 256 in decimal. So, because this number is less than 256, the 3rd position is not needed. You can divide by 16 to convert things and use that chart to adapt as you go. \(\dfrac{50}{16}=3+\dfrac{2}{16}\) The 3 goes in the 16s position, or what you normally think of as the 10s position. The remaining 2, 16\(^{\text{ths}}\) are the 1s position. So 32. Lets take a number larger than 256 to show how this dividing by 16 can work for other numbers. 422 decimal. 422/16 = 26.15 = 26 and 6/16, so the final digit is 6. 26 is more than 16, so more work is needed. 26/16=1.625 = 1 and 10/16, so the next digit is A 1 is not divisiable by 16, so no more work is needed and 1 is the first digit: Therefore, 422 decimal = 1A6 in hex.
Join our real-time social learning platform and learn together with your friends!