Delta Electronics AH — 5.2.17. Floating-point Numbers (F, DF)

Chapter 5 Understanding Common Devices Equation: ( ) 1023 ; .1 2 1 = Ч Ч − − B M B E S The double-precision floating-point numbers range from ±2 -1022 to ±2 +1024 , and correspond to the range from ±2.2250Ч10 -308 to ±1.7976Ч10 +308 . The AH500 series PLC uses four consecutive registers to form a 64-bit floating-point number. Take (D3, D2, D1, D0) for example. D1(b15~b0) D2~D0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 b0 b1 b2 b3 b4 b5 b6 b49 b50 b51 b52 b53 b60 b61 b62 b63 Exponent (11 bits) Mantissa (52 bits) he po si ti on w here the decim al po int is hidd en Mantissa sign bit (0: Positive; 1: Negative) W hen b0~b63 are zeros, the content is zer o. Example 1:

23 is represented by the single-precision floating-point number. Step 1: Convert 23 into the binary number, i.e. 23.0=10111. Step 2: Normalize the binary number, i.e. 10111=1.0111 Ч2 4 (0111 is the mantissa, and 4 is the exponent.). Step 3: Get the value of the exponent. ∵ E-B=4→E-127=4 ∴ E=131=10000011 2 Step 4: Combine the sign bit, the exponent, and the mantissa to form the floating-point number. 23 is represented by the double-precision floating-point number. 0 100 0001 1 011 1000 0000 0000 0000 0000 2 =41B80000 16 5_ Step 1: Convert 23 into the binary number, i.e. 23.0=10111. Step 2: Normalize the binary number, i.e. 10111=1.0111 Ч2 4 (0111 is the mantissa, and 4 is the exponent.).

Step 3: Get the value of the exponent. ∵ E-B=4→E-1023=4 ∴ E=1027=10000000011 2 Step 4: Combine the sign bit, the exponent, and the mantissa to form the floating-point number. 0 10000000011 0111 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 2 =403700000000000 16 Example 2: -23 is represented by the single-precision floating-point number. The steps of converting -23.0 into the floating-point number are the same as those of converting 23.0 into the floating-point number, except that the sign bit is 1. 1 100 0001 1 011 1000 0000 0000 0000 0000 2 =C1B80000 16 -23 is represented by the double-precision floating-point number.

The steps of converting -23.0 into the floating-point number are the same as those of converting 23.0 into the floating-point number, except that the sign bit is 1. 5-13 S E10 E9 E8 E1 E0 A51 A50 A49 A6 A5 A4 A3 A2 A1 A0 The po si t