Re: [OT] The Ramifications of Little-Endian Packed Decimal

From: Douglas A. Gwyn (DAGwyn_at_null.net)
Date: 08/11/03


Date: Mon, 11 Aug 2003 16:46:18 GMT

jsavard@ecn.ab.ca wrote:
> Douglas A. Gwyn (DAGwyn@null.net) wrote:
> : jsavard@ecn.ab.ca wrote:
> : > : Your use of nybble values A-F for values in the high 90s
> : > : makes no sense; it's not general enough to help with tens-
> : > : complement representation. Best to reserve F for field
> : > : mark.
> : > What I am achieving is allowing negative numbers to be
> : > represented with no storage penalty.
> : But not arbitrary negative values, only a few.
> Ah, but if I were representing negative and positive values, using ten's
> complement notation instead of wasting a whole digit on the sign, then in
> four nybbles, I could represent numbers from -5000 to 4999.

That's not what your description said. Positive values up to 9999
were representable with four nybbles, and with nybbles having values
in the high 90s even assuming some form of tens-complement only a
very erratic set of negative values would be represented. But for
-5000 to 4999 an obvious approach is to store 0 to 9999 and take into
account the -5000 offset at an appropriate place in the computation.
There is an advantage in the arithmetic unit to using a separate
sign bit for packed-decimal operations.


Quantcast