AH500 Programming Manual API 0118 Symbol : S 1 : Dividend Word/Double Word S 2 : Divisor Word/Double Word D : Quotient Word/Double Word Explanation: 1. 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 . 2. Only the 32-bit instructions can use the 32-bit counter. 3. When the sign bit is 0, the value is a positive one. When the sign bit is 1, the value is a negative one. 4. The division of 16-bit values: Quoti ent S 1 S 2 D b15..............b0 b15..............b0 b15..............b0 = / The quotient D occupies one consecutive device and the quotient is stored in D. 5. The division of 32-bit values:
Quoti ent S 1 S 2 S 1 S 2 +1 D+1 D +1 b15...b0 b15.....b0 b15...b0b1 5.....b0 b15...b0 b15.....b0 / = The operand D occupies two devices. The quotient is stored in ( D +1, D) 6-72 Instruction code Operand Function DIV16 DIV32 P S ,S ,D 1 2 Division of binary numbers for 16-bit/32-bit Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1 S 2 D Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (7 steps) AH500 AH500 AH500