Hexadecimal to Decimal (and vice versa)

T

Toria

Hello,

I know the formulas of HEX2DEC and DEC2HEX. I think my problem is not
really knowing about the math.

I received a hex and dec version of a device version:
Hex: 368847DD
Dec: 5408931293

When I do the above formulas in Excel, the result is different. If I take
the Hex version, 368847DD, and do HEX2DEC, I get 914900957 when it should be
5408931293.

If I take the Dec version, 5408931293, and do DEC2HEX, I get 14265BDDD when
it should be 368847DD.

I feel like I'm missing something very obvious but can't figure it out.
Help is much appreciated!
 
M

Mike H

Hi,

I think you'll have to explain why you think Excel is getting it wrong
beccause I prefer the Excel answer to yours.

368847dd = 914900957 and not 5408931293

Mike
 
D

David Biddulph

You'll have to explain why you think that those numbers are incorrect, and
how you get your alternative figures.

The values which HEX2DEC and DEC2HEX give agree with what the Microsoft
calculator's conversions give, and you can also check by converting each
digit at a time and adding up the values of the digits.

Taking just part of the problem, you've got hex 368847DD. Well, hex
30000000 is 3 * 16^7, which is 805306368, so it wouldn't make sense to get
5408931293 for the whole number 368847DD.
If you want to add up the total
368847DD comes to
3 * 16^7 +
6 * 16^6 +
8 * 16^5 +
8 * 16^4 +
4 * 16^3 +
7 * 16^2 +
13 * 16^1 +
13 * 16^0
hence the total of 914900957
 
T

Toria

Thanks to all four of you for your responses! That was the confirmation I
needed. A customer stated that the numbers were incorrect. Clearly, that's
not the case.

David, thank you also for typing out the conversion. This helps me a lot!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top