XOR gate... why my LEDs are on?

jpanhalt

Joined Jan 18, 2008
10,080
What is the output of the top AND gate? 0 + 0 = 0
What is the output of the bottom AND gate? 1 + 1 = 1

Now look at the OR gate: 0 + 1 = 1

So, your LED is on.

Is this homework?
 

Thread Starter

Mccbgg

Joined Jun 28, 2020
14
Is this homework?
No it is a personnal goal. If I can make all the logic gates on simulator and on breadboards, and I still like electronics after this (lol) I will buy my oscilloscope, Rigol 1054z
Thank you for your answer! I will study it this afternoon.
 

Thread Starter

Mccbgg

Joined Jun 28, 2020
14
hi,
Why do you have Base currents of 1.6Amps.?
E
Hmm because I am a beginner and I am not sure to know what I am doing lol Is this a correct answer? Haha Thank you for your help. What would be the better curent base? My 3ohms resistor is not enough?
 

ericgibbs

Joined Jan 29, 2010
10,467
hi Mc,
For Logic Gates you should use only milli-Amps of Base current, say between 1mA and 10mA.

As logic transistors usually are either On or Off, acting as a switch.

When using low Collector currents, in saturated mode allow a gain of 50 to 100.
This means also you can increase the values of the Collector resistors.

E
 

jpanhalt

Joined Jan 18, 2008
10,080
I realy want to undersdand application of the NOT gate on such circuit.

For now... I tried all your recommandations and it doesn't work. I still get current on the output.
The logic diagram shows that the LED should be lit. REDO the symbolic logic, THEN try your simulation modified accordingly.
 

Thread Starter

Mccbgg

Joined Jun 28, 2020
14
The logic diagram shows that the LED should be lit. REDO the symbolic logic, THEN try your simulation modified accordingly.
Lol Ok I got it. I showed you the wrong part of the video. But both of my switches were turned ON. :D Here is the good part :

Untitled-3.png
 

Thread Starter

Mccbgg

Joined Jun 28, 2020
14
My NOT gate works (0 A at the LED) :

Untitled-2.png




But my NAND doesn't work. The LED still receive current. Do you think the simulator is wrong?
Untitled-1.png
 

dl324

Joined Mar 30, 2015
11,252
Do you have a suggestion?
The top transistor in your AND gate is wired as a diode (Q2 in my schematic). You shouldn't have the LED and resistor on the emitter of the bottom transistor (Q3 in my schematic).

One AND gate with an inverter on the top input:
clipimage.jpg
The resistor values could be tweaked to reduce base current, but it will work as is.
 

Alec_t

Joined Sep 17, 2013
11,513
But my NAND doesn't work. The LED still receive current. Do you think the simulator is wrong?
No. Transistors aren't perfect switches. Even when they're turned fully on, the collector-emitter voltage is non-zero. In your sim it's about 80mV for each transistor, which gives a perfectly reasonable 135mV across the pair. This drives a tiny current through the LED.
 
Top