1000/1000

Hot
Most Recent

Submitted Successfully!

Thank you for your contribution! You can also upload a video entry or images related to this topic.

Do you have a full video?

Are you sure to Delete?

Cite

If you have any further questions, please contact Encyclopedia Editorial Office.

Li, H. Radix-16 Floating Point. Encyclopedia. Available online: https://encyclopedia.pub/entry/33816 (accessed on 05 December 2023).

Li H. Radix-16 Floating Point. Encyclopedia. Available at: https://encyclopedia.pub/entry/33816. Accessed December 05, 2023.

Li, Handwiki. "Radix-16 Floating Point" *Encyclopedia*, https://encyclopedia.pub/entry/33816 (accessed December 05, 2023).

Li, H.(2022, November 10). Radix-16 Floating Point. In *Encyclopedia*. https://encyclopedia.pub/entry/33816

Li, Handwiki. "Radix-16 Floating Point." *Encyclopedia*. Web. 10 November, 2022.

Copy Citation

IBM hexadecimal floating point is number representation. IBM System/360 computers, and subsequent machines based on that architecture (mainframes), support a hexadecimal floating-point format (HFP). In comparison to IEEE 754 floating-point, the IBM floating-point format has a longer significand, and a shorter exponent. All IBM floating-point formats have 7 bits of exponent with a bias of 64. The normalized range of representable numbers is from 16−65 to 1663 (approx. 5.39761 × 10^{−79} to 7.237005 × 10^{75}). The number is represented as the following formula: (−1)^{sign} × 0._{significand} × ^{16exponent−64}.

hexadecimal
floating-point
mainframes

A single-precision binary floating-point number (called "short" by IBM) is stored in a 32-bit word:

In this format the initial bit is not suppressed, and the radix point is set to the left of the significand (fraction in IBM documentation and the figures) in increments of 4 bits.

Since the base is 16, the exponent in this form is about twice as large as the equivalent in IEEE 754, in order to have similar exponent range in binary, 9 exponent bits would be required.

Consider encoding the value −118.625 as an IBM single-precision floating-point value.

The value is negative, so the sign bit is 1.

The value 118.625_{10} in binary is 1110110.101_{2}. This value is normalized by moving the radix point left four bits (one hexadecimal digit) at a time until the leftmost digit is zero, yielding 0.01110110101_{2}. The remaining rightmost digits are padded with zeros, yielding a 24-bit fraction of .0111 0110 1010 0000 0000 0000_{2}.

The normalized value moved the radix point two digits to the left, yielding a multiplier and exponent of 16^{+2}. A bias of +64 is added to the exponent (+2), yielding +66, which is 100 0010_{2}.

Combining the sign, exponent plus bias, and normalized fraction produces this encoding:

In other words, the number represented is −0.76A000_{16} × 16^{66 − 64} = −0.4633789… × 16^{+2} = −118.625

The number represented is +0.FFFFFF_{16} × 16^{127 − 64} = (1 − 16^{−6}) × 16^{63} ≈ +7.2370051 × 10^{75}

The number represented is +0.1_{16} × 16^{0 − 64} = 16^{−1} × 16^{−64} ≈ +5.397605 × 10^{−79}.

Zero (0.0) is represented in normalized form as all zero bits, which is arithmetically the value +0.0_{16} × 16^{0 − 64} = +0 × 16^{−64} ≈ +0.000000 × 10^{−79} = 0. Given a fraction of all-bits zero, any combination of positive or negative sign bit and a non-zero biased exponent will yield a value arithmetically equal to zero. However, the normalized form generated for zero by CPU hardware is all-bits zero. This is true for all three floating-point precision formats.

Since the base is 16, there can be up to three leading zero bits in the binary significand. That means when the number is converted into binary, there can be as few as 21 bits of precision. Because of the "wobbling precision" effect, this can cause some calculations to be very inaccurate.

A good example of the inaccuracy is representation of decimal value 0.1. It has no exact binary or hexadecimal representation. In hexadecimal format, it is represented as 0.19999999..._{16} or 0.0001 1001 1001 1001 1001 1001 1001..._{2}, that is:

This has only 21 bits, whereas the binary version has 24 bits of precision.

Six hexadecimal digits of precision is roughly equivalent to six decimal digits (i.e. (6 − 1) log_{10}(16) ≈ 6.02). A conversion of single precision hexadecimal float to decimal string would require at least 9 significant digits (i.e. 6 log_{10}(16) + 1 ≈ 8.22) in order to convert back to the same hexadecimal float value.

The double-precision floating-point format (called "long" by IBM) is the same as the "short" format except that the fraction field is wider and the double-precision number is stored in a double word (8 bytes):

The exponent for this format covers only about a quarter of the range as the corresponding IEEE binary format.

14 hexadecimal digits of precision is roughly equivalent to 17 decimal digits. A conversion of double precision hexadecimal float to decimal string would require at least 18 significant digits in order to convert back to the same hexadecimal float value.

Called extended-precision by IBM, a quadruple-precision floating-point format was added to the System/370 series and was available on some S/360 models (S/360-85, -195, and others by special request or simulated by OS software). The extended-precision fraction field is wider, and the extended-precision number is stored as two double words (16 bytes):

28 hexadecimal digits of precision is roughly equivalent to 32 decimal digits. A conversion of extended precision hexadecimal float to decimal string would require at least 35 significant digits in order to convert back to the same hexadecimal float value.

Most arithmetic operations truncate like simple pocket calculators. Therefore, 1 − 16^{−7} = 1. In this case, the result is rounded away from zero.^{[1]}

Starting with the S/390 G5 in 1998,^{[2]} IBM mainframes have also included IEEE binary floating-point units which conform to the IEEE 754 Standard for Floating-Point Arithmetic. IEEE decimal floating-point was added to IBM System z9 GA2^{[3]} in 2007 using millicode^{[4]} and in 2008 to the IBM System z10 in hardware.^{[5]}

Modern IBM mainframes support three floating-point radices with 3 hexadecimal (HFP) formats, 3 binary (BFP) formats, and 3 decimal (DFP) formats. There are two floating-point units per core; one supporting HFP and BFP, and one supporting DFP; there is one register file, FPRs, which holds all 3 formats. Starting with the z13 in 2015, processors have added a vector facility that includes 32 vector registers, each 128 bits wide; a vector register can contain two 64-bit or four 32-bit floating-point numbers.^{[6]} The traditional 16 floating-point registers are overlaid on the new vector registers so some data can be manipulated with traditional floating-point instructions or with the newer vector instructions.

The IBM floating-point format is used in:

- SAS 5 Transport files (.XPT) as required by the Food and Drug Administration (FDA) for New Drug Application (NDA) study submissions,
^{[7]} - GRIB (GRIdded Binary) data files to exchange the output of weather prediction models (IEEE single-precision floating-point format in current version),
- GDS II (Graphic Database System II) format files (OASIS is the replacement), and
- SEG Y (Society of Exploration Geophysicists Y) format files (IEEE single-precision floating-point was added to the format in 2002).
^{[8]}

As IBM is the only remaining provider of hardware (and only in their mainframes) using their non-standard floating-point format, no popular file format requires it; Except the FDA requires the SAS file format and "All floating-point numbers in the file are stored using the IBM mainframe representation. [...] Most platforms use the IEEE representation for floating-point numbers. [...] To assist you in reading and/or writing transport files, we are providing routines to convert from IEEE representation (either big endian or little endian) to transport representation and back again."^{[7]} Code for IBM's format is also available under LGPLv2.1.^{[9]}

- IBM System/360
- RCA Spectra 70
- English Electric System 4
- GEC 4000 series minicomputers
- Interdata 16-bit and 32-bit computers
- Texas Instruments 990/12
- Data General minicomputers

- ESA/390 Enhanced Floating Point Support: An Overview ftp://public.dhe.ibm.com/software/websphere/awdtools/hlasm/sh93fpov.pdf
- Schwarz, E. M.; Krygowski, C. A. (September 1999). "The S/390 G5 floating-point unit". IBM Journal of Research and Development 43 (5.6): 707–721. doi:10.1147/rd.435.0707. https://dx.doi.org/10.1147%2Frd.435.0707
- Duale, A. Y.; Decker, M. H.; Zipperer, H.-G.; Aharoni, M.; Bohizic, T. J. (January 2007). "Decimal floating-point in z9: An implementation and testing perspective". IBM Journal of Research and Development 51 (1.2): 217–227. doi:10.1147/rd.511.0217. https://dx.doi.org/10.1147%2Frd.511.0217
- Heller, L. C.; Farrell, M. S. (May 2004). "Millicode in an IBM zSeries processor". IBM Journal of Research and Development 48 (3.4): 425–434. doi:10.1147/rd.483.0425. https://dx.doi.org/10.1147%2Frd.483.0425
- Schwarz, E. M.; Kapernick, J. S.; Cowlishaw, M. F. (January 2009). "Decimal floating-point support on the IBM System z10 processor". IBM Journal of Research and Development 53 (1): 4:1–4:10. doi:10.1147/JRD.2009.5388585. https://dx.doi.org/10.1147%2FJRD.2009.5388585
- z/Architecture Principles of Operation http://publibfp.boulder.ibm.com/epubs/pdf/dz9zr011.pdf
- "The Record Layout of a Data Set in SAS Transport (XPORT) Format". http://support.sas.com/techsup/technote/ts140.pdf.
- http://www.seg.org/documents/10161/77915/seg_y_rev1.pdf
- https://cran.r-project.org/web/packages/SASxport/SASxport.pdf

More

Information

Subjects:
Others

Contributor
MDPI registered users' name will be linked to their SciProfiles pages. To register with us, please refer to https://encyclopedia.pub/register
:

View Times:
653

Entry Collection:
HandWiki

Update Date:
16 Nov 2022