Chapter 6: Instructions
105
Instruction
Mnemonic
Multiplication
Range
Bit
■
Word
MUL
DMUL
MULB
DMULB
Decimal multiplication (MUL,
DMUL)
BCD multiplication (MULB,
DMULB)
■
Double words
Ladder
D = S1
×
S2
Decimal:
S1 = 3 and S2 = 7
Hexadecimal: S1 = $03 and S2 = $07
MUL Example:
Decimal:
3
×
7 = 21
MULB Example:
BCD:
$03
×
$07 = $21
Description
1. Multiply the data in the S1 and S2 addresses, then store the result in the D register.
2. When using MUL and MULB, the calculation ranges are as follows:
S1: 0 to 65,535 ($0000 to $FFFF)
S2: 0 to 65,535 ($0000 to $FFFF)
D: 0 to 65,535 ($0000 to $FFFF)
3. When using DMUL and DMULB, the calculation ranges are as follows:
S1: 0 to 4,294,976,295 (0 to $FFFFFFFF)
S2: 0 to 4,294,976,295 (0 to $FFFFFFFF)
D: 0 to 4,294,976,295 (0 to $FFFFFFFF)
4. If the result exceeds the range of calculation, a carry occurs. The carry flag (F1.8) is changed
to On. The high word of the result that exceeds the range of D is automatically stored in
SR20.
5. This operation will occur on every scan for which the input condition is true (On). To perform
the operation only on a change of input condition, use the rising/falling edge contact.
Example
Program Expression
Operation Results
Initial conditions: W0 = 00002 = $0002
W1 = 00001 = $0001
W2 = 00006 = $0006
W3 = 00001 = $0001
Operation results: W10 = 00012 = $000C
W11 = 0000524300 = $0008000C
W13 = 00018 = $0012
MUL
D =
S1 =
S2 =
R
R
MULB
D =
S1 =
S2 =
MUL
D = W10
S1 = W0
S2 = W2
DMUL
D = W11
S1 = W0
S2 = W2
MULB
D = W13
S1 = W0
S2 = W2
R0
R
Содержание D320 PLC
Страница 1: ...D320 PLC User s Manual...
Страница 18: ...6 D320 PLC User s Manual...
Страница 28: ...16 D320 PLC User s Manual...
Страница 34: ...22 D320 PLC User s Manual...
Страница 78: ...66 D320 PLC User s Manual...
Страница 176: ...164 D320 PLC User s Manual...
Страница 210: ...198 D320 PLC User s Manual...
Страница 258: ...246 D320 PLC User s Manual...