Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 402

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Symbol Math Instructions
Precautions
Note
Examples
Note
3-10-17 SIGNED BINARY MULTIPLY: *(420)
Purpose
Ladder Symbol
Variations
Applicable Program Areas
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.
To clear the Carry Flag (CY), execute the Clear Carry (CLC(041)) instruction.
When CIO 0.01 is ON in the following example, D1101, D1100, and CY will be
subtracted from D1001 and D1000 as 8-digit BCD values, and the result will
be output to D1201 and D1200.
0.01
D1000
D1100
D1200
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.
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
Variations
Executed Each Cycle for ON Condition
Executed Once for Upward Differentiation
Executed Once for Downward Differentiation Not supported.
Immediate Refreshing Specification
Block program areas
Step program areas
OK
OK
Md: Multiplicand word
Mr: Multiplier word
R: Result word
Subroutines
OK
Section 3-10
*(420)
@*(420)
Not supported.
Interrupt tasks
OK
369

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents