6F3B0253
232 T1-16S User’s Manual
7. Instructions

FUN 182 NEG 2’s complement

Expression
Input [ A NEG B ] Output
Function
When the input is ON, this instruction finds the 2’s complement value of A, and stores it in B.
Execution condition
Input Operation Output
OFF No execution OFF
ON Execution ON
Operand
Name Device Register Constant Index
X Y R S T. C. XWYWRWSW T C D I J K
ASource √√√√√√√√√√ √
BDestination √√√√√√√√√
Example
When X007 is ON, the 2’s complement value (sign inverted data) of RW39 is stored in D0122.
For example, if RW38 is 4660, the 2’s complement value -4660 is stored in D0122.
2’s complement data is calculated as follows.
FEDCBA9876543210
RW39 0001001000110100 (4660)
1110110111001011 (-4661)
D0122 1110110111001100 (-4660)
Note
The data range of A is -32768 to 32767. If the data of A is -32768, the same data -32768 is
stored in B.
Bit inverse
+ 1