AH500 Motion Control Module Manual Step 2: Normalizing the binary number: 10111=1.0111Ч2 4 , (0111 is a mantissa, and 4 is an exponent) Step 3: Getting the exponent which is stored ∵ E-B=4→E-127=4 ∴ E=131=10000011 2 Step 4: Combining the sign bit, the exponent, and the mantissa to form a floating-point number. 0 100 0001 1 011 1000 0000 0000 0000 0000 2 =41B80000 16 Example 2: -23.0 is represented by a 32-bit floating-point number. -23.1 is converted in the same way as 23.0. Users only need to change the sign bit to 1. A motion control module uses two consecutive registers to form a 32-bit floating-point numbers. Take (D1, D0) in which a bianry floating-point number is stored for instance.
D1(b15~b0) D0(b15~b0) 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 b0 b1 b2 b3 b4 b5 b6 b20 b21 b22 b23 b24 b28 b29 b30 b31 Expo nent ( 8 bits; signe d numb er) Mantissa (23 bits) Positio n wher e a decima l poin t i s hi dden Mantissa sign bit (0: Positiv e num ber; 1: N egative num ber) When the value of b0~b31 is 0, the value of b31 is 0. Decimal floating-point number Since binary floating-point numbers are not widely accepted by people, they can be converted into decimal floating-point numbers. However, the decimals on which operations are performed in a motion control module are still binary floating-point numbers. A decimal floating-point number is stored in two consecutive registers.
The constant part is stored in the register whose device number is smaller, and the exponent part is stored in the register whose device number is bigger. Take (D1, D0) for instance. 10 Decimal floating-point number=[Constant ]* D0 [Exponent ] D1 Base: D0=±1,000~±9,999 Exponent: D1=-41~+35 Besides, the base 100 does not exist in D0 because 100 is represented by 1,000Ч10 -1 . A decimal floating-point number is in the range of ±1,175Ч10 -41 to ±3,402Ч10 +35 . If the instruction ADD/SUB/MUL/DIV is used in the main program O100~M102, the operation result gotten will affect the states of SM968~SM970.
If a floating-point operation instruction is used, the result gotten will also affect the state of the zero flag SM968, the state of the borrow flag SM969, and the state of the carry flag SM970. Zero flag: If the operation result gotten is 0, SM968 will be ON. Borrow flag: If the absolute value of the operation result gotten is less than the minimum value allowed, SM969 will be ON. Carry flag: If the absolute value of the operaiton result gotten is greater than the maximum value allowed, SM970 will be ON. 5-14 S E7 E6 E5 E1 E0 A22 A21 A20 A6 A5 A4 A3 A2 A1 A0