Binary integer decimal

This is an old revision of this page, as edited by 67.53.104.230 (talk) at 18:33, 2 July 2007 (Range). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The draft IEEE 754r standard proposed two encoding formats for decimal floating point numbers, the formats are referred to in the standard as binary encoding and decimal encoding.[1]. The binary encoding format is referred to by Intel[2] and others as Binary Integer Decimal (BID).

Format

File:BID general format.PNG
The three fields of a binary integer decimal number

A BID number has three fields, the sign the exponent and the magnitude.

The number has value v:

v = s × 10e × m

Where

s = +1 (positive numbers) when the sign bit is 0

s = −1 (negative numbers) when the sign bit is 1

e = exponent (in binary format) − bias

m = an integer (in binary format).

If the top two bits of the exponent are set to 11, the encoding is not for a value, plus infinity minus infinity and NaN are included in the non value range. If the top five bits of the exponent field have the encoding 11110 binary, the number represented is + or - infinity, the sign bit determines which. Nan is represented by the tops five bits of the exponent field being set to 11111.

Cohort

A decimal floating point number can be encoded in several ways, the different ways represent different accuracies, for example 100.0 could be encoded as 1000*10-1, 100.00 could be encoded 10000*10-2. The set of possible encodings is called a cohort. If the result of a calculation is inexact the largest amount of significant data is preserved by selecting the cohort member with the largest integer that can be stored in the significand along with the required exponent.

Range

The proposed IEEEE754r standard limits the range of numbers that can be represented by BID numbers to the smaller range of numbers that can be represented by the second encoding of the exponent and significand described by the standard, Densely Packed Decimal.

item 32 bit 64 bit 128 bit
Storage bits 32 64 128
Trailing Significand bits 20 50 110
Significand field bits 23 53 113
Combination bit 11 13 17
Exponent bits 8 11 15
Bias 101 398 6176
Standard emax 96 384 6144 Standard emin 95 383 6143

Comparing BID numbers

BID numbers are lexicographically ordered. If NaNs are excluded, the can be compared (>, <, or ==) as sign and magnitude integers.

See Also

IEEE 754r

References

  1. ^ "DRAFT Standard for Floating Point Arithmetic P754" (PDF). 2006-10-04. Retrieved 2007-07-01.
  2. ^ "IEEE 754R Decimal Floating-Point Arithmetic: Reliable and Efficient Implementation for Intel® Architecture Platforms". Intel. February 15, 2007. Retrieved 2007-07-01.