4

Exclusive OR (XOR)

The XOR function compares each bit in the first specified register against each corresponding bit in the second specified register. If both bits are the same (1 or 0), it places a 0 in the corresponding bit of the third register. If the bits are different, it places a 1 in the corresponding location in the third register.

Example:

R1

XOR

R2

46147

0

0

0

0

0

0

0

0

1

0

1

0

1

0

1

0

(170)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0

0

0

0

0

0

0

0

0

0

0

1

1

1

1

(15)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R3

0 0 0 0 0 0 0 0

1 0 1 0 0

1 0 1

(165)

Programming Software Instructions

1.Select Logic (F7)

2.Select XOR (F3) from the Logic function keys.

3.Enter the register location of the first number to be XORed. Press the Enter key.

4.Enter the register location of the second number to be XORed. Press the Enter key.

5.Enter a register for the result to be placed in. Press the Enter key.

Example and HHP Instructions

Ladder Diagram

X

[ R1 O R2! R3]

R

46148

Hand-held Programmer

START

LOGIC F3R1 R2 R3

OUTF1

GFK-0804B

Chapter 4 The Micro PLC Instruction Set

4-41

Page 82
Image 82
GE GFK-0804B manual Exclusive or XOR