Hitachi NJI-350B User Manual
Page 138

Chapter 5 Instruction Specifications
5-88
Item number
Application instructions-16
Name
Two's complement (NEGATE)
Ladder format
Condition code
Processing time (
µs)
Remark
R7F4
R7F3
R7F2
R7F1
R7F0
Average Maximum
NEG (d)
DER
ERR
SD
V
C
Upper case: W
z
z
z
z
z
22
Lower case: DW
Instruction format
Number of steps
Condition
Steps
NEG (d)
2
29
Bit
Word
Double word
Usable I/O
X
Y
R,
M
TD, SS,
CU, CT
WX WY
WR,
WM TC DX DY
DR,
DM
C
o
nstant
Other
d
I/O to take complement
{
{
{
{
Function
• Calculates two's complements of d (Reverses each bit contained in d and adds “1.” However, C (R7F0) remains
unchanged).
1
1
0
0
1
1
0
0
0
0
0
1
1
0
1
0
0
0
1
1
0
0
1
1
1
1
1
0
0
1
0
1
0
0
1
1
0
0
1
1
1
1
1
0
0
1
1
0
1
Before execution
After execution
+
Notes
• Use edge trigger as the startup condition for this instruction.
Program example
LD
R000
AND DIF0
[
NEG WR0000
]
NEG (WR0000)
R000
DIF0
Program description
• When R000 rises, 2's complement of the content of WR0000 is obtained.
Example) If WR0000 is H1234, WR0000 = HEDCC after the instruction is executed;
WR0000 = H1234 when executed again
NE
G (d)