Delta AS Series Programming Manual page 330

Hide thumbs Also See for AS Series:
Table of Contents

Advertisement

Example 1
Subtracting 16-bit binary values: when X0.0 is ON, the instruction subtracts the subtrahend in D10 from the minuend in
D0, and stores the difference in D20.
When the values in D0 and D10 are 100 and 10 respectively, D0 minus D10 leaves 90, and 90 is stored in D20.
When the values in D0 and D10 are 16#8000 and 16#1 respectively, D0 minus D10 leaves 16#7FFF, and
16#7FFF is stored in D20.
When the values in D0 and D10 are 16#1 and 16#2 respectively, D0 minus D10 leaves 16#FFFF. Since borrowing
occurs during the operation, SM601 is ON, and the value stored in D20 is 16#FFFF.
When the values in D0 and D10 are 16#0 and 16#FFFF respectively, D0 minus D10 leaves 16#F0001. Since
borrowing occurs during the operation, SM601 is ON, and the value stored in D20 is 16#1.
Example 2
Adding 32-bit binary values: when X0.0 is ON, the instruction subtracts the subtrahend in (D41, D40) from the minuend in
(D31, D30), and stores the sum in (D51, D50). The data in D30, D40, and D50 is the lower 16-bit data, whereas the data
in D31, D41, and D51 is the higher 16-bit data.
When the values in (D31, D30) and (D41, D40) are 55555555 and 11111111 respectively, (D31, D30) minus (D41,
D40) D10 leaves 44444444, and 44444444 is stored in (D51, D50).
When the values in (D31, D30) and (D41, D40) are 16#80000000 and 16#FFFFFFFF respectively, (D31, D30)
minus (D41, D40) leaves 16#F80000001. Since borrowing occurs during the operation, SM601 is ON, and the
value stored in (D51, D50) is 16#80000001.
Ch a pt er 6 A pp l i e d I n s tr uc t io ns
6_
6 - 5 1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents