Bit Operation Instructions - Automationdirect.com DirectLOGIC DL205 Series User Manual

Table of Contents

Advertisement

Bit Operation Instructions

Sum (SUM)
The Sum instruction counts number of bits that are set to "1"
230
in the accumulator. The HEX result resides in the accumulator.
240
250-1
260
Math Function
SP63
DS
Used
HPP Used
In the following example, when X1 is on, the value formed by discrete locations X10–X17 is
loaded into the accumulator using the Load Formatted instruction. The number of bits in the
accumulator set to "1" is counted using the Sum instruction. The value in the accumulator is
copied to V1500 using the Out instruction.
DirectSOFT
X1
LDF
K8
Load the value represented by
discrete locations X10–X17
into the accumulator
SUM
Sum the number of bits in
the accumulator set to "1"
OUT
V1500
Copy the value in the lower
16 bits of the accumulator
to V1500
Handheld Programmer Keystrokes
$
B
ENT
STR
1
L
D
F
SHFT
ANDST
3
5
S
U
SHFT
SHFT
RST
ISG
GX
PREV
PREV
OUT
Chapter 5: Standard RLL Instructions - Bit Operation
On when the result of the instruction causes the value in the accumulator to be zero.
X10
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Acc.
0
0 0
0 0 0
B
A
I
1
0
8
M
ENT
ORST
B
F
A
A
PREV
1
5
0
0
Range of Argument
The unused accumulator
bits are set to zero
15 14 13 12 11 10 9
0 0
0 0
0 0 0 0 0 0
0 0 0
0
0
0
0
0
0
Acc.
0
0
V1500
ENT
ENT
DL205 User Manual, 4th Edition, Rev. B
SUM
X17
X16
X15
X14
X13
X12
X11
ON
ON
OFF
OFF
ON
OFF
ON
8 7 6 5
4 3 2
0 0 0 0
0 1 1
0 0 1 0
0
5
0
5
5–123
1
2
3
4
5
6
7
X10
ON
8
9
1 0
1 1
10
11
12
13
14
A
B
C
D

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?

Table of Contents

Save PDF