The exclusive or gate, known as
XOR describes a gate that only outputs a 1 only if one of the inputs is 1 and the other is 0. In other words, we can have either input on, but not both on.
It is the logical rule we need if we want to decide the sign of a multiplication problem. If input 1 represents “the first number negative” and input 2 represents “the second number is negative”, then
XOR’s output would tell us “Is the answer negative”. If either one of the two numbers, but not both of them, were negative, then the answer would be negative.
Watch out for
XOR and
OR - in English we often use the word “or” to mean both things. The statement “Entrées come with fries
or a salad” probably means you can get one or the other, but not both. In that statement,
or means the
XOR rule. On the other hand, imagine a class syllabus that states: “If you turn in copied work,
or the wrong assignment, you will get a 0”. You would certainly get a 0 if you turned in a plagiarized copy of the wrong assignment (both parts are true). In this case,
or means logical
OR - if either part is true, the answer is true.