Mitsubishi — 5.6 Descriptions of the Applied Instructions

AH500 Motion Control Module Manual  S 1 : Dividend; S 2 : Divisor; D : Quotient and remainder  The singed binary value in S 1 is divided by the signed binary value in S 2 . The quotient and the remainder are stored in D . Users have to notice the sign bits in S 1 , S 2 , and D when 16-bit binary division or 32-bit binary division is done.  If the divisor in S 2 is 0, the instruciton will not be executed.

 16-bit binary division Explanation Quotient Remainder S 1 S 2 D D +1 b15..............b0 = / b15..............b0 b15..............b0 b15..............b0  32-bit binary division Quotient Remainder S 1 S 2 S 1 S 2 +1 D D +1 D +3 D +2 +1 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 b15.....b0 / =  When X0.0 is ON, the dividend in D0 is divided by the divisor in D10, the quotient is stored in D20, and the remainder is stored in D21. Whether the quotient and the remainder are positive values or negative values depends on the leftmost bit in D20 and the leftmost bit in D21.

Example X0.0 5-42 API Instruction code Operand Function 23 D DIV P S , S , D 1 2 Binary division Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S 1           S 2           D     Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (9 step s)    .0 DIV D0 D10 D20 DIV D0 D10 K4M0