Detailed explanation of floating-point numbers in Z/OS: HFP, BFP and DFP

Source: Internet
Author: User
Tags exception handling

In the z/OS operating system, the floating-point number type is divided into binary floating-point number schema BFP, hexadecimal floating-point architecture hfp and decimal floating-point architecture DFP three categories. IBM has established HFP as its base floating point architecture since 1964 s/360 system, 1998 S/390 system formally introduced BFP, that is ieee754-1985 Standard, to 2007 Z9 system began to support DFP, namely ieee754-2008 standard. This paper introduces the coding principles and properties of these three kinds of floating point numbers, helps readers to choose the appropriate floating-point number types in the application in Z/OS, and reads binary coded floating-point numbers in debugging.

Basic knowledge of floating-point architecture

In computer systems, floating-point numbers are a technical scheme for representing real numbers in a larger range. Usually a floating-point number is represented as the mantissa m multiplied by several integer power E of base B, which is very similar to the scientific notation commonly used in mathematics.

M * be

The specific floating-point architecture specifies the numbering scheme of mantissa and exponent. Cardinality is implied in the schema, for example, the cardinality of the IEEE-754 binary floating-point number format is 2,IBM, the base of the hexadecimal floating-point number format is 16. The mantissa is a fixed number of digits (in cardinality) and the exponent is generally encoded using an offset method. Below in the specific floating-point architecture, we use m,e to separate the m,e after the encoding. ,... with M0,M1,M2 Represents each bit from left to right in M, with | M| represents the number of bits m. e does the same.

In addition to the coding scheme, the floating-point architecture also prescribes the following, the basic operation of the calculation, the approximation of the computation under the finite precision, the special floating-point type, and the exception handling in the calculation. In this paper, we will focus on the coding scheme of floating point numbers for three kinds of floating-point number architectures in Z/OS. Floating-point calculation instructions and exception handling will be outside the scope of this article.

Hexadecimal floating-point number HFP

A HFP floating-point number consists of a bit of sign bit, a binary exponent of the seven bits, and the remainder is a 16-digit tail part. The exponent, which is called characteristic, is the index encoded according to the migration method, and the values 0 to 127 represent 16-64 to 16+63 respectively. In the hexadecimal mantissa, the decimal point is at the far left of the mantissa, representing a number of the mantissa, from the highest to the lowest bit, each four bits.

The HFP consists of 32-bit, 64-bit, and 128-bit three formats, as shown in Figure 1:

Figure 1:HFP floating-point numbering format [2]

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/OS/other/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.