
256
Example
In the following example, DBS(––) is used to divide the signed binary contents of
IR 001 with the signed binary contents of DM 0020 and output the result to LR 21
and LR 22.
DBS(––)
001
DM 0020
LR 21
Address
Instruction
Operands
00000
LD
00000
00001
DBS(––)
001
DM
0020
LR
21
00000
Dd: IR 001
D
D
D
A
Dr: DM 0020
0
0
1
A
R: LR 21
F
E
B
0
÷
R+1: LR 22
F
F
F
A
(–8,742)
(26)
(–336 and –6)
Remainder (–6)
Quotient (–336)
5-20-10 DOUBLE SIGNED BINARY DIVIDE – DBSL(––)
Dd
: Dividend word (binary)
IR, SR, AR, DM, HR, TC, LR
Dr
: Divisor word (binary)
IR, SR, AR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
R
: First result word
IR, SR, AR, DM, HR LR
DBSL(––)
Dd
Dr
R
@DBSL(––)
Dd
Dr
R
Limitations
Dd and Dd+1 must be in the same data area, as must Dr and Dr+1, and R
through R+3.
Description
DBS(––) divides the 32-bit (8-digit) signed binary data in Dd+1 and Dd by the
32-bit signed binary data in Dr+1 and Dr, and outputs the 16-digit signed binary
result to R+3 through R. The quotient is placed in R+1 and R, and the remainder
is placed in R+3 and R+2. Refer to page 27 for details on signed binary data.
R+1
R
Quotient
Remainder
Dd+1
Dd
Dr+1
Dr
R+3
R+2
Flags
ER:
Dr+1 and Dr contain 0.
Indirectly addressed DM word is non-existent. (Content of
DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ
:
ON when the content of R+1 and R (the quotient) is 0, otherwise OFF.
N
:
ON when bit 15 of R+1 is set to 1.
Binary Calculations
Section 5-20
Summary of Contents for SYSMAC C200HE
Page 1: ...Cat No W303 E1 09 OPERATION MANUAL Programmable Controllers C200HX C200HG C200HE ...
Page 2: ......
Page 3: ...C200HX C200HG C200HE Programmable Controllers Operation Manual Revised August 2004 ...
Page 6: ...vi ...
Page 10: ......
Page 12: ......
Page 380: ......
Page 410: ......
Page 438: ......
Page 464: ......
Page 474: ......
Page 522: ......
Page 538: ......
Page 552: ...534 Programmer Program Date Page Word Contents Notes Word Contents Notes Data Storage ...
Page 554: ......
Page 560: ......
Page 584: ......
Page 585: ......
Page 586: ...W303 E1 09 ...