How to convert hexadecimal to decimal
From binary to hexadecimal now, eh? Well, converting hexadecimal to decimal is quite different from converting binary to hexadecimal, yet is a bit similar.
First thing first, you need to memorize this:
1=1
2=2
3=3
4=4
5=5
6=6
7=7
8=8
9=9
A=10
B=11
c=12
D=13
E=14
F=15
This is the first fifteen numbers in hexadecimal. These will be important to know for converting hexadecimal into decimal and vice versa.
First: Hexadecimal into decimal
This is quite similar to binary in converting it into decimal, but instead of base-2, we're dealing with base-16. Therefore, we would have x(16^n). If you read the earlier one about conversion of binary, this formula is very reminiscent of the one found there. For newcomers:
x-the number that the hexadecimal stands for.
n: the distance from the last bit...
Similar to binary, hexadecimal also has a least significant bit of sorts, which is the last number or letter to be in the sequence. So for example:
FA0
The 0 would be the last bit. Now, remember that list at the beginning? This is where it comes into play. See, A will stand for 10 in the x in the equation above, since it is 1 from the least bit, therefore:
10*(16^1)=160
Then 15*(16^2)=3840
Add the two together: 3840+160=4000
Simple?
Now for decimal to hexadecimal
This is where things get a bit tricky. Instead of doing the number-16^(x), we are instead dividing by 16 and multiplying the decimal places by sixteen to gain the hexadecimal value. For example back to 4000 since we used it
4000/16, which equals 250. Since this technically equal 250.0, we would times sixteen by the .0, giving us zero, which would be the least significant bit. Then we divide 250 by 16, which would equal 15.625. Now, we times 0.625 by sixteen, giving us 10. Now ten on our chart equals A. Finally, we divide by 15, not 15.625 since we already used the .625 part and we get 0.9375 times this by 16 and you will get fifteen. (Yes, I realize the redundancy as I was typing this explaining it.) In any case, fifteen will be symbolize by F. So if we work from down to up from this sentence, we have FA0, which was what we begin with in the first place!
Don't you just love circular processes?
Any questions?


Karma:
Number Of Replies:
By:
•
• 