Delta DVP-ES2 — 3.8 Detailed Instruction Explanation

DVP-ES2/EX2/SS2/SA2/SX2/SE&TP Operation Manual - Programming Program Example 1: When X0 is ON, the dividend K103 in D0 is divided by the divisor K5 in D10, and the quotient is stored in D20. Whether the quotient is a positive value or a negative value depends on the leftmost bit in D20. X0 D0/D10=D20  K103/K5=K20, the remainder is K3.  D20=K20 (The remainder is left out.) Program Example 2: When X0 is ON, the dividend K81,000 in (D1, D0) is divided by the divisor K40,000 in (D11, D10), and the quotient is stored in (D21, D20). Whether the quotient is a positive value or a negative value depends on the leftmost bit in (D21, D20).

X0 (D1,D0)/(D11,D10)=(D21,D20)  K81,000/K40,000=K2, The remainder is K1,000.  (D21,D20)=K2 (The remainder is left out.) Note: 1. If users want to store the remainder of a 16-bit bianry division, they have to use API23 DIV/DIVP. Please refer to the explanation of API23 DIV/DIVP for more information. 2. If users want to store the remainder of a 32-bit bianry division, they have to use API23 DDIV/DDIVP. Please refer to the explanation of API23 DDIV/DDIVP for more information. 3-322 DIV16 D0 D10 D20 DIV32 D0 D10 D20