I was wondering if there was some specific method to finding the circuit for an xor with a variety of variables. Like, I can easily expand a set number of xor(2 inputs) and xor(3 inputs) but there has to be some way to minimize the number you use. So, say XOR of 17 variables, how would you minimally expand it, using the least number of and/or gates?

Thank you

  • 2
    \$\begingroup\$ You can't make XOR gates out of just ANDs and ORs. You will need some inverters (NOT gates) also. \$\endgroup\$ – tcrosley Oct 25 '16 at 0:31
  • \$\begingroup\$ 4 diodes in a bridge = XOR diode logic. this is the minimum. XOR=AB + A!B! \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Oct 25 '16 at 0:40
  • \$\begingroup\$ What do you mean as in variables? \$\endgroup\$ – Bradman175 Oct 25 '16 at 1:03
  • \$\begingroup\$ @Bradman175 I think he means "inputs": "a variety of variables" -> "a given number of inputs". \$\endgroup\$ – dim Oct 25 '16 at 9:48
  • \$\begingroup\$ This is not easy. \$\endgroup\$ – Bradman175 Oct 25 '16 at 10:54


simulate this circuit – Schematic created using CircuitLab

This is a popular circuit to implement the XOR gate with minimal number of basic universal gates.

Take two inputs at a time and implement many such circuits, then take their outputs and send them into the same XOR circuit two at a time. Something like the draw of a knockout style tournament. Your final output will be the XOR of all your inputs.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.