T.R | Title | User | Personal Name | Date | Lines |
---|
504.1 | move the decimal point one way or another | WIBBIN::NOYCE | Pulling weeds, pickin' stones | Mon Apr 21 1997 13:06 | 8 |
| Well, you could look at it that way. Alternatively, the way VAX architects
look at it, the fraction has a value of 1/2 (the radix point is just to the
left of the hidden bit).
For IEEE single, the radix point is considered to be just to the right of the
hidden bit, as you're assuming, and the exponent offset is 127 -- these
combine to mean that similar bit patterns (after swapping words) give values
that differ by a factor of 4.0.
|
504.2 | details of number representation | KZIN::HUDSON | That's what I think | Wed Apr 23 1997 09:32 | 73 |
| Hi Simon
When working at the CSC I had cause to answer customer questions on this
problem and wrote a program, the output of which may help... (if you want a
copy of the program, let me know)
nick
$ r float
This program will convert from the hex representation of a VAX floating
number into the precise floating point decimal equivalent, and can show
workings as it goes.
Would you like F_FLOAT, D_FLOAT or G_FLOAT (F/D/G) ? F
Please enter the hex representation of number. Each hex
Number you enter should include any leading zeros
Please give first longword in hex : 00004180
Do you want to see intermediate workings ? Y
The hex value
00004180 represents the following decimal value...
A F_FLOAT looks like this :
32 16|15 7|6 0
+----------------+-+--------+-------+
| fraction2 |S|exponent|fract1 |
+----------------+-+--------+-------+
32 16|15 7|6 0
The number looks like this :
32 16|15 7|6 0
+----------------+-+--------+-------+
|0000000000000000|+|10000011|0000000|
+----------------+-+--------+-------+
32 16|15 7|6 0
The most significant bit of the fraction is ALWAYS considered to be set, and
so does not need to be stored. Given that, the full fractional part is :
<frac1> <frac2>
+0.10000000 0000000000000000
Which represents the sum of the following (decimal) numbers :
+0.5
================================================================================
Total= +0.5
================================================================================
The exponent is 131 which is held in excess 128 format, giving a true
exponent of 3
So to find the actual number, we now have to multiply the fraction by 2^3
Which works out to
0.5
*8.
The precise number represented is :
================================================================================
+4.
================================================================================
|
504.3 | | QUARK::LIONEL | Free advice is worth every cent | Wed Apr 23 1997 10:32 | 35 |
| The OpenVMS FAQ discusses this:
VAX2. What is the layout of the VAX floating point format?
The VAX floating point format is derived from one of the PDP-11 FP formats,
which helps explain its strange layout. There are four formats defined:
F 32-bit single-precision, D and G 64-bit double-precision and H 128-bit
quadruple precision. For all formats, the lowest addressed 16-bit "word"
contains the sign and exponent (and for other than H, some of the most
significant fraction bits). Each successive higher-addressed word contains
the next 16 lesser-significant fraction bits. Bit 15 of the first word is the
sign, 1 for negative, 0 for positive. Zero is represented by a biased
exponent value of zero and a sign of zero; the fraction bits are ignored (but
on Alpha, non-zero fraction bits in a zero value cause an error.) A value
with biased exponent zero and sign bit 1 is a "reserved operand" - touching
it causes an error - fraction bits are ignored. There are no minus zero,
infinity, denormalized or NaN values.
For all formats, the fraction is normalized and the radix point assumed to be
to the left of the MSB, hence 0.5 <= f < 1.0. The MSB, always being 1, is
not stored. The binary exponent is stored with a bias varying with type in
bits 14:n of the lowest-addressed word.
Type Exponent bits Exponent bias Fraction bits (including hidden)
==========================================================================
F 8 128 24
D 8 128 56
G 11 1024 53
H 15 16384 113
The layout for D is identical to that for F except for 32 additional
fraction bits.
Example: +1.5 in F float is hex 000040C0 (fraction of .11[base 2], biased
exponent of 129)
|
504.4 | | MOVIES::WIDDOWSON | Rod OpenVMS Engineering. Project Rock | Wed Apr 23 1997 10:49 | 18 |
| ... and for the sake of history
IMHO, One of the most glorious hacks in the VAX/VMS masterpack was
perpetrated by Andy Goldstein almost 20 years ago. The basic problem
is of finding the lefthand most set bit in a longword (by analogy to
the FFS instruction this would be FLS).
Andy claims that this was inspired by Hustvedt:
LEFT_ONE::
.WORD ^M<> ; NO REGISTERS SAVED
MOVL #32,R0 ; ASSUME NEGATIVE
BBS #31,ARG(AP),10$ ; BRANCH TO END IF NEGATIVE
CVTLD ARG(AP),R0 ; CONVERT TO DOUBLE FLOATING
EXTZV #7,#7,R0,R0 ; GET EXPONENT, LESS EXCESS 128
10$: RET ; AND THAT'S ALL
|
504.5 | er, maybe I just saw some light ... | BBPBV1::WALLACE | john wallace @ bbp. +44 860 675093 | Wed Apr 23 1997 19:18 | 9 |
| Would a hack like this be in the code path of $MOUNT, by any chance ?
I once had a customer with a 785 which was on third party maintenance.
It wouldn't mount disks. Third party had no diags, Digital diags said
"FPU broke", me not understanding why FPU would get involved in $MOUNT,
but engineer swapped anyway and problem disappears...
regards
john
|
504.6 | 780/785 FPU also accelerated integer mutiply.... | STAR::CROLL | | Thu Apr 24 1997 11:37 | 9 |
| The FPU on the 780 and 785 also accelerated some integer
operations. There have been a number of instances where
fixing the FPU fixed some other, obviously non-floating
point, problem.
I know the FPU accelerated integer mutiply, but can't
remember what else it helped with...
John
|
504.7 | Fixing FPU Cleared Locking Problems | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Thu Apr 24 1997 12:09 | 4 |
|
And faulty VAX-11/78x-class FPU boards were notorious for inducing
odd problems deep in the lock manager...
|
504.8 | | QUARK::LIONEL | Free advice is worth every cent | Thu Apr 24 1997 13:38 | 3 |
| ... and LMF!
Steve
|
504.9 | | UTRTSC::utojvdbu1.uto.dec.com::JurVanDerBurg | Change mode to Panic! | Fri Apr 25 1997 03:27 | 4 |
| Don't forget LOGIN problems.
Jur.
|
504.10 | | MOVIES::WIDDOWSON | Rod OpenVMS Engineering. Project Rock | Fri Apr 25 1997 05:05 | 8 |
| RE: <<< Note 504.5 by BBPBV1::WALLACE "john wallace @ bbp. +44 860 675093" >>>
>> Would a hack like this be in the code path of $MOUNT, by any chance ?
Got it in one John!
One of my first jobs in digital was to `port' this to Alpha. Strange
that it should come to light as I work out my notice....
|