GE 90-30/20/Micro manual XOR Word

Models: 90-30/20/Micro

1 311
Download 311 pages 52.91 Kb
Page 132
Image 132

4

XOR (WORD)

The Exclusive OR (XOR) function is used to compare each bit in bit string I1 with the corresponding bit in string I2. If the bits are different, a 1 is placed in the corresponding position in the output bit string.

Each scan that power is received, the function examines each bit in string I1 and the corresponding bit in string I2, beginning at the least significant bit in each. For each two bits examined, if only one is 1, then a 1 is placed in the corresponding location in bit string Q. The XOR function passes power flow to the right whenever power is received.

If string I2 and output string Q begin at the same reference, a 1 placed in string I1 will cause the corresponding bit in string I2 to alternate between 0 and 1, changing state with each scan as long as power is received. Longer cycles can be programmed by pulsing the power flow to the function at twice the desired rate of flashing; the power flow pulse should be one scan long (one-shot type coil or self-resetting timer).

The XOR function is useful for quickly comparing two bit strings, or to blink a group of bits at the rate of one ON state per two scans.

 

_____

 

(enable)

 

(ok)

 

 

WORD

 

(input parameter I1)

—I1

Q— (output parameter Q)

 

 

 

 

(input parameter I2)

—I2

 

_____

Parameters:

 

 

 

Parameter

Description

 

 

 

 

enable

When the function is enabled, the operation is performed.

 

 

I1

I1 contains a constant or reference for the first word to be XORed.

 

 

I2

I2 contains a constant or reference for the second word to be XORed.

 

 

ok

The ok output is energized whenever enable is energized.

 

 

Q

Output Q contains the result of I1 XORed with I2.

 

 

GFK-0467K

Chapter 4 Series 90-30/20/Micro Instructions Set

4-51

Page 132
Image 132
GE 90-30/20/Micro manual XOR Word