Omron SYSMAC CVM1 Series Operation Manual page 283

Duplex system
Hide thumbs Also See for SYSMAC CVM1 Series:
Table of Contents

Advertisement

Symbol Math Instructions
Flags
Using SIGNED BINARY SUBTRACT Instructions
Numeric Example 1
Numeric Example 2
ER (A50003):
The content of a*DM word is not BCD when set for BCD.
CY (A50004):
The subtraction resulted in a borrow.
EQ(A50006)
The contents of word R (or word R and R+1 for "double"
instructions) after the subtraction is all zeros
N (A50008)
The leftmost bit (MSB) of word R (or word R+1 for "double"
instructions) after the subtraction is "1."
OF (A50009)
Mi is a positive number, Su is negative, and the subtraction
result is negative.
UF (A50010)
Mi is a negative number, Su is positive, and the subtraction
result is positive.
The range for signed data is –32,768 to 32,767 in decimal (–2,147,483,648 to
2,147,483,647 for "double" instructions), and 8000 to FFFF and 0000 to 7FFF in
hexadecimal (8000 0000 to FFFF FFFF and 0000 0000 to 7FFF FFFF for
"double" instructions).
Negative numbers are expressed as 2's complements. If the result of the sub-
traction is within the range of 8000 to FFFF, it represents a signed negative num-
ber and the Negative Flag (A50008) turns ON.
When Mi is a positive number, Su is negative and the subtraction result is nega-
tive, the Overflow Flag (A50009) turns ON. When Mi is a negative number, Su is
positive, and the subtraction result is positive, the Underflow Flag (A50010)
turns ON. If a subtraction result in a borrow, the Carry Flag turns ON.
The range for unsigned binary data is 0000 to FFFF (0000 0000 to FFFF FFFF
for "double" instructions), so the decimal range would be 0 to 65,535 (0 to
4,294,967,295). When data is unsigned, the Carry Flag turning ON indicates
that the subtraction result is negative. The result is expressed as 2's comple-
ment, so in order to find the true answer, the 2's complement must be subtracted
from 0.
FFFF
H
–)
0001
H
FFFE
H
Negative Flag ON
Carry Flag OFF
FFFD
H
–)
FFFF
H
FFFE
H
Negative Flag ON
Carry Flag ON
Note
1. Because the Negative Flag is ON, the result (FFFE) is a negative number
(2's complement) and is expressed as –2.
2. The Carry Flag is OFF and the result (FFFE) is an unsigned positive number
(65,534).
3. The Carry Flag is ON so the result (FFFE) is an unsigned negative number
(2's complement) and becomes –2 when converted.
Signed data
–1
–)
+1
–2 (Note 1)
Signed data
–3
–)
–)
–1
–2 (Note 1)
Section 5-20
Unsigned data
65535
–)
1
65534 (Note 2)
Unsigned data
65533
65535
–2 (Note 3)
265

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cv seriesSysmac cvm1d series

Table of Contents