Chapter 6 Applied Instructions Symbol: S 1 : Multiplicand Word/Double word S 2 : Multiplier Word/Double word D : Product Double word/Long 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 D* 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 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. 4. The multiplication of 32-bit binary values: D +1 D D D 2 S 2 S S 1 S 1 +1 +1 +2 +3 b31...b16 b15...b0 b63...b48 b47...b32 b31...b16 b15...b0 b31...b16 b15...b0 b31 is the sign bit. b31 is the sign bit. b63, i.e. b15 in D+3, is the sign bit. * = The product is a 64-bit value, and is stored in the register (D+3, D+2, D+1, D0), which is composed of 64 bits. When the sign bit b63 is 0, the product is a positive value. When the sign bit b63 is 1, the product is a negative value. 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 data in D21 is the higher 16-bit data, whereas the data in D20 is the lower 16-bit data. Whether the result is a positive value or a negative value depends on the state of the highest bit b31. When b31 is OFF, the result is a positive value.
When b31 is ON, the result is a negative 6-41 API Instruction code Operand Function 0102 D * P S , S , D 1 2 Multiplication of binary numbers 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