home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!venezia!penev
- From: penev@venezia (Penio Penev)
- Newsgroups: comp.sys.sgi.misc
- Subject: Re: converting from VAX Binary
- Message-ID: <1992Dec22.005835.4215@sol.ctr.columbia.edu>
- Date: 22 Dec 92 00:58:35 GMT
- References: <BzM955.639@ux1.cso.uiuc.edu>
- Sender: nobody@ctr.columbia.edu
- Reply-To: penev@venezia.rockefeller.edu
- Organization: Rockefeller University
- Lines: 49
- X-Newsreader: TIN [version 1.1 PL6]
- X-Posted-From: venezia.rockefeller.edu
- NNTP-Posting-Host: sol.ctr.columbia.edu
-
- Jonathon Sivier (jsivier@ux1.cso.uiuc.edu) wrote:
- : snow@castor.hahnemann.edu (Donald C. Snow) writes:
- : the VAX uses Intel byte order, the first two chars should be 'II'. The floating
- : point is more difficult. Not only is the byte order reversed, but thats easy to
- : fix, also the floating point formats are different. I tried to determine the
- : format, but gave up and transfered the floating point data as ASCII, which I
- : could read in and let the program convert to floating point. I'm sure
- : someone knows the formats and how to convert from one to the other, but this
- : was the easiest way as far as I cxould see.
-
- The floatting point format of the MIPS machines is the following:
-
- 31 30-23 22-0
- 63 62-52 51-0
- ---------------------------------
- S e f
- Sign Exponent Fraction
-
-
- the filesds are:
- - 1bit sign: s
- - biased exponent: e=E+bias
- - fraction: f=.b1b2...bp-1
-
- The values (v) are calculated in the following way:
-
- 1. if E=Emax+1 and f#0, then v is a NAN
- 2. if E+Emax+1 and f=0, then v=(-1)^s \infinity
- 3. if Emin<=E<=Emax, then v=(-1)^s*2^E*(1.f)
- 4. if E=Emin-1 and f#0, then v=(-1)^s*2^(Emin)*(0.f)
- 5. if E=Emin-1 and f=0, then v=(-1)^s*0
-
- f 24 53
- Emax +127 +1023
- Emin -126 -1022
- Exp bias +127 +1023
-
- The R4000 and R6000 have a fixed point format:
-
- 31 30-0
- S integer
- , which is in 2's complementary format.
-
- I do not have data about the VAX numbers, perhaps You would like to
- post to c.s.vax groups
-
- Convert and enjoy.
-
- -- Penio.
-