The size of the base value of the mantissa of a floating-point number (computer system architecture)

       The article will combine fixed-length floating-point data to represent the base value of the mantissa

       When the machine word length is the same, using floating-point numbers to represent real numbers has a larger representable range than using fixed-point numbers to represent. Many machines use the following format to represent a floating-point number. The order code part in the figure includes two parts: the order symbol and the order value. It is worth noting that in the p+1-bit order code part, only p actually affects the order value. bit.

      In mathematics, real numbers are distributed continuously on the number line. However, for the limited word length of the machine, floating-point numbers can only represent some discrete values ​​scattered on the positive and negative intervals on the number axis, as shown in the following figure:

    The number of bits p of the order value of the floating-point number mainly affects the size of the two representable areas, that is, the range of numbers that can be represented, while the number of bits m of the mantissa mainly affects the precision of the value that can be represented in the representable area. Due to the limited number of digits, errors will inevitably occur, and the size of the error is related to the number of digits m.

    We discuss the impact of the choice of the base value for the mantissa of floating-point numbers, in terms of r_{​{m}}the base for representing floating-point numbers. Then r_{​{m}}the number in base is \left \lceil lb r_{_{m}} \right \rceil. When the number of digits of the machine is m, it is equivalent to a number of digits r_{​{m}}in the mantissa of the base system _m{'}^{}, and its digit weights are r_{m}^{-1}, r_{m}^{-2}..., to the right r_{m}^{-m'}. where m'=m/ \left \lceil lb r_{_{m}} \right \rceil.

The floating-point number that is considered as the base value of the mantissa is to add 1 to the exponent to keep the value unchanged when     ther_{​{m}} mantissa is shifted to the right by one base digit. r_{​{m}}The following table lists the r_{​{m}}general format of various characteristic parameters of floating-point numbers under the conditions of non-negative order, positive mantissa, and normalization using binary p bits for the order value and base m' bits for the mantissa.

r_{​{m}}The normalized positive mantissa refers to the number whose     first base digit after the decimal point of the positive mantissa is not 0. Because the number whose mantissa is all 0 is machine zero, it is not a representable number in the machine. Therefore, the smallest positive mantissa value should be the value in which r_{​{m}}the first r_{​{m}}decimal digit after the decimal point of the decimal mantissa is 1, and the other digits are all 0, that is r_{m}^{-1}, the largest mantissa is 1- r_{m}^{-1}.

    Since it is a non-negative order, the minimum order should be that the order value is all 0, so the minimum order is 0, and the maximum order should be all 1, so the maximum order is -1, and the order value is from 0 2^{p}to 2^{p}-1 of total 2^{p}.

    According to the meaning of the floating-point number representation format, the value of the floating-point number is: order value X mantissa value, then the maximum number and the minimum number can be obtained from the above summary.

Guess you like

Origin blog.csdn.net/peng_lv/article/details/127592191