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

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

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

NEG(P)
RnPCPU
RnPCPU
RnCPU RnENCPU
(Process)
(Redundant)
Invert the sign of 16-bit binary device.
Ladder
(d)
FBD/LD
EN
ENO
d
■Execution condition
Instruction
NEG
NEGP
Setting data
■Description, range, data type
Operand
Description
(d)
Device where the data subjected to two's complement is
stored
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L,
J\
SM, F, B, SB,
FX, FY
(d)
Processing details
• These instructions invert the sign of the 16-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.
b15
Before execution
(d)
1
0
1
1
0
0
0
Sign conversion
1
0
1
-
b15
After execution
(d)
0
1
0
RnSFCPU RnSFCPU
(Standard)
(Safety)
Execution condition
Word
T, ST, C, D, W,
U\G, J\,
SD, SW, FD, R,
U3E\(H)G
ZR, RD
∙∙∙
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
∙∙∙
1
0
1
0
1
0
1
0
ST
ENO:=NEG(EN,d);
ENO:=NEGP(EN,d);
Range
Data type
16-bit signed binary
Bit
Bit
Double word Indirect
Z
LT, LST,
LZ
LC
b0
0
1
0
1
0
∙∙∙ -21846
0
0
0
0
0
0
1
0
1
0
b0
∙∙∙ 21846
1
0
1
1
0
Data type (label)
ANY16
BOOL
BOOL
Constant
specification
K, H E
$
6 BASIC INSTRUCTIONS
6.6 Data Conversion Instructions
6
Others
467

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents