[Reprint] Normalization of floating-point arithmetic

When the mantissa is represented by complement , the normalized floating-point number should satisfy that the highest digit of the mantissa is different from the sign bit. If they are the same, the normalization is not satisfied.

The mantissa is represented by double sign bit’s complement. After addition/subtraction, the following six situations may occur, namely
① 00.1 xx … x 
② 11.0 xx … x
③ 00.0 xx … x
④ 11.1 xx … x
⑤ 01.xxx … x
⑥ 10.xxx … x The cases ① and ② meet the definition of normalized number and are already normalized numbers. Cases ③ and ④ are not normalized numbers, and the mantissa needs to be shifted to the left to achieve normalization. This process is called left gauge. Each time the mantissa The left gauge can be done multiple times.
Normalization of floating point arithmetic
Normalization of floating point arithmetic
Normalization of floating point arithmetic


Cases ⑤ and ⑥ are called overflow in fixed-point addition and subtraction, but in floating-point addition and subtraction, it only indicates that the absolute value of the mantissa is greater than 1 at this time, not a real overflow. In this case the mantissa should be shifted right for normalization. This process is called right gauge. Every time the mantissa is shifted to the right, the exponent is incremented by 1.
The right rule is at most one time.
 
Summary: For left-rule processing, when the number goes to the left of the decimal point, the order code is -1, and the right-hand rule is vice versa.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324647864&siteId=291194637