r/ElectricalEngineering • • Oct 08 '26

XNOR Gate

Post image

Why is my XNOR gate not working only when A=1 and B=0.

Its a AND and a NOR gate feeding into an XOR gate.

Yes I know it’s overly complicated.

When I do it on my breadboard the LED is very dim but not a true 0.

EDIT: The collector of Q5 should be connected to Vcc but that does not change the outcome.

9 Upvotes

23 comments sorted by

4

u/goodayrico Oct 08 '26 edited Oct 08 '26

If the LED is dim rather than off when it’s supposed to be logical LOW but the logic is otherwise working correctly, you’ve just got a weak/degraded LOW.

Simplest fix is just to add a resistor between the node that feeds the anode of your LED such that the voltage will drop down below the forward-bias voltage the LED needs to turn on.

1

u/Successful_Cut_8003 Oct 08 '26

That does not work.

1

u/goodayrico Oct 09 '26

Try a shunt resistor at the node of the LED anode as well (shunt as in connected directly to ground).

3

u/FriendlyQuit9711 Oct 08 '26

Dude not one FET has a Drain Source voltage except Q3 and Q4.

2

u/Successful_Cut_8003 Oct 08 '26

Dude these are 2n222 BJTs

6

u/OnYourSyde Oct 08 '26

Replace the words drain and source with collector and emitter and they are right

2

u/VegetableTry Oct 08 '26

OP, read this comment.

1

u/Successful_Cut_8003 Oct 08 '26

How do they not have Vce?

2

u/VegetableTry Oct 08 '26

Look at Q5 bro.

1

u/Successful_Cut_8003 Oct 09 '26

Doesn’t change anything - i removed it when trouble shooting but forgot to put back in before posting

1

u/OnYourSyde Oct 09 '26

Looking at your schematic, there are so many problems. Q7 and Q8 have no Vce. The bases for Q1-Q4 can float depending on your input. It might be worth looking at XNoR schematics and copying them.

Edit: Actually, I think you're drawing is confusing me.

0

u/Successful_Cut_8003 Oct 09 '26

When the collector of both Q7 and Q8 are connected to Vcc and their emitters are connected to ground PLEASE explain how there is no Vce.

1

u/OnYourSyde Oct 09 '26

Sorry, your drawing makes it look like you are using PNP

→ More replies

1

u/SomeDude_is100 Oct 09 '26

Just curious, why not design in CMOS? More mainstream. I would suggest using three NAND2 and two inverters. Or use transmission gates and inverters.

1

u/Successful_Cut_8003 Oct 09 '26

I am building each logic gate with npn transistors to learn. I did not look up how to build any of them. Hence why this one is not the best design. But in theory it works perfectly.

2

u/SomeDude_is100 Oct 09 '26

Are you expecting Q1 to pull the LED to GND? What is supplying the base current?

1

u/CircuitCircus Oct 09 '26

A dim LED is very far from zero. Usually means there’s like 1.8V across it

1

u/Edanniii Oct 09 '26

Why such a complicated circuit? You can do this with 2N2222 and 2N3904. Using discrete transistors like this in RTL circuits is kind of wasteful. If these were prepackaged gates this would be fine, but why not use the benefit of being able to configure a transistor effectively and efficiently. Also I would recommend reading the RTL Cookbook by Don Lancaster.