From: Mike Howard <mike@clove1.clove.com>
To: axp-list@redhat.com
Cc: clove1!mike@uunet.uu.net
Subject: Re: OFF-TOPIC: little-endian vs. big-endian conversion
Date: Mon, 06 Apr 1998 08:39:22 -0400 [thread overview]
Message-ID: <199804061239.IAA03820@clove.com> (raw)
In-Reply-To: Your message of "Fri, 03 Apr 1998 12:15:05 EST." <Pine.SOL.3.91.980403120737.15690D-100000@godzilla2.acpub.duke.edu>
You can spend a lot of time on a problem like this. If you have control of the source of the data
or access to a similarly configured SGI machine, your best approach is to reformat the data [or
have it done] in ASCII.
Things are probably more standard than they used to be - with most supporting IEEE floating point -
but in the old days, in trying to do this type of thing I had to contend with:
1's complement versus 2's complement machines
15, 16, and 18 bit half word sizes
16, 32, 36, & 64 bit word sizes
30, 32, 36, 60, 64, & 72 bit floating point sizes
plethora's of floating point formats
for example: a floating point word consists of a characteristic and a mantissa.
Generally, the mantissa is a 1 or 2's complement integer or an unsigned integer which represents a
number between 1 and the smallest representable fraction or zero.
The characteristic is the exponent of an implied base which can be 2, 8, 16, 256, 10, or whatever
bright number the designer has chosen. It is an N bit number which represents a range of exponent
values between the largest and smallest possible ranges. Encodings I have seen are 1's and 2's
comlement and excess N - where N = 2^(width of exponent - 1) [treat the exponent as a signed number
and encode by adding N, so the encoded value is always positive].
This information is always tough to find - because no one needs it except compiler writers.
Generally it will be in the hardware architecture or assembler references for the machines in
question. Varian used to support several formats because they made both 16 and 18 bit machines.
If you really have to do this, you have my sympathy.
Mike Howard <mike@clove.com>
next prev parent reply other threads:[~1998-04-06 13:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-04-03 17:15 OFF-TOPIC: little-endian vs. big-endian conversion Janice McCarthy
1998-04-03 17:33 ` Uncle George
1998-04-03 17:54 ` Alvin Starr
1998-04-06 12:39 ` Mike Howard [this message]
-- strict thread matches above, loose matches on Subject: below --
1998-04-03 17:27 Greg Lindahl
1998-04-03 17:51 ` Michal Jaegermann
1998-04-03 17:54 Greg Lindahl
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox