2'S Complement: Neg(104) - Omron CVM1D Operation Manual

Hide thumbs Also See for CVM1D:
Table of Contents

Advertisement

Conversion Instructions

5-17-5 2'S COMPLEMENT: NEG(104)

Ladder Symbol
(104)
NEG
Variations
j NEG(104)
Description
Precautions
Flags
Example
0000
08
S+1: CIO 0011
0
0
MBS
7
6
x16
x16
2X16
R+1: D00101
0
2
MBS
7
6
x10
x10
Operand Data Areas
S: Source word
S
R
R: Result word
When the execution condition is OFF, NEG(104) is not executed. When the
execution condition is ON, NEG(104) converts the 4-digit hexadecimal content
of the source word (S) to its 2's complement and outputs the result to the result
word (R). This operation is effectively the same as subtracting S from $0000 and
outputting the result to R.
Refer to page 101 for general precautions on operand data areas.
Content of *DM word is not BCD when set for BCD.
ER (A50003):
EQ (A50006):
Content of S is 0 (the content of R will also be 0 after execu-
tion)
N (A50008):
Shows the status of bit 15 of R after execution.
When CIO 000008 is ON in the following example, the 4-digit hexadecimal con-
tent of CIO 0005 is converted to its 2's complement equivalent and stored in
D00020.
(104)
NEG
0005 D00020
0005
0
D00020
0
The bit contents of word 0005 and word D00020 after execution is as follows.
0005
D00020
2
D
3
5
4
3
x16
x16
x16
5
4
3
2
+13X16
+3X16
+2X16
+10=2961930
9
6
1
5
4
3
x10
x10
x10
CIO, G, A, T, C, #, DM, DR, IR
CIO, G, A, DM, DR, IR
Address Instruction
befor
execution
0
0
1
0005
0
0
0
D00020
0
0
0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
F
F
F
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Section 5-17
S: CIO 0010
2
0
A
2
1
0
x16
x16
x16
R: D00100
9
3
0
2
1
0
x10
x10
x10
Operands
00000
LD
000008
00001
NEG(104)
D00020
after
execution
0
0
0
1
F
F
F
F
1
F
LSB
LSB
0005
211

Advertisement

Table of Contents
loading

Table of Contents