Download Print this page

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

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

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

DNEG(P)
These instructions invert the sign of the 32-bit binary data in the device specified by (d), and store the resultant data in the
device specified by (d).
Ladder diagram
(d)
FBD/LD
EN
ENO
d
Setting data
■Descriptions, ranges, and data types
Operand
Description
(d)
Head device for storing the data that performs two's
complement
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(d)
Processing details
• These instructions invert the sign of the 32-bit binary data in the device specified by (d), and store the resultant data in the
device specified by (d).
• They are used when a positive or negative sign is to be inverted.
b31
Before execution
(d)
1
1
1
1
0
0
0
Sign conversion
1
1
1
-
b31
(d)
After execution
0
0
0
Precautions
Note that data is inverted in every operation cycle in a continuous operation type (DNEG) instruction.
Operation error
There is no operation error.
Word
T, ST, C, D, W,
U\G
SD, SW, R
∙∙∙
1
1
1
1
0
1
0
0
0
0
0
0
1
1
1
1
0
1
∙∙∙
0
0
0
0
1
0
Structured text
ENO:=DNEG(EN,d);
ENO:=DNEGP(EN,d);
Range
Data type
-2147483648 to +2147483647
32-bit signed binary
Bit
Bit
Double word Indirect
specification
Z
LC
LZ
b0
∙∙∙ -218460
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
b0
1
1
1
0
0
∙∙∙ 218460
Data type (label)
ANY32
BOOL
BOOL
Constant
Others
K, H
E
$
7 BASIC INSTRUCTIONS
7.5 Data Conversion Instructions
7
325

Hide quick links:

Advertisement

loading