« FC4A MICRO SMART USER ’S MANUAL » 11-111: B INARY A RITHMETIC I NSTRUCTIONSIntroductionThe 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 ModulesFC4A-C10R2/C FC4A-C16R2/C FC4A-C24R2/C FC4A-D20K3/S3 FC4A-D20RK1/RS1 & FC4A-D40K3/S3X X X X XS1 + S2 → D1, CYWhen input is on, 16-bit data designated by source operands S1and S2 are added. The result is set to destination operand D1and carry (M8003).REP**S1(R)*****D1(R)*****ADD(*) S2(R)*****S1 – S2 → D1, BWWhen input is on, 16-bit data designated by source operand S2is 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+1When input is on, 16-bit data designated by source operand S1is 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 S1is divided by 16-bit data designated by source operand S2. Thequotient 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 internalrelay 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)*****