enter image description here

enter image description here

I tried to make a circuit implementing the XNOR logic by using the identity

                            XNOR (A,B) = OR ( NOR(A,B) , AND(A,B) ).

The circuit works in breadboard (1st pic), it produces the 1001 truth table associated with XNOR gate. Is the drawing of the circuit alright?

Transistors 1, 2 and 3 make the AND gate (three transistors on the top middle in the breadboard), transistors 4 and 5 make the NOR gate (two transistors on the top right in the breadboard) and transistors 6, 7 and 8 make the OR gate (three transistors on the bottom left in the breadboard).

I needed 8 transistors and 7 resistors to make this circuit. Are there better ways of making XNOR gate using BJTs that requires fewer components?

  • 2
    \$\begingroup\$ remove transistor 6 and its collector resistor ... place the LED between transistor 7 collector and its collector resistor \$\endgroup\$
    – jsotola
    Commented May 16, 2023 at 16:55
  • 2
    \$\begingroup\$ Paralleling BEs isn't the best idea, worse with Q4&Q2 even with Q5 off, with Q5 on it should be worse. Use separate base resistors, compare 4 k to 2 k. Do you use a simulator and/or voltmeter to get an idea about the voltages at interesting nodes? \$\endgroup\$
    – greybeard
    Commented May 16, 2023 at 17:03
  • \$\begingroup\$ Possibly remove transistors 1 & 8 and their base resistors, and connect transistor 2's collector where transistor 8's collector was. \$\endgroup\$
    – brhans
    Commented May 16, 2023 at 17:05
  • \$\begingroup\$ @user253751 you are correct. I made a mistake in my lsst drawing. I corrected myself, drew a new circuit diagram and replaced the old drawing with this new onr. Please take a look. I believe it is alright now. \$\endgroup\$ Commented May 16, 2023 at 17:29
  • \$\begingroup\$ Update everyone. I removed the drawing of the circuit as it had mistakes. I rectified the mistakes hopefully and replaced the previous drawing with the corrected one. \$\endgroup\$ Commented May 16, 2023 at 17:31

1 Answer 1


If your circuit works then it works. However, it's a bad idea to share the same resistor with the base of multiple transistors, because they could use different voltages to turn on (due to manufacturing variations, or different voltages at the collector/emitter) and when the bases are directly connected it forces them to be the same. Each one should have its own resistor.

Also, transistors 1 and 8 are forming two NOT gates in sequence, and could be eliminated.

I suppose if you want to calculate OR ( NOR(A,B) , AND(A,B) ) you won't be able to do it with less transistors.

You can cheat a little. If you remove the last transistor 6, you can have an XOR gate, and reverse when the LED is on, by wiring it from 5V to the output, instead of from the output to ground.

But watch this magic: (click to simulate)

a circuit

This is an XNOR with only 4 transistors - and 2 of them are NOT gates that are only needed because of the type of input you are using. If you use different inputs, 2 is enough:

another circuit

I'm not sure where I found this circuit. You can play with it in the simulator. If one of the inputs is low and one is high, one of the transistors discharges the output to 0V; if they are both the same voltage then neither one turns on.

  • \$\begingroup\$ Upvoted for spotting the redundant inverters. \$\endgroup\$
    – greybeard
    Commented May 17, 2023 at 3:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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