Complement of XOR, what is it?

  • Thread starter eugenius
  • Start date
In summary: This can also be represented as (A XOR B)' or (A' XNOR B'). DeMorgan's theorem can be used to simplify this expression to (A' + B)(A + B'). So the complement of XOR is XNOR, not NXOR. This can be seen in the truth table for XOR, where it is the opposite of XOR in every case. In summary, the complement of XOR, also known as "exclusive nor", is represented by XNOR and can be simplified using DeMorgan's theorem.
  • #1
eugenius
38
0
I have an expression like this A XOR B and then a bar over the expression, meaning complement.

So what is the complement of XOR? Is it XNOR? I don't mean inverse I mean complement.

You know like OR is the complement of AND.

The professor forgot to tell us, and the book doesn't explain it. Quite absurd. What's more absurd is I can't find anything online about it.
 
Engineering news on Phys.org
  • #2
yes it is not of XOR..I don't find anything absurd...what is the doubt?
 
  • #3
I think the doubt is about what to call it. After all, the complement of AND is NAND, so the complement of XOR would need to be NXOR, which sounds and looks funny.

So I googled each spelling and get hits with both. Wikipedia seems to favor XNOR:

http://en.wikipedia.org/wiki/XNOR_gate

.
 
Last edited:
  • #4
eugenius said:
You know like OR is the complement of AND.
What is the logical definition of a complement? :confused:
 
  • #5
eugenius said:
You know like OR is the complement of AND.

Yikes, I missed that. Jennifer is right -- that is not an example of a logical complement. A logical complement is negation:

http://logical.complement.word.sytes.org/

So the complement of AND is NAND.
 
  • #6
Ummm yes, but AND does not undo OR or vice versa, while NAND does undo AND.

AND, OR are complements. NAND, AND are inverses. Two different things.

So what is the complement of XOR?
 
  • #7
I would say that calling AND and OR "complements" is incredibly misleading.

The expression (A ^ B)', where ^ denotes XOR and ' denotes NOT, is equal to A' ^ B'. In that sense, XOR is its own "complement."

- Warren
 
  • #8
I would say that calling AND and OR "complements" is incredibly misleading.

The expression (A ^ B)', where ^ denotes XOR and ' denotes NOT, is equal to A' ^ B'. In that sense, XOR is its own "complement."

- Warren

Wait so complements only apply to 0 and 1 but not to the actual AND and OR gates?

That is 1'=0 and 0'=1

But what about DeMorgan's law?

(x+y)' =x'y'

(xy)'= x'+y'
 
  • #9
Actually, I should write out truth tables before making such statements. :redface: You cannot reduce the expression (a ^ b)' to anything simpler, and that operation is called XNOR. berkeman's initial response was correct.

- Warren
 
  • #10
My professor replied with this:

Write out the truth table for XOR and then use one of the methods that
were taught during the last two lectures to get a function for XOR from
the truth table. Then take the complement of that function. All
functions can be constructed using AND, OR, and NOT.

Okay I understand that, but when trying to prove the equality of an expression with perfect induction, all I have to do is plug in all the possible cases from the truth table.

I.E. A function with 2 variables has 4 possible combinations of 1 and 0.

Doing it for something like (A XOR B') is easy. Say A= 0 and B= 1

It would be (0 XOR 1') = (0 XOR 0) = 0

But what if I have something like this? (A XOR B)' where I want to plug in A=0 and B=1 again.

According to DeMorgan's theorem (x+y)' =x'y'

So how would I do that with XOR?
 
  • #11
eugenius said:
So how would I do that with XOR?

(a xor b)' = (a xnor b) = (a' xnor b')

- Warren
 
  • #12
chroot said:
(a xor b)' = (a xnor b) = (a' xnor b')

- Warren

Are you absolutely sure? What about what my professor said, how is what he said relevant to this? Maybe he misunderstood my question.
 
  • #13
Well, (a XNOR b) is the same as (a' + b)(a + b'). He's right that any expression can be broken down into and, OR, and NOT. There's no simpler representation for (a XOR b)' than (a XNOR b), if you'll accept that XNOR is a valid operator. If you don't want to use XNOR, then you're forced to use the more complicated expression.

In the same way, XOR can be written as ab' + a'b.

- Warren
 
  • #14
The complement of XOR, "exclusive or", is called XNOR, "exclusive nor".
 

1. What is the complement of XOR?

The complement of XOR is a logical operator that performs a bitwise logical NOT on its input, which means that if the input is a 1, the output will be a 0, and vice versa. It is commonly denoted as XNOR or != in programming languages.

2. How is the complement of XOR used in computer science?

The complement of XOR is commonly used in computer science for tasks such as data encryption, error detection and correction, and data compression. It is also used in digital circuits and logic gates to perform various operations on binary data.

3. What are the properties of the complement of XOR?

The complement of XOR has three main properties: it is commutative, associative, and involutive. This means that the order of the inputs does not affect the output, it can be grouped with other operators without changing the result, and applying the complement twice will return the original input.

4. Can you provide an example of the complement of XOR?

Let's say we have two binary numbers: 101010 and 110011. The complement of XOR between these two numbers would be 011100, as shown in the following calculation:
101010 (XOR) 110011 = 011001 (complement) = 011100.

5. How is the complement of XOR different from the XOR operator?

The complement of XOR and the XOR operator are two different logical operators, although they are closely related. The XOR operator returns a 1 if the inputs are different and 0 if they are the same, while the complement of XOR returns a 1 if the inputs are the same and 0 if they are different.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
3K
  • Programming and Computer Science
Replies
13
Views
3K
  • Biology and Medical
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
Replies
20
Views
5K
  • Biology and Chemistry Homework Help
Replies
8
Views
3K
  • Science and Math Textbooks
Replies
5
Views
1K
  • Programming and Computer Science
Replies
1
Views
938
  • Electrical Engineering
Replies
15
Views
1K
  • Programming and Computer Science
Replies
32
Views
1K
Back
Top