Decimal to Hexadecimal Conversion and Viceversa
MatrixLab Examples
To see an online base converter, go to: http://matrixlab-examples.com/base-conversion.html
1.- Decimal to hexadecimal conversion and vice versa.
2.- Any digit in a decimal number has a different weight. The weight is the power of its position in the number.
3a.- Different number systems have different number of symbols. Two for binary, eight for octal, ten for decimal
3b.- Base 16 or hexadecimal has 16 different symbols, from 0 to 9 and from A to F.
4.- The concept of weight can be applied to numbers in any other base. We can obtain the equivalent number in decimal base just by adding every digit multiplied by the base raised to the corresponding power.
5.- For numbers less than the unit, we have to consider negative powers.
6a.- To convert decimal numbers to hexadecimal ones, we are going to iterate divisions by 16. We are going to take the remainder for the result, and we are going to take the quotient for another division.
6b.- We are going to divide by the base until our quotient becomes less than the base. We have to include our last quotient and our last reminder for the final result in base 16.
7.- This is another example to convert decimals to hexadecimal numbers.
8a.- To convert decimal numbers that happen to be less than the unit, we are going to iterate multiplications by the base (in this case it's 16). The integer part of each result goes to our partial conversion and the fractional part goes to another multiplication.
8b.- The final conversion is an approximation only, even though we could make more multiplications to have better accuracy.
Thank you for watching.
3677895 Bytes