Download Print this page

Two's Complement Of 16-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 16-bit binary data (sign inversion)

NEG(P)
These instructions invert the sign of the 16-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 16-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.
b15
Before execution
(d)
1
Sign conversion
-
b15
After execution
(d)
Precautions
Note that data is inverted in every operation cycle in a continuous operation type (NEG) instruction.
Operation error
There is no operation error.
7 BASIC INSTRUCTIONS
324
7.5 Data Conversion Instructions
Word
T, ST, C, D, W,
SD, SW, R
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
0
0
1
0
1
0
1
0
1
Structured text
ENO:=NEG(EN,d);
ENO:=NEGP(EN,d);
Range
-32768 to +32767
Double word Indirect
U\G
Z
LC
∙∙∙
1
0
1
0
1
0
1
0
0
0
0
0
0
0
1
0
1
0
1
0
1
∙∙∙
0
1
0
1
0
1
1
Data type
16-bit signed binary
Bit
Bit
Constant
specification
LZ
K, H
b0
∙∙∙ -21846
0
0
0
b0
0
∙∙∙ 21846
Data type (label)
ANY16
BOOL
BOOL
Others
E
$

Hide quick links:

Advertisement

loading