Why Is There a Difference When Converting Hexadecimal to Decimal?

Click For Summary

Discussion Overview

The discussion revolves around the conversion of a hexadecimal number (0xC4630000) to decimal, exploring the discrepancies encountered during the conversion process. Participants examine both direct conversion methods and binary intermediary steps, focusing on the potential sources of error in calculations.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents their initial conversion attempt from hexadecimal to decimal, yielding a result of 3294822400.
  • The same participant attempts to convert the hexadecimal number to binary and then back to decimal, resulting in a different value of 3294822399, leading to confusion about the discrepancy.
  • Another participant questions the accuracy of the calculations presented, specifically regarding the powers of 2 used in the binary conversion.
  • A later reply identifies a miscalculation in the binary conversion, specifically the value of 2^31, which was incorrectly noted as 2147483647 instead of 2147483648.
  • Participants discuss the importance of verifying calculator outputs, with one sharing a personal experience of relying on faulty calculations in the past.
  • Another participant points out that a power of 2 cannot end in an odd digit, suggesting that this should have been a clue to the error made in the calculations.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the initial conversion methods, as discrepancies remain unresolved. There is agreement on the identification of a specific error in the calculation of 2^31, but the broader discussion about conversion methods and potential errors continues without a definitive conclusion.

Contextual Notes

Participants express uncertainty about the reliability of their calculators and the implications of binary representation on decimal outcomes. The discussion highlights the need for careful verification of mathematical steps, particularly when transitioning between number systems.

znaya
Messages
18
Reaction score
0

Homework Statement


Convert 0xC4630000 to decimal.

Homework Equations



The Attempt at a Solution



First attempt:
0xC4630000

12(167) = 12(268435456) = 3221225472
4(166) = 4(16777216) = 67108864
6(165) = 6(1048576) = 6291456
3(164) = 3(65536) = 196608
0(163) = 0(4096) = 0
0(162) = 0(256) = 0
0(161) = 0(16) = 0
0(160) = 0(1) = 0

3221225472 + 67108864 + 6291456 + 196608 = 3294822400
Ok, google tells me this result is right. But then I tried to convert to binary and from binary to decimal.

Second attempt:

C = 1100
4 = 0100
6 = 0110
3 = 0011
0 = 0000
0 = 0000
0 = 0000
0 = 0000

So, 0xC4630000 = 1100 0100 0110 0011 0000 0000 0000 0000
231 + 230 + 226 + 222 + 221 + 217 + 216 =
= 2147483647 + 1073741824 + 67108864 + 4194304 + 2097152 + 131072 + 65536 = 3294822399

I can't understand why this is failing... Shouldn't the result be the same? Why is there a difference of 1?
Thanks in advance for any help.
 
Physics news on Phys.org
znaya said:
231 + 230 + 226 + 222 + 221 + 217 + 216 =
= 2147483647 + 1073741824 + 67108864 + 4194304 + 2097152 + 131072 + 65536

You sure about all these??
 
google says it's wrong!
OMG, just found the error! My calculator returns 231 = 2147483647
But google returns 231 = 2147483648.
The error is exactly there. The calculator miscalculates 231!
I repeated the sum hundreds of times but always using the same calculator...

Thanks.
 
znaya said:
The error is exactly there. The calculator miscalculates 231!

Its a mistake I made all the time, you can't just blindly accept what the calculator tells you. The clue in was you had an even binary number (LSB is 0) and you were getting an odd number. Then you see that one of your other powers is odd.
But hey at least you found out now. I found out one of my calculators had died and was giving wrong answers after my last exam one semester. I spoke to the prof later, cause he couldn't understand how I did all the steps right but kept getting wrong answers :) Luckily the partial points were enough to pass the test, and passing was all I needed for a decent mark!
 
:-) I can't believe the time I wasted on this... I was going crazy, already doubting of my skills...
Thanks again.
 
You should have noticed immediately that 2 to any power cannot end in "7"!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 2 ·
Replies
2
Views
13K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
7K
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K