Hitachi HIDIC MICRO-EH Applications Manual page 99

Table of Contents

Advertisement

Item number
Arithmetic instructions-4
Ladder format
d = s1 – s2
Instruction format
d = s1 – s2
Usable I/O
d
Substitution destination
s1
Minuend
s2
Subtrahend
Function
Subtracts s2 from s1 as the binary data, and substitutes the result into d as the binary data.
The C flag is set to "1" if there is a digit decrease, and "0" if not.
C = s1m s2m + s1m dm + s2m dm
The V flag is set to "1" if the operation result is a meaningless signed-binary data, and "0" if it has meaning.
s1
s2
Positive
Positive
Negative
Negative
Positive
Negative
Positive
Negative
Negative
Positive
Negative
Positive
Notes
The combinations of d, s1 and s2 are as follows:
d
Word
Double word
Double word
Program example
X00000
Program description
When input X00000 is on, the difference between WR0000 value and WR0001 value is substituted into WR0002.
Name
Condition code
R7F4
R7F3
R7F2
DER
ERR
SD
Number of steps
Condition
Word
Double word
Bit
R,
TD, SS,
X
Y
M
CU, CT
WX WY
d
V
Positive/Negative
0
Positive/Negative
0
Positive
0
Negative
1
Positive
1
Negative
0
s1
s2
Word
Word
Double word
WR0002 = WR0000 - WR0001
5-49
Chapter 5 Instruction Specifications
Binary subtraction (BINARY SUBTRACTION)
Processing time (µs)
R7F1
R7F0
Average Maximum
V
C
41
Steps
4
58
6
Word
Double word
WR,
DR,
WM TC DX DY
DM
Most significant bit
s1m
s2m
dm
C
V = s1m s2m dm + s1m s2m dm
LD X00000
[
WR0002 = WR0000 - WR0001
]
Remark
Upper case: W
Lower case: DW
Other
0
s1
0
s2
0
d

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents