A Collating Representation for Extremely Gradual Overflow
- From: jsavard@xxxxxxxxxxxxxxxxxxxxxxxxxx (John Savard)
- Date: Sun, 25 Jun 2006 13:54:42 GMT
When I first heard of the IEEE 795 floating-point standard, with its
suppressed zero bit, and gradual underflow, I felt that the fact that
the binary point does not move as the exponent changes from 000...001 to
all zeroes was slightly inelegant.
Thus, I thought of an idea which I explained much later on my web site,
where instead an unnormalized mantissa indicates the exponent is moved
downwards to a new range.
Thus:
0 111 10000 4
0 100 10000 .5
0 011 10000 .25
0 000 10000 .03125
0 111 01000 2^(-6)
0 000 01000 2^(-13)
0 111 00100 2^(-14)
0 000 00100 2^(-21)
and so on.
Later on, I thought of making the representation collating by putting
the first part of the mantissa, whether it is 1, 01, or 001, before the
exponent, which would then move through the number.
After I thought of a further improvement, letting the exponent field
become shorter when it hits the end of the number, I found that I had
already been anticipated, and that such a scheme forms the basis of
A-law audio encoding.
Some forms of floating-point representation invert the exponent and
mantissa fields of the number when the number is negative, in order that
floating-point numbers might be compared by fixed-point comparison
instructions.
This extremely gradual underflow representation does more than regular
gradual underflow, which fills in the "hole around zero". Because of
that, it might be felt to be biased in favor of underflow.
Extremely gradual overflow could be practised instead; if a number is
partly unnormalized, shift the exponent range *up* instead of *down*.
But how could one make a collating representation for that?
It finally dawned on me.
Invert the first part of the mantissa. Represent it by 0, 10, or 110,
and so on. Then unnormalized mantissas will be bigger than normalized
ones.
And this finally allows me to make a mixed extremely gradual overflow
and underflow representation somewhat elegant - instead of awkwards.
In that case, to have collation, one has to split the exponent field
into two parts.
Its first bit follows the sign of the number. Then one has the first
part of the mantissa, inverted when the exponent is positive. Then the
rest of the exponent. Then the rest of the mantissa.
Here is an illustrative example on a small scale, with four bits for the
full exponent field, starting out in excess-16 notation, and a mantissa
field that starts out as five bits long, both having their first bits
split off:
0 1 110 111 00 2^22
0 1 110 000 00 32,768
0 1 10 111 000 16,384
0 1 10 000 000 128
0 1 0 111 0000 64
0 1 0 001 0000 1
0 1 0 000 0000 .5
0 0 1 111 0000 .25
0 0 1 000 0000 2^(-9)
0 0 01 111 000 2^(-10)
0 0 01 000 000 2^(-17)
0 0 001 111 00 2^(-18)
0 0 001 000 00 2^(-25)
John Savard
http://www.quadibloc.com/index.html
_________________________________________
Usenet Zone Free Binaries Usenet Server
More than 140,000 groups
Unlimited download
http://www.usenetzone.com to open account
.
- Prev by Date: Re: Testing for IEEE infinity and NaN?
- Next by Date: Just for fun, making 100
- Previous by thread: C99 Annex G :-(
- Next by thread: Just for fun, making 100
- Index(es):
Relevant Pages
|