# how do we demonstrate using Boolean algebra that these NAND and NOR gate combinations are XOR gates

How do we demonstrate using Boolean algebra that these NAND and NOR gate combinations are XOR gates?

• By boolean algebra, do you mean something like $\overline{\overline{A\overline{AB}}\,\overline{\overline{AB}B}} ={A\overline{AB}+\overline{AB}B} =A(\overline{A} + \overline{B})+(\overline{A} + \overline{B})B =A\overline B+\overline{A}B$? – John L. Apr 16 '19 at 12:12
• Yes, thankyou @Apass.Jack – Shane Apr 16 '19 at 13:20
• $\overline{\overline{A + \overline{A+B}}+\overline{\overline{A+B}+B}} =(A+\overline{A+B})(\overline{A+B}+B) =(A+\overline{A}\,\overline{B})(\overline{A}\,\overline{B}+B) =(AB+\overline{A}\,\overline{B})$. Then, $\overline{(AB+\overline{A}\,\overline{B}) + (AB+\overline{A}\,\overline{B})} =\overline{(AB+\overline{A}\,\overline{B})} =\overline{AB}\,\overline{\overline{A}\,\overline{B}} =\overline{AB}(A+B) =(\overline{A} + \overline{B})(A+B) =\overline{A}B + \overline{B}A =A\overline{B} + B\overline{A}$ – John L. Apr 23 '19 at 9:44

The nice thing about small Boolean circuits like this, is there are only a few possible inputs.

With two input wires, there are $$2^2=4$$ possible inputs to your circuit: $$00, 01, 10, 11$$. You can test each one and write down its output. Then compare that to the XOR gate's outputs.

If the two line up, then the circuits are equivalent! And if they're not, something has to be adjusted.

Just write down what the output of every circuit is. In the first example, the left circuit is X = NAND (a, b), top middle is Y = NAND (a, X), bottom middle is Z = NAND (X, b), right = NAND (Y, Z).

Substitute everything into the eqation for the right circuit, then use Boolean algebra.