LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XOR behaving strangley

Solved!
Go to solution

Untitled.png

 

65 XOR 0 = 65... why does labview think the answer is -66?!

 

0 Kudos
Message 1 of 3
(2,554 Views)
Solution
Accepted by topic author alecjcook

Nope...thats an XNOR, so it makes sense.

You're doing a XOR which is 65 yes, but then a NOT after that.  So with I32's (signed), that makes -66.

 

65 XOR 0 = 65

NOT (65) = -66

Message 2 of 3
(2,552 Views)

00000000000000000000000010000001

xor

00000000000000000000000000000000

=

00000000000000000000000010000001

NOT =

11111111111111111111111101111110

 

which is a negative number with the absolut value

00000000000000000000000010000001

+

00000000000000000000000000000001

=

00000000000000000000000010000010

 

So -66 is correct.

Message 3 of 3
(2,550 Views)