Converting 2000.90210 to IEEE 754 Hexadecimal

  • Thread starter Thread starter s3a
  • Start date Start date
  • Tags Tags
    hexadecimal Ieee
Click For Summary

Discussion Overview

The discussion revolves around the conversion of the decimal number 2000.90210 to its single-precision IEEE 754 hexadecimal representation. Participants explore the steps involved in this conversion process, including the handling of binary fractions and the implications of rounding errors.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses uncertainty about their binary conversion being "far off" from the expected decimal value, suggesting a potential issue with the irrational nature of the binary fraction field.
  • Another participant clarifies that the rationality or irrationality of a number is independent of its base representation and that finite representations in base 2 can lead to small rounding errors.
  • A participant reports that their binary IEEE 754 output results in a decimal representation around 4001.80, questioning whether the issue lies with their calculations or the Java applet used for conversion.
  • There is a discussion about the exponent field calculation, with one participant pointing out a potential misunderstanding in the equation used for determining the exponent field.
  • Another participant confirms the correct equation for the exponent field and suggests that the discrepancy in results may be due to an error in the exponent calculation.
  • Several participants acknowledge the contributions of others in identifying and correcting errors in the conversion process.

Areas of Agreement / Disagreement

Participants express differing views on the accuracy of the binary conversion and the source of discrepancies in results. While some participants agree on the nature of rounding errors, the discussion remains unresolved regarding the exact cause of the output differences.

Contextual Notes

Participants note that the conversion process may involve assumptions about the representation of numbers in binary and the handling of rounding errors, which are not fully resolved in the discussion.

s3a
Messages
828
Reaction score
8

Homework Statement


Convert the decimal number 2000.90210 to a single-precision IEEE 754 hexadecimal.

Homework Equations


(exponent field)_10 - 127_10 = exponent_10
The first bit is the sign bit.
The 2nd to 9th bits are the exponent bits.
The 10th to 32nd bits are the fraction field bits.
1.(fraction field)_2 x 2^(exponent_10) leads to the base 10 final answer

The Attempt at a Solution


My attempt at the solution is attached as MyWork.jpg.

I was planning to convert it to the binary IEEE 754 32-bit single-precision representation since that's what I am familiar with and then convert it to hexadecimal however, it seems that when I do this, my binary version is far off from the decimal value I'm initially given.

I'm not sure but, this might be related to the fact that the binary fraction field is (at least, seemingly) irrational.

Any help in solving this problem would be greatly appreciated!
 

Attachments

  • MyWork.jpg
    MyWork.jpg
    29.1 KB · Views: 2,019
Physics news on Phys.org


s3a said:
I'm not sure but, this might be related to the fact that the binary fraction field is (at least, seemingly) irrational.
Rational <-> irrational is independent of the base you express a number in. There is no exact representation of the number with a finite number in base 2, but that does not matter. It just gives a small rounding error.

my binary version is far off from the decimal value I'm initially given.
In which way?
Your attempt looks fine.
 


Hello.

Rational <-> irrational is independent of the base you express a number in. There is no exact representation of the number with a finite number in base 2, but that does not matter. It just gives a small rounding error.
Alright.

In which way?
Your attempt looks fine.
When I input my binary IEEE 754 answer to this ( http://www.h-schmidt.net/FloatConverter/IEEE754.html ) website, the decimal representation is around 4001.80. If it's not my work that's wrong, what's wrong with the Java applet software or with the way I am “communicating” with it?
 


s3a said:
(exponent field)_10 - 127_10 = exponent_10
so this means
(exponent field)_10 = exponent_10 + 127_10

if exponent_10 is 127, then what should (exponent field)_10 be?
 


so this means
(exponent field)_10 = exponent_10 + 127_10

if exponent_10 is 127, then what should (exponent field)_10 be?
The equation is (exponent field)_10 = exponent_10 – 127_10. (Notice the – instead of a +.) I did do that in my work, however. So, why is the Java applet software disagreeing strongly with me?
 


From your first post:

s3a said:
(exponent field)_10 - 127_10 = exponent_10

start with the equation from your first post:

(exponent field)_10 - 127_10 = exponent_10

then add 127_10 to both sides:

(exponent field)_10 = exponent_10 + 127_10
 


s3a said:
When I input my binary IEEE 754 answer to this ( http://www.h-schmidt.net/FloatConverter/IEEE754.html ) website, the decimal representation is around 4001.80. If it's not my work that's wrong, what's wrong with the Java applet software or with the way I am “communicating” with it?
I would not call this "far off", it is exactly a factor of 2, indicating a problem with the exponent. rcgldr found the error.
 


Good point, mfb. I just noticed that.

And, rcgldr, that was just what I needed to fix my entire answer to the problem.

Thank you both!
 


Good point, mfb. I just noticed that.

And, rcgldr, that was just what I needed to fix my entire answer to the problem.

Thank you both!
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
Replies
6
Views
10K
Replies
16
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
10
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
5
Views
2K
  • · Replies 13 ·
Replies
13
Views
5K