Applied Instructions
《16 bits operation》
DIV D0 D2 D4
X0
S1· S2· D·
《32 bits operation》
DDIV D0 D2 D4
X1
S1· S2· D·
DDIV D0 D2 D4
X1
S1· S2· D·
Function & Action
Dividend Divisor Result Remainder
BIN BIN BIN BIN
(D0)
÷ (D2) → D4) ┅ (D5)
16 bits 16 bits 16 bits 16 bits
Dividend Divisor Result Remainder
BIN BIN BIN BIN
(D1,D0)
÷ (D3,D2) (D5,D4)┅ (D7,D6)
32 bits 32 bits 32 bits 32 bits
appoints the device’s content be the dividend, appoints the device’s content be the
divisor ppoints the device and the next one to store the result and the remainder.
In the above example, if input X0 is ON, devision operation is executed every scan cycle.
z
, a
z
S1·
S2·
D·
z The dividend is composed by the device appointed by and the next one. The
divisor is com osed by the device appointed by and the next one. The result and the
remainder are stored in the four sequential devices, the first one is appointed by
z If the value of the divisor is 0, then an operation error is executed and the operation of
the DIV instruction is cancelled.
z The highest bit of the result and remainder is the sym ol bit (positive:0, negative: 1).
When any of the dividend or the divisor is negative, then the result will be negative.
When the dividend is negative, then the remainder will be negative.
p
S1·
S2·
D·
[DIV]
16 bits instruction:DIV 32 bits instruction:DDIV
Suitable Models:
XC1、XC3、XC5
Zero M8020
Borrow M8021
Flag
Carry M8022
Word
Device
Bit
Device
X
Y
M
S
T
C
Dn.m
D
FD
DM
DX
DY
DS
TD
CD
K/H
S1·
S2·
D·
b
94