home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / misc / 68 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.0 KB

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