Mitsubishi Electronics QSERIES Smoker User Manual


  Open as PDF
of 1204
 
6-45
DB*(P),DB/(P)
1
2
3
4
4
6
7
8
6.2 Arithmetic Operation Instructions
6.2.8 BCD 8-digit multiplication and division operations (DB*(P),DB/(P))
(2) 64 bits are used for the result of the division operation, and stored as quotient and
remainder.
Quotient (BCD 8 digits) :Stored at the lower 32 bits.
Remainder (BCD 8 digits) :Stored at the upper 32 bits.
(3) If has been designated as a bit device, the remainder of the operation will not be stored.
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and
an error code is stored into SD0.
The or BCD data is outside the 0 to 99999999 range. (Error code: 4100)
Attempt to divide by 0. (Error code: 4100)
Program Example
(1) The following program multiplies the BCD data 67347125 and 573682, stores the result from
D502 to D505, and at the same time outputs the upper 8 digits to Y30 to Y4F.
[Ladder Mode] [List Mode]
[Operation]
(2) The following program divides the BCD data from X20 to X3F by the BCD data at D8 and D9
when X0B goes ON, and stores the result from D765 to D768.
[Ladder Mode] [List Mode]
[Operation]
D
S1
S2
S2
Step
Instruction
Device
Y30Y4F
8634
7
1 2
5
Multiplicand Multiplier
00
5
7 3 6 8 2
0039
2
0 9 5
0
D505
039 0
D504
29
5
5
D503
136 2
D502
4
5
0
Step
Instruction
Device
5
12
6
D9 (Upper 4 digits)
73
4
8
D8 (Lower 4 digits)
9986
X20X3F
Dividend
4
3
21
/
Quotient
0000 0006 80
2
8 8
1
33
(Lower 4 digits)(Upper 4 digits)
D766 D765
(Lower 4 digits)
D767
(Upper 4 digits)
D768
Remainder
Divisor