2

(The notations used:

I was solving a problem, where they asked which of the given options give equation for the difference of full subtractor. The circuit in the solution option was:

enter image description here

For me the first line:

$(x'y'+xy)'z'+(x'y'+xy)z$

looked more like $x\odot y\odot z$. But I know the difference of full subtractor is $x\oplus y\oplus z$. So I tried to evaluate both separately:

$x\oplus y\oplus z$
$= (x'y+xy')\oplus z$
$= (x'y+xy')'z+(x'y+xy')z'$
$= (x'y)'(xy)'z+(x'y+xy')z'$
$= (x+y')(x'+y)z+(x'y+xy')z'$
$\require{enclose}= \enclose{updiagonalstrike}{xx'z}+xyz+x'y'z+\enclose{updiagonalstrike}{yy'z}+x'yz'+xyz'$
$= xyz+x'y'z+x'yz'+xy'z'$ ...equation$(I)$

$x\odot y\odot z$
$=(x'y'+xy)\odot z$
$=(x'y'+xy)'z'+(x'y'+xy)z$ (This is same as first line in the equations given in the figure above)
$=(x'y')'(xy)'z'+(x'y'+xy)z$
$=(x+y)(x'+y')z'+(x'y'+xy)z$
$\require{enclose}=\enclose{updiagonalstrike}{xx'z}+xy'z'+x'yz'+\enclose{updiagonalstrike}{yy'z'}+x'y'z+xyz$
$=xy'z'+x'yz'+x'y'z+xyz$ ...equation$(II)$

To my eyes, both equations $(I)$ and $(II)$ looks the same. So I went to wolframalpha and prepared truth table for both of them.

$x\oplus y\oplus z$
enter image description here

$x\odot y\odot z$
enter image description here

And they correctly look complement of each other. Then why the given answer and my calculations equates $x\odot y\odot z$ with $x\oplus y\oplus z$? What stupidity I am doing here?

RajS
  • 1,317
  • 1
    @MichaelBurr: The two-input operations here are all both commutative and associative. However it looks like Wolfram interprets the second expression as something different from a tree of binary operations. – hmakholm left over Monica Aug 21 '18 at 16:40
  • wolfram think $x\odot y\odot z$ is $3$-input XNOR$\ne (x\odot y)\odot z$ – Ethan Dec 31 '19 at 04:36

1 Answers1

1

You're not doing anything wrong.

Negation commutes with XOR -- in other words, $(\neg x)\oplus y = \neg(x\oplus y) = x\oplus(\neg y)$. So when you change two XORs to XNORs you're adding two negations that can find each other and annihilate.


Wolfram Alpha seems to be using an unusual interpretation of $a\overline\veebar b \overline\veebar c$ where it interprets it as a three-input XNOR, apparently understood as $\overline{a\veebar b\veebar c}$, instead of as $(a\overline\veebar b)\overline\veebar c$ or $a\overline\veebar (b\overline\veebar c)$.

Compare Wolfram's interpretation of p XNOR q XNOR r with p XNOR (q XNOR r).

This arguably makes sense if you're thinking of digital logic -- asking for an $n$-input XNOR gate and getting the same as XOR if $n$ happens to be odd would not be terribly useful -- but is certainly confusing from an algebraic point of view.

  • Do you mean to say $x\odot y\odot z=(x\odot y)\odot z=\neg(\neg(x\oplus y)\oplus z)=\neg(x\oplus(\neg y)\oplus z)=x\oplus(\neg\neg y)\oplus z=x\oplus y\oplus z$ (when you said "... can find each other and annihilate...")? – RajS Aug 21 '18 at 16:40
  • Is it exactly whats going on in my problem? Are those equations in my comment (especially $\neg(x\oplus(\neg y)\oplus z)=x\oplus(\neg\neg y)\oplus z$) perfectly correct (just want to reconfirm as I am coming across this first time)? – RajS Aug 21 '18 at 16:43
  • 1
    @anir: It is correct but a bit of a detour. I would just write $$ \neg(\neg(x\oplus y)\oplus z) = (\neg\neg(x\oplus y))\oplus z = (x\oplus y)\oplus z$$ – hmakholm left over Monica Aug 21 '18 at 16:48
  • Ohh yess this looks more correct!!! – RajS Aug 21 '18 at 16:51
  • It seems that I am not able to understand 2nd part of the answer. Why wolframalpha gives two different truth tables? Shouldnt those two be exactly the same? In short, I am not able to grasp how they can equate algebraically but not logically (i.e. when truth tables are compared). They should equate both ways, right? May be you explained it already above. But can you please elaborate a bit more? – RajS Aug 21 '18 at 17:04
  • 1
    @anir: I think Wolfram simply chooses to interpret p XNOR q XNOR r as XNORwithThreeOperands(p,q,r), where they have defined the latter as NOT(p XOR q XOR r). Whether that is a good idea or not is a good question -- it is certainly confusing. – hmakholm left over Monica Aug 21 '18 at 17:06