Automationdirect.com DirectLOGIC DL205 Series User Manual page 329

Table of Contents

Advertisement

Chapter 5: Standard RLL Instructions - Math
Divide Formatted (DIVF)
1
Divide Formatted is a 16-bit instruction that divides the BCD
230
value in the accumuator by the BCD value (Aaaa), a range of
240
discrete bits. The specified range (Kbbb) can be 1 to 16
2
250-1
consecutive bits. The first part of the quotient resides in the
accumulator and the remainder resides in the first stack
260
3
location.
DS
Used
4
HPP Used
Inputs
5
Outputs
Control Relays
Stage Bits
6
Timer Bits
Counter Bits
7
Special Relays
Global I/O
Constant
8
Discrete Bit Flags
9
SP63
SP70
SP75
10
NOTE: Status flags are valid only until another instruction uses the same flag.
11
In the following example, when X6 is on, the value formed by discrete locations X0–X3 is
loaded into the accumulator using the Load Formatted instruction. The value in the
12
accumulator is divided by the value formed by discrete location C0–C3 using the Divide
Formatted instruction. The value in the lower four bits of the accumulator is copied to
Y10–Y13 using the Out Formatted instruction.
13
DirectSOFT
14
X6
A
B
Handheld Programmer Keystrokes
C
$
STR
SHFT
D
SHFT
GX
OUT
5–112
DL205 User Manual, 4th Edition, Rev. B
Operand Data Type
A
X
Y
C
S
T
CT
SP
GX/GY
K
On when the result of the instruction causes the value in the accumulator to be zero.
On anytime the value in the accumulator is negative.
On when a BCD instruction is executed and a NON-BCD number was encountered.
Load the value represented
LDF
X0
by discrete locations X0- - X3
K4
into the accumulator
Divide the value in the
DIVF
C0
accumulator with the value
K4
represented by discrete
location C0- - C3
Copy the lower 4 bits of the
OUTF
Y10
accumulator to discrete
K4
locations Y10- - Y13
G
ENT
6
L
D
F
A
ANDST
3
5
0
I
V
F
D
NEXT
3
8
AND
5
F
B
A
SHFT
5
1
0
DL260 Range
aaa
0-1777
0-1777
0-3777
0-1777
0-377
0-377
0-777
0-3777
-
Description
X3
ON
The unused accumulator
bits are set to zero
0
0
0
0
_ . .
Acc.
0
0
0
0
E
ENT
4
A
E
NEXT
NEXT
NEXT
0
4
E
ENT
4
DIVF
K bbb
bbb
-
-
-
-
-
-
-
-
1-16
X2
X1
X0
OFF
OFF
OFF
(Accumulator)
0
0
0
8
C3
C2
OFF
OFF
2
(C0- - C3)
0
0
0
4
0
0
0
0
0
0
0
0
First stack location contains
the remainder
Y13
Y12
Y11
Y10
OFF
ON
OFF
OFF
ENT
A aaa
C1
C0
ON
OFF

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?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF