Delta AH500 — 6.3.2 Explanation of Data Conversion Instructions

Chapter 6 Applied Instructions API 0210 Symbol: D : Device in which the two’s complement is stored Word/Double word Explanation: 1. The instruction is used to convert the negative binary value into the absolute value. 2. Only the instruction DNEG can use the 32-bit counter. 3. Generally, the pulse instructions NEGP and DNEGP are used. Example 1: When X0.0 is switched from OFF to ON, all bits in D0 are inverted (0 becomes 1, and 1 becomes 0), and 1 is added to the result. The final value is stored in the original register D10. Example 2: The absolute value of the negative value: 1. When the value of the 15 th bit in D0 is 1, M0 is ON. (The value in D0 is a negative value.) 2.

When M0 is ON, the instruction NEG is used to obtain the two’s complement of the negative value in D0. (The corresponding positive value is obtained.) 6-91 Instruction code Operand Function D NEG P D Two’s complement Device X Y M S T C HC D L SM SR E PR K 16# “$” DF D           Pulse instruction 16-bit instruction (3 steps) 32-bit instruction (3 steps) AH500 AH500 AH500