Mitsubishi — 5.6 Descriptions of the Applied Instructions

Chapter 5 Applied Instructions  S 1 : Source device 1; S 2 : Source device 2; D : Operation result  A logical XOR operator takes the binary representations in S 1 and S 2 , and performs the logical exclusive OR operation on each pair of corresponding bits. The operation result is stored in D .  The result in each position is 1 if the two bits are different, and 0 if they are the same. Explanation Example 1  When X0.0 is ON, a logical XOR operator takes the values in the 16-bit device D0 and the 16-bit device D2, and performs the exclusive OR operation on each pair of corresponding bits, and the operation result is stored in D4.

X0.0 Before the instruction is executed S 1 D0 b15 b0 S 2 D2 WXOR After the instruction is executed D D4 Example 2  When X0.1 is ON, a logical XOR operator takes the values in the 32-bit device (D11, D10) and the 32-bit device (D21, D20), and performs the logical exclusive OR operation on each pair of corresponding bits, and the operation result is stored in (D41, D40).

Before the instruction is executed D11 D10 b15 b0 b31 S 1 1 D21 D20 S 2 DWXOR After the instruction is executed D41 D40 D 5-47 API Instruction code Operand Function Logical exclusive OR operation 28 D WXOR P S , S , D 1 2 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 steps)    WXOR D0 D2 D4 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 DWXOR D10 D20 D40 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1 1 1 0 1 1 0 1 0 0 1 1 1 0 1 1