Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 400

Table of Contents

Advertisement

3. Instructions
Function
–B
–B(414) subtracts the BCD values in Su from Mi and outputs the result to R. If the result of the
subtraction is negative, the result is output as a 10's complement.
–BL
–BL(415) subtracts the BCD values in Su and Su+1 from Mi and Mi+1 and outputs the result to R, R+1.
If the result is negative, it is output to R, R+1 as a 10's complement.
Hint
• 10's Complement
A 10's complement is the value obtained by subtracting each digit from 9 and adding one to the
result. For example, the 10's complement for 7556 is calculated as follows: 9999 - 7556 + 1 = 2444.
For a four digit number, the 10's complement of A is 9999 – A + 1 = B. To obtain the true number from
the 10's complement B: A = 10000 – B. For example, to obtain the true number from the 10's
complement 2444: 10000 – 2444 = 7556.
Example: 9,583,960 – 17,072,641 = -7,488,681. (BCD)
In this example, the eight-digit BCD content of CIO 121 and CIO 120 is subtracted from the content of
CIO 201 and CIO 200, and the result is output in eight-digit BCD to D101 and D100. The result is
negative, so the instruction at (2) will be executed, and the true value will then be output to D101 and
D100.
364
Mi
Su
CY will turn ON
CY
R
when there is a
borrow.
Mi +1
Su+1
CY will turn ON
R+1
CY
when there is a
borrow.
0.00
CY
(BCD)
(BCD)
(BCD)
Mi
(BCD)
Su
(BCD)
R
(BCD)
RSET
21.00
BL
(1)
200
120
D100
BL
(2)
#00000000
D100
D100
CY
SET
" " display
21.00
CS/CJ/NSJ Series Instructions Reference Manual (W474)

Advertisement

Table of Contents
loading

Table of Contents