- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: HP floating point format (HP 1000)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2010 03:26 AM - last edited on тАО03-15-2021 03:37 AM by Parvez_Admin
тАО05-11-2010 03:26 AM - last edited on тАО03-15-2021 03:37 AM by Parvez_Admin
Re: HP floating point format (HP 1000)
Dennis/everyone, again thanks for the inputs.
Using Steven's link
http://bitsavers.org/pdf/hp/1000/
I was able to find the "HP 1000 Computer Programming Reference Manual". This manual confirms the (32 bit) floating point data format that was given in my earlier linkhttp://www.hp.com/products1/rte/tech_support/files/guru98column.txt
[Admin : the above link is no longer valid]
Whilst the reference manual doesn't explicitly refer to a normalization bit it does state that the "Floating point numbers are considered normalized when the mantissa sign bit and adjacent bit are opposite in polarity". So the (32 bit) data structure given in these two links seems consistent.
However the manual does not explicitly state (for dummies like me) how to "treat" the bits. I had assumed something like,
decimal number
= 2**(exp*esign) * [b + (1-n)]*sign
where
exp = the exponent bits converted to decimal
esign = the sign of the exponent
n = normalisation bit (0 if normalized?)
b = binary number relating to fraction/mantissa
sign = sign of fraction
But so far this has not produced the desired conversion. To assist me, I fortunately (or unfortunately ... depending on whether it is a red-herring) have a 32 bit HP float binary on file for which I believe the decimal answer = 0.05
I have converted the 4 byte binary data to bits (using python and bitarray). I have used this approach (python/bitarray) before to check if I can read/decipher a standard IEEE 4 byte real, and succeeded, so I think python/bitarray is doing an adequate conversion from bytes to bits. The resulting bit pattern for the HP 1000 float which I believe should be a decimal of 0.05 is
bits = 01101000 11010110 01001110 11110101
bits = 00010110 01101011 01110010 10101111
One is big endian (the other little!). HP-UX is big endian but I am reading on windows so I cannot be entirely confident which of the above to use. So I am in the process of trial and error, hoping that the above bit pattern is indeed equal to a decimal of 0.05.
Of course the above bit pattern may be a red-herring (for which I apologies whole-heartedly in advance), but if someone fancies a challenge over their lunch break and manages to crack the pattern ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2010 04:31 AM
тАО05-11-2010 04:31 AM
Re: HP floating point format (HP 1000)
Please use "HP 1000 float" and not HP. There are probably N chauvinistic HP computers that just used just "HP" so don't fall into that trap.
>The resulting bit pattern for the HP 1000 float which I believe should be a decimal of 0.05 is
bits = 01101000 11010110 01001110 11110101
bits = 00010110 01101011 01110010 10101111
>One is big endian (the other little!).
No, that's not how scummy little endian works. Only the bytes are swapped, not the bits.
>hoping that the above bit pattern is indeed equal to a decimal of 0.05.
The pattern for .05 for IEEE is: 3d4ccccd
So you need to find a pattern of 11001100...
- Tags:
- little endian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2010 11:54 PM
тАО05-11-2010 11:54 PM
Re: HP floating point format (HP 1000)
float:
3d4ccccd 0.050000
S:0 E:-5 M:0x4ccccd
S:0 M:1.10011001100110011001101 E:0000101 1
double:
3fa999999999999a 0.050000
S:0 E:-5 M:0x999999999999a
S:0 M:1.1001100110011001100110011001100110011001100110011010 E:0000000101 1
Note: The last bit of the M field needs to be removed as not fitting in the HP1000 format.
So .05 appears to be:
0 1.1001100110011001100110 0000101 1
The M field may be twos complement to match the comment about "opposite in polarity".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2010 12:18 AM
тАО05-12-2010 12:18 AM
Re: HP floating point format (HP 1000)
I agree, I think I should be certainly looking for this 1100... pattern.
It seems I first need to check the bit pattern that I am producing with this bitarray tool.
Then I need to try and confirm 0.05 is indeed the decimal number represented by the 4 bytes. There is a tool on our HP-UX system called FCHI which actually does the conversion from HP 1000 float to IEEE for me. I believe FCHI is a black box routine provided by HP, but it should at least provide confirmation of the input data and final result.
If (and it's a big IF) I manage to write the conversion routine from HP 1000 float to IEEE, I will place the conversion routine (albeit in python) on the email thread in recognition of everyones' input and to save future bother for other unfortunates like me! But as I am writing these routines "after hours" it might still take a few weeks to resolve.
- « Previous
-
- 1
- 2
- Next »