XOR woes


Results 1 to 3 of 3

Thread: XOR woes

Threaded View

  1. #1
    Join Date
    Oct 2004
    Posts
    448

    Default XOR woes

    Hi, need some help, guys!

    I need to set a port to a certain value, depending on another variable which will have only 1 of 2 possible values, 0 or 255.

    For example, if the variable is 0, the port should output 45; if the variable is 255, the port should output its complement, 210.

    Now, I expected an XOR'ing of the 2 values to give the following results:

    0 XOR 45 = 45
    255 XOR 45 = 210

    However, what I get are pretty random results.

    I have tried both operators (XOR as well as ^), with no luck.

    Any idea what's happening?
    Last edited by Archangel; - 3rd February 2015 at 03:10.

Similar Threads

  1. Logical difference between 2 8-bit ports XOR?
    By circuitpro in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd July 2010, 04:17
  2. XOR result different with PC application
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th January 2009, 04:56
  3. Xor?
    By skimask in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 12th October 2008, 06:13
  4. Xor Sum
    By Sphere in forum General
    Replies: 3
    Last Post: - 7th December 2006, 07:52
  5. Exclusive OR - XOR
    By Archangel in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th September 2006, 09:44

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts