# How Does This NOT Gate Work?

I think this question may have already been answered, in a way... But I am not satisfied. I'm reading this book about creating a NOT gate and it mentions that electricity flow from the collector to LED2 connected directly to ground stops when the transistor begins conducting.

Question is, why would LED2 stop if it is connected in parallel?

• If the transistor is turned on, what is the voltage across it? Since the transistor & LED are in parallel, what is the voltage across the LED? Will that voltage cause it to light up? Commented Jul 23, 2015 at 17:03
• @brhans I understand that part, what I don't understand is why LED2 directly to ground with only 330 resistance will have less voltage? Commented Jul 23, 2015 at 17:15
• @user3704920 Because transistor shorts LED2 anode to ground. When Q1 is on, try to replace Q1 with a piece of wire and see how it affects the voltage across the LED2. This is a very rough approximation. Commented Jul 23, 2015 at 17:18
• @Golaž what do you mean by "shorts"? How does a short circuit fit here? As far as I know, a short circuit is caused by less resistance, in which case LED2 would burn out? I am a newbie so I apologize in advance. Commented Jul 23, 2015 at 17:23
• When Q1 is conducting (base is pulled high), the voltage between Q1 emitter and collector will be very low - around 0.3 volts or so. Since LED2 and Q1e/c are in parallel, the voltage across LED2 will also be about 0.3 volts. That is much less than the voltage required to light the LED. We might say that Q1 places a short circuit across LED2 since it provides such a low voltage, even though it is not a Real short circuit. (Sometimes we get a bit sloppy with terminology.) Commented Jul 23, 2015 at 18:53

Current only flows into the base of the transistor, not out. When the switch is closed, the circuit acts like this:

simulate this circuit – Schematic created using CircuitLab

LED2 is shorted out. With no voltage across it, it doesn't conduct. All of R2's current goes straight to ground.

With the switch open, the circuit acts like this:

simulate this circuit

The transistor is now off (no collector -> emitter current), so 6 volts is put across R2 and LED2 in series. This allows LED2 to turn on and conduct, with R2 limiting the current.

• thank you. So why is it current travels best straight down to ground and not through LED 2? Is it because LED2 causes more resistance? Commented Jul 23, 2015 at 17:50
• Current can't flow through the LED unless there's a voltage across it, which for LEDs is often around 2 volts. Diodes don't obey Ohm's Law, but they still require voltage in order to conduct. Commented Jul 23, 2015 at 17:56
• Think of the first circuit as a zero-ohm resistor in parallel with an infinitely large resistor. Commented Jul 23, 2015 at 17:56

The "gate" you've shown is confusing I think because while its purpose may be to have LED2 and LED1 give opposite indications, the input to the "gate" is a current and the output is a voltage. In most cases, it makes more sense to define logic gate behavior for both inputs and outputs in terms of voltage. For example:

simulate this circuit – Schematic created using CircuitLab

In this example, a logic high is a signal which will sit at least 1.5 volts above ground if no more than 5mA is drawn from it; a logic low is a signal below 0.6 volts. The left circuit will output a voltage of at least 1.5 volts until the current drawn from it exceeds 5.1mA. The gate in the middle (starting before the 1k resistor) draws slightly under 1mA if the input is at 1.5 volts); one could attach four more similar gates without exceeding the 5mA limit of the source (though any current used to feed gates will reduce the LED brightness). If the input is over 1.5 volts, the base-emitter current will be at least 0.8mA, and the transistor should have no trouble sinking the 6.4mA necessary to pull its collector down to 0.6 volts. If the input is below 0.6 volts, then R3 should have no trouble pulling the output up above 1.5 volts if nothing downstream demands more than 5mA.

Note that all LEDs are referenced to ground. If one is willing to have a buttons and LEDs which are floating, one can build an "inverter" without needing any transistors, but incorporating such a device into a larger circuit will be difficult. Assuming LEDs want roughly 10mA at about 1.8 volts:

simulate this circuit

When the switch is open, D2 will drop 1.8V; the 3.2 volts remaining will be divided between R1 and R2, with each dropping 1.6 volts at 10.6mA, so D2 will get 10.6mA. When the switch is closed, D1 will drop 1.8V. R2 will drop 3.2 volts at 21.3mA, and R1 will drop 1.8 volts at 1.2mA, leaving about 9.3mA for the D1.

The purpose of a NOT gate is to have the OUTPUT (LED2) be the opposite of the input (LED1). If LED1 is lit, LED2 should be off. That being said,

When SW1 is pressed, current flows through LED1 turning it on, and also providing current to turn on Q1. When Q1 is "ON" is provides a low resistance path to ground--a short--bypassing LED2. LED2 was originally on because it was begging power through R2, but now that Q1 is "ON" that power is being shunted away from LED2 directly to ground through Q1. So LED2 is off.

When you release the switch, SW1, Q1 no longer gets current and shuts "OFF". LED1 is not getting any current and is also off; however, LED2 is now on because the current is flowing through it instead of Q1.

Make sense?

• thank you very much. Still, I don't understand why it would bypass LED2 when the resistance in the part of the circuit is lower? R2 is 330 and R1 is 1k, so why would it choose 1k resistance instead of 330? Commented Jul 23, 2015 at 17:11
• When Q1 is in the "ON" state, imagine it as if it where replaced by a 0 ohm resistor between R2 and ground. Commented Jul 23, 2015 at 17:31
• @user3704920 This circuit uses a transistor to act like an "electric switch". Imagine collector and emitter are like the sides of a switch, and the base controls whether the switch is on or off. Commented Jul 23, 2015 at 22:03