Lately, I was becoming skeptical of XOR's rank among the 16 realizable Boolean operators as owing to anything other than its direct parity application to mathematics. In short, I wanted a different way of visualizing it as being in the same tier as its (N)AND/(N)OR constituents; last night, I found enough reason to respect it as such.

P and Q are two lists of equal but arbitrary length, with their elements equaling one or zero in base ten (for simplicity's sake).

S = P+Q = {p1,p2,,pn}+{q1,q2,,qn} = {p1+q1,p2+q2,,pn+qn}

That gives 0, 1, or 2 for each element.

Relating S with a number r using = or ≠ returns a list where each element has been simultaneously compared to r and replaced by either 1 or 0 according to the truth of the relation.

With this, we have six possible arrangements. Not four, not sixteen, but six. Here is what it looks like:

     /       \
   (=)       (≠)
  / | \     / | \
(0)(1)(2) (0)(1)(2)

The outputs, ordering from left to right, are the same outputs that would be produced by the NOR, XOR, AND, OR, XNOR, and NAND operations on P and Q. XOR certainly doesn't look like it's on the outskirts anymore; I am happy!

Another illustration, which opposes logical complements:

             P AND Q       P OR Q

               (2)           (0)
                ↑             ↑
P XOR Q  (1) ← (=) ← (P+Q) → (≠) → (1)  P XNOR Q
                ↓             ↓
               (0)           (2)

             P NOR Q      P NAND Q
I guess it's silly, but yeah, I never really used xor at all until I learned how awesome it was in discreet.
samebull wrote:
I guess it's silly, but yeah, I never really used xor at all until I learned how awesome it was in discreet.
Welcome to Cemetech; what brings you to our fair shores? You should Introduce Yourself in the appropriate topic. Weregoose, it also has great applications for toggling bits without need for comparison, and for drawing and erasing sprites with no need for either a full wipe or a back buffer.
I never understood how you expand XOR to a larger number base. You can do it for all the others.

It is very useful in binary adders....Razz
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum