Chapter 5 Applied Instructions S 1 : Multiplicand; S 2 : Multiplier; D : Product The signed binary value in S 1 is multiplied by the singed binary value in S 2 , and the product is stored in D . Users have to notice the sign bits in S 1 , S 2 , and D when 16-bit binary multiplication or 32-bit binary multiplication is done. 16-bit binary multiplication Explanation S D 1 2 D S +1 b15..............b0 b31.........b16 X = b15..............b0 b15...........b0 Sign bit=0 (Positive sign); Sign bit=1 (Negative sign) 32-bit binary multiplication Bit 15 is a sign bit. Bit 15 is a sign bit. Bit 31 is a sign bit.
(B it 15 in D+1 is a sign bit.) D +1 D D D 2 S 2 S S 1 S 1 +1 +1 +2 +3 X = Bit 31 is a sign bit. Bit 63 is a sign bit. (B it 15 in D+3 is a sign bit.) Bit 31 is a sign bit. b31...b16 b15...b0 b63...b48 b47...b32 b31...b16 b15...b0 b31...b16 b15...b0 Sign bit=0 (Positive sign); Sign bit=1 (Negative sign) Example The 16-bit value in D0 is multiplied by the 16-bit value in D10, and the 32-bit product is stored in (D21, D20). The bits in D21 is the high 16 bits in (D21, D20), whereas the bits in D20 is the low 16 bits in (D21, D20). Whether the product is a positive value or a negative value depends on the leftmost bit in (D21, D20).
X0.0 5-41 API Instruction code Operand Function 22 D MUL P S , S , D 1 2 Binary multiplication Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S 1 S 2 D Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (9 steps) MUL D0 D10 D20 MUL D0 D10 K8M0