Two's Complement Of 32-Bit Binary Data (Sign Inversion) - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Motion module instructions, standard functions/ function blocks
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Two's complement of 32-bit binary data (sign inversion)

DNEG
This instruction inverts the sign of 32-bit binary device.
ST
ENO:=DNEG(EN,d);
■Execution condition
Instruction
DNEG
Setting data
■Description, range, data type
Operand
Description
(d)
Start device where the data subjected to two's complement is stored
EN
Execution condition
ENO
Execution result
■Applicable devices/labels
Operand
Bit
SB
(d)
Processing details
• This instruction inverts the sign of the 32-bit binary data in the device specified by (d) and store the inverted data in the
device specified by (d).
• The instructions are used to invert positive and negative signs.
b31
Before execution
(d)
1
1
1
1
0
0
0
Sign conversion
1
1
1
-
b31
After execution
(d)
0
0
0
Operation error
There is no operation error.
Execution condition
Word
RX, RY, LB
SW
∙∙∙
1
1
1
1
0
1
0
0
0
0
0
0
1
1
1
1
0
1
∙∙∙
0
0
0
0
1
0
Range
G, RWw, RWr, LW
b0
0
0
1
0
0
∙∙∙ -218460
0
0
0
0
0
0
0
1
0
0
b0
∙∙∙ 218460
1
1
1
0
0
Data type
ANY32
BOOL
BOOL
Constant
K, H
6 BASIC INSTRUCTIONS
6.3 Data Conversion Instructions
6
85

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents