PDA

View Full Version : Exclusive OR howto?



Ali_en
- 4th May 2005, 12:51
Hi all

I need to perform an exclusive OR i.e. "XOR" operation, the logical "XOR" operator just gives 0 or 255 as output and i am still not able to find anyway of getting the exact value of the "XOR" operation on two bytes i.e. having two bytes "A" and "B" and finding the value of "C" as C= A XOR B... i would be gratified by any help in this regard

Cheers
MAK

Ingvar
- 4th May 2005, 14:22
Try C = A ^ B

Ali_en
- 5th May 2005, 12:11
Dear Ingvar!

Thanks for replying, as i finished posting the question, i found the same C=A^B solution on the following url, that mentions the details about the PIC Basic bitwise operations:

http://picbasic.com/resources/articles/boolean.htm

actually the documentation i have, has nothing like XOR mentioned in the Bitwise Operators section and that pi**ed me off... bytheway thanks alot for your help...

Cheers
MAK