Register to reply

Complement of XOR, what is it?

by eugenius
Tags: complement
Share this thread:
eugenius
#1
Sep10-08, 09:50 AM
P: 38
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 doesnt explain it. Quite absurd. What's more absurd is I can't find anything online about it.
Phys.Org News Partner Engineering news on Phys.org
Researchers use 3D printers to create custom medical implants
For secure software: X-rays instead of passport control
Razor-sharp TV pictures
premagg
#2
Sep10-08, 12:10 PM
P: 38
yes it is not of XOR..I dont find anything absurd...what is the doubt?
berkeman
#3
Sep10-08, 12:17 PM
Mentor
berkeman's Avatar
P: 40,959
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

.

MeJennifer
#4
Sep10-08, 12:21 PM
P: 2,043
Complement of XOR, what is it?

Quote Quote by eugenius View Post
You know like OR is the complement of AND.
What is the logical definition of a complement?
berkeman
#5
Sep10-08, 12:31 PM
Mentor
berkeman's Avatar
P: 40,959
Quote Quote by eugenius View Post
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.
eugenius
#6
Sep10-08, 12:36 PM
P: 38
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?
chroot
#7
Sep10-08, 01:42 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,427
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
eugenius
#8
Sep10-08, 02:34 PM
P: 38
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'
chroot
#9
Sep10-08, 02:42 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,427
Actually, I should write out truth tables before making such statements. You cannot reduce the expression (a ^ b)' to anything simpler, and that operation is called XNOR. berkeman's initial response was correct.

- Warren
eugenius
#10
Sep10-08, 02:56 PM
P: 38
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?
chroot
#11
Sep10-08, 02:59 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,427
Quote Quote by eugenius View Post
So how would I do that with XOR?
(a xor b)' = (a xnor b) = (a' xnor b')

- Warren
eugenius
#12
Sep10-08, 03:03 PM
P: 38
Quote Quote by chroot View Post
(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.
chroot
#13
Sep10-08, 03:11 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,427
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
cabraham
#14
Sep11-08, 06:33 AM
P: 1,041
The complement of XOR, "exclusive or", is called XNOR, "exclusive nor".


Register to reply

Related Discussions
2's complement Electrical Engineering 2
2's complement Engineering, Comp Sci, & Technology Homework 2
Rs complement Engineering, Comp Sci, & Technology Homework 1
Sign magnitude/1's Complement/2's Complement HELP! Engineering, Comp Sci, & Technology Homework 0
2's complement in VB Programming & Computer Science 2