Change a variable to the opposite?


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: Change a variable to the opposite?

    Doh! Since you posted the truth table, you are correct that I did not RTFM. Before my original post I tried to but didn't know where to look. Now I do and since most of the code uses binary I used:
    BCD_In = BCD_In ^ %11111111

    Thank you for the pointers and help!

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Change a variable to the opposite?

    Is BCD value 9 the only value that needs translation? Could you actually need a BCD to grey code translation?
    Tim Barr

  3. #3
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Change a variable to the opposite?

    If your variable is always going to be 4 bits, the complement would be got by variable(comp) = 15-variable.

    Regards,

    Anand

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