8 Application Instructions API 100-149 D20. On/Off of the most left bit indicates the positive/negative status of the result value. MUL16 D0 D10 D20 M0 MUL16 D0 D10 D20 M0 16 bits 16 bits 16 bits D0 D10 D20 D0=K100, D10=K200, D20=K10,000 Program Example 2: If X0 is On, the 32-bit value K10,00 in (D1, D0) is multiplied by the 32-bit value K20,000 in (D11, D10) and a 32-bit product is produced. The 32-bit data is stored in (D21, D20). On/Off of the most left bit indicates the positive/negative status of the result value. X0 32 bits 32 bits 32 bits (D1,D0) (D11,D10) (D21,D20) (D1,D0)=K10,000, (D11,D10)=K20,000, (D21, D20)=K200,000,000 Remarks: 1.
If the value gotten from the 16-bit multiplication can not be represented by a 16-bit signed value, and is greater than the maximum 16-bit positive value K32767 or less than the minimum 16-bit negative value K-32768, M1022 is On, and the low 16-bit data is stored. 2. If users need to get a complete value (32-bit value) from a 16-bit multiplication, they have to use API22 MUL/MULP. Please refer to the explanation of API22 MUL/MULP for more information. 3.
If the value gotten from the 32-bit multiplication can not be represented by a 32-bit signed value, and is greater than the maximum 32-bit positive value K2147483647 or less than the minimum 16-bit negative value K-2147483648, M1022 is On, and the low 32-bit data is stored. 4. If users need to get a complete value (64-bit value) from a 32bit multiplication, they have to use API22 DMUL/DMULP. Please refer to the explanation of API22 DMUL/DMULP for more information. DVP-PLC Application Manual 8-27 MUL32 D0 D10 D20