Kaiyi — 2.2.2.3 Decimal Floating-point Numbers

Chapter 2 Devices 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) T he po si ti on where the decim al po int is hidd en Example 1: 23 is represented by the single-precision floating-point number. ert 23 into the binary number, i.e. 23.0=10111. the mantissa, and 4 is the Mantissa sign bit (0: Positive; 1: Negative) W hen b0~b63 are zeros, the content is zer o. Step 1: Conv Step 2: Normalize the binary number, i.e. 10111=1.0111 Ч2 4 (0111 is exponent.). Step 3: Get the value of the exponent. ∵ E-B=4→E-127=4 ∴ E=131=10000 011 2 Step 4:

Combine the sign bit, the expon 0 100 0001 1 011 1000 0000 0000 0000 000 2 16 23 is represented by the double-precision floating-point number. ent, and the mantissa to form the floating-point number. 0 =41B80000 Step 1: e mantissa, and 4 is the 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 th exponent.). Step 3: Get the value of the exponent. ∵ E-B=4→E-1023=4 ∴ E=1027=100 00000011 2 Step 4: Combine the sign bit, the exponent, and the mantissa to form the floating-point nu 0 10000000011 0111 0000 0000 0000 0000 0000 2 =403700000000000 16 e 2: mber.

0000 0000 0000 0000 0000 0000 0000 presented by the sing The steps of 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 num The steps of converting -23.0 into the floating-point numb 23.0 into the floating-point number, except that the sign bit is 1. 1 10000000011 0111 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 2 =C03700000000000 16 Exampl -23 is re le-precision floating-point number. converting -23.0 into the floating-point number are the same as those of converting ber.

er are the same as those of converting 2.2.2.3 Decimal Floating-point Numbers  Since single-precision floating-point numbers and double-preci not widely accepted by people, they can be converted into decim people to make judgement. However, as to the operation of the decimal point, the PLC still uses single-precision floating-point numbers and double-precision floating-point numbers.  A 32-bibt decimal floating-point number is represented by two consecutive registers. The constant is stored in the register whose number is smaller while the exponent is stored in the register whose number is bigger. Take (D1, D0) for example.

sion floating-point numbers are al floating-point numbers for [Exponent ] D1 Base number D0=±1,000~±9,999 10 Decimal floating-point number=[Constant ]* D0 Exponent D1=-41~+35 ist in D0 because 100 is represented by 1,000Ч10 -1 . In floating-point numbers range from ±1175Ч10 -41 to ±402Ч10 +35 . The base number 100 does not ex addition, 32-bit decimal 2-7 S E10 E9 E8 E1 E0 A51 A50 A49 A6 A5 A4 A3 A2 A1 A0 E