Signed Binary Multiply: *(420) - Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

Symbol Math Instructions
Flags
Precautions
Examples

3-11-17 SIGNED BINARY MULTIPLY: *(420)

Purpose
Ladder Symbol
460
Name
Error Flag
ER
Equals Flag
=
Carry Flag
CY
If Mi, Mi +1 and/or Su, Su +1 are not BCD, an error is generated and the Error
Flag will turn ON.
If as a result of the subtraction, the content of R, R +1 is 00000000 hex, the
Equals Flag will turn ON.
If an subtraction results in a borrow, the Carry Flag will turn ON.
Note To clear the Carry Flag (CY), execute the Clear Carry (CLC(041)) instruction.
When CIO 000000 is ON in the following example, D00111, D00110, and CY
will be subtracted from D00101 and D00100 as 8-digit BCD values, and the
result will be output to D00121 and D00120.
If the result of the subtraction is a negative number (Mi<Su or Mi+1, Mi
<Su+1, Su), the result is output as a 10's complement. The Carry Flag (CY)
will turn ON. To convert the 10's complement to the true number, a program
which subtracts the result from 0 is necessary, as an input condition of the
Carry Flag (CY). The Carry Flag turning ON thus indicates that the result of
the subtraction is negative.
Note 10's Complement
A 10's complement is the value obtained by subtracting each digit from 9 and
adding one to the result. For example, the 10's complement for 7556 is calcu-
lated as follows: 9999 – 7556 + 1 = 2444. For a four digit number, the 10's
complement of A is 9999 – A + 1 = B. To obtain the true number from the 10's
complement B: A = 10000 – B. For example, to obtain the true number from
the 10's complement 2444: 10000 – 2444 = 7556.
Multiplies 4-digit signed hexadecimal data and/or constants.
*(420)
Md
Mr
R
Label
ON when Mi and/or Mi +1 are not BCD.
ON when Su and/or Su +1 are not BCD.
OFF in all other cases.
ON when the result is 0.
OFF in all other cases.
ON when the subtraction results in a borrow.
OFF in all other cases.
Md: Multiplicand word
Mr: Multiplier word
R: Result word
Section 3-11
Operation

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents