« FC4A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
»
11-1
11: B
INARY
A
RITHMETIC
I
NSTRUCTIONS
Introduction
The binary arithmetic instructions make it possible for the user to program computations using addition, subtraction, mul-
tiplication, and division. For addition and subtraction operands, internal relay M8003 is used to carry or to borrow.
The ROOT instruction can be used to calculate the square root of the value stored in a data register.
ADD (Addition)
SUB (Subtraction)
MUL (Multiplication)
DIV (Division)
Applicable CPU Modules
FC4A-C10R2/C
FC4A-C16R2/C
FC4A-C24R2/C
FC4A-D20K3/S3
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
X
X
X
X
X
S1 + S2
→
D1, CY
When input is on, 16-bit data designated by source operands S1
and S2 are added. The result is set to destination operand D1
and carr y (M8003).
REP
**
S1(R)
*****
D1(R)
*****
ADD(*)
S2(R)
*****
S1 – S2
→
D1, BW
When input is on, 16-bit data designated by source operand S2
is subtracted from 16-bit data designated by source operand S1.
The result is set to destination operand D1 and borrow (M8003).
REP
**
S1(R)
*****
D1(R)
*****
SUB(*)
S2(R)
*****
S1
×
S2
→
D1·D1+1
When input is on, 16-bit data designated by source operand S1
is multiplied by 16-bit data designated by source operand S2.
The result is set to 32-bit data designated by destination oper-
and D1.
REP
**
S1(R)
*****
D1(R)
*****
MUL(*)
S2(R)
*****
S1 ÷ S2
→
D1 (quotient), D1+1 (remainder)
When input is on, 16-bit data designated by source operand S1
is divided by 16-bit data designated by source operand S2. The
quotient is set to 16-bit destination operand D1, and the remain-
der is set to the next 16-bit data.
When S2 is 0 (dividing by 0), the ERR LED and special internal
relay M8004 (user program execution error) are turned on.
A user program execution error also occurs in the following divi-
sion operation.
Data type I: –32768 ÷ (–1)
REP
**
S1(R)
*****
D1(R)
*****
DIV(*)
S2(R)
*****
Содержание FC4A-C10R2
Страница 1: ...FC4A SERIES Micro Programmable Logic Controller User s Manual FC9Y B812 ...
Страница 6: ...PREFACE 4 FC4A MICROSMART USER S MANUAL ...
Страница 94: ...2 MODULE SPECIFICATIONS 2 74 FC4A MICROSMART USER S MANUAL ...
Страница 184: ...6 ALLOCATION NUMBERS 6 20 FC4A MICROSMART USER S MANUAL ...
Страница 218: ...8 ADVANCED INSTRUCTIONS 8 8 FC4A MICROSMART USER S MANUAL ...
Страница 240: ...11 BINARY ARITHMETIC INSTRUCTIONS 11 8 FC4A MICROSMART USER S MANUAL ...
Страница 244: ...12 BOOLEAN COMPUTATION INSTRUCTIONS 12 4 FC4A MICROSMART USER S MANUAL ...
Страница 252: ...13 SHIFT ROTATE INSTRUCTIONS 13 8 FC4A MICROSMART USER S MANUAL ...
Страница 274: ...15 WEEK PROGRAMMER INSTRUCTIONS 15 8 FC4A MICROSMART USER S MANUAL ...
Страница 378: ...22 DUAL TEACHING TIMER INSTRUCTIONS 22 4 FC4A MICROSMART USER S MANUAL ...
Страница 386: ...23 INTELLIGENT MODULE ACCESS INSTRUCTIONS 23 8 FC4A MICROSMART USER S MANUAL ...
Страница 408: ...24 ANALOG I O CONTROL 24 22 FC4A MICROSMART USER S MANUAL ...
Страница 426: ...26 COMPUTER LINK COMMUNICATION 26 6 FC4A MICROSMART USER S MANUAL ...