Справочник Пользователя для Mitsubishi Electronics MELSEC -Q/L

Скачать
Страница из 1086
240
6  BASIC INSTRUCTIONS
6.2  Arithmetic Operation Instructions
BCD 4-digit multiplication and division operations
B*(P), B/(P)
Processing details
B*
 • Multiplies BCD data designated by (S1) and BCD data designated by (S2), and stores the result in the device designated 
by (D).
 • 0 to 9999 (BCD 4 digits) can be assigned to (S1) and (S2).
B/
 • Divides BCD data designated by (S1) and BCD data designated by (S2), and stores the result in the device designated by 
(D).
 • Uses 32 bits to store the result of the division as quotient and remainder
 • If (D) has been designated as a bit device, the remainder of the operation will not be stored.
Operation error
 • In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
(S1):  Data to be multiplied/divided or head number of the devices where the data to be multiplied/divided is stored (BCD 4 digits)
(S2):  Data for multiplying/dividing or head number of the devices where the data for multiplying/dividing is stored (BCD 4 digits)
(D):   Head number of the devices where the multiplication/division operation result will be stored (BCD 8 digits)
Setting 
data
Internal device
R, ZR
J\
U\G
Zn
Constant
K, H
Others
Bit
Word
Bit
Word
(S1)
(S2)
(D)
• Quotient (BCD 4 digits) 
 Stored at the lower 16 bits.
• Remainder (BCD 4 digits) 
 Stored at the upper 16 bits.
Error 
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH
QnPRH QnU
LCPU
4100
The (S1) or (S2) BCD data is outside the 0 to 9999 range.
The divisor is 0.
Basic
Process
High
performance
Redundant Universal
LCPU
Command
Command
P
B*
*
, B/
P, B/P
B
S1
S2
D
S1
S2
D
B   ,B/
indicates an instruction symbol of    *     .
4
0
9
7
8
0
7
6
6
5
7
8
(Upper 4 digits)
+1
9
3
2
8
(Lower 4 digits)
S1
S2
D
D
0
0
0
6
8
0
7
6
6
5
7
8
4
0
2
2
+1 (Remainder)
(Quotient)
S1
S2
D
D
Digits exceeding the designated number of digits are  
assumed to be 0.
/