6F3B0250
Basic Hardware and Function 251
7. Instructions

FUN 183 DNEG Double-word 2’s complement

Expression
Input -[
A+1
×
A
DNEG
B+1
×
B
]- Output
Function
When the input is ON, this instruction finds the 2’s complement value of double-word data
A+1
×
A
, and
stores it in
B+1
×
B
.
Execution condition
Input Operation Output
OFF No execution OFF
ON Execution ON
Operand
Name Device Re
g
ister Constant Index
X Y R S T. C. XW YW RW SW T C D I J K
A
Source ÖÖÖÖÖÖÖ Ö
B
Destination ÖÖÖÖÖÖ
Example
When X 007 is O N, t he 2’s com plement value (sign inverted dat a) of double-word regist er
RW41×RW40 is stored in double-word register D0151×D0150.
For example, if RW41×RW40 is -1234567890, the 2’s complement value 1234567890 is stored in
D0151×D0150.
Note
· The data range of
A+1
×
A
is -2147483648 to 2147483647. If the data of
A+1
×
A
is -2147483648, the
same data -2147483648 is st or ed in
B+1
×
B
.
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net