Delta AH500 — 6.2.2 Explanation of Arithmetic Instructions

AH500 Programming Manual API 0117 Symbol: S 1 : Multiplicand Word/Double Word S 2 : Multiplier Word/Double Word D : Product Word/Double Word Explanation: 1. The signed binary value in S 1 is multiplied by the singed binary value in S 2 , and the product is stored in D . 2. Only the instruction MUL32 can use the 32-bit counter. 3. The multiplication of 16-bit binary values: S D 1 2 D S +1 b15..............b0 b31.........b16 * = b15..............b0 b15...........b0 b15 is the sign bit. b15 is the sign bit. b31, i.e. b15 in D+1, is the sign bit. The product is a 16-bit value, and is stored in the register (D), which is composed of 16 bits.

When the sign bit b15 is 0, the product is a positive value. When the sign bit b15 is 1, the product is a negative value. 4. The multiplication of 32-bit binary values: S 1 S 1 +1 D +1 D 2 S 2 S +1 b31...b16 b15...b0 * = b3 1...b1 6 b15 ...b0 b31...b16 b15...b0 The product is a 32-bit value, and is stored in the register (D+1, D), which is composed of 32 bits. When the sign bit b31 is 0, the product is a positive value. When the sign bit b31 is 1, the product is a negative value. b31 is the sign bit. b31 is the sign bit. b31 is the sign bit.

6-70 Instruction code Operand Function MUL16 MUL32 P S ,S ,D 1 2 Multiplication of binary numbers for 16-bit/32-bit Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1             S 2             D           Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (7 steps) AH500 AH500 AH500