Mitsubishi — 5.6 Application Instructions

5 Categories and Use of Basic Application Instructions Operands: S 1 : Multiplicand S 2 : Multiplicator D : Product Explanations: 1. MUL instruction multiplies S 1 by S 2 in BIN format and stores the result in D . Care should be taken on positive/negative signs of S 1 , S 2 and D when doing 16-bit and 32-bit operations. 2. When MUL is used as 16-bit instruction, Z device cannot be adopted; when MUL is used as 32-bit instruction, V device cannot be adopted. 3. In 16-bit BIN multiplication: +1 b15................ b00 b15................ b00 b31............

b16 b15.............b00 X = b15 is the sign bit b15 is the sign bit b31 is hte sign bit(b15 of D+1) b15=0,S1 is a positive value B15=1,S1 is a negative value b15=0,S2 is a positive value b15=1,S2 is a negative value b31=0,D(D+1) is a positive value b31=1, is a negative value D(D+1) 4. In 32-bit BIN multiplication: +1 +1 +3 +2 +1 b31.. b16 b15.. b00 b31.. b16 b15.. b00 b63. b48 b47. b32 b31. b16 b15.

b00 X = b31 is the sign bit b31 is the sign bit b63 is the sign bit(b15 of D+3) B31=0,S1(S1+1) is a positive value b31=1,S1(S1+1) is a negative value b31=0,S2(S2+1) is a positive value b31=1,S2(S2+1) is a negative value b63=0, D~(D+3) is a positive value b63=1, D~(D+3) is a negative value Program Example: The 16-bit D0 is multiplied by the 16-bit D10 and brings forth a 32-bit product. The higher 16 bits are stored in D21 and the lower 16-bit are stored in D20. ON/OFF of MSB indicates the positive/negative status of the operation result.

X0 DVP-PM Application Manual 5-39 API Mnemonic Operands Function Controllers 20PM 10PM 22 D MUL P Multiplication Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D V Z MUL, MULP: 7 steps DMUL, DMULP: 9 steps S 1 * * * * * * * * * * * D S 2 * * * * * * * * * * * D * * * MUL D0 D10 D20 MUL D0 D10 K8M0