Simple NOT Gate with LED.
Shows the working of an NOT gate with a 5 Volt source.
I used a pulldown resistors to give the NOT gate the LOW input when the switch is open, otherwhise the INPUT would be floating and weird things can happen.
Such as the NOT gate detecting a high input when floating, making the LED turn off even when the switch is open.
The NOT gate OUTPUT turns HIGH "only" when the INPUT is LOW.
In short, it inverses the "LOGIC LEVEL" of the INPUT.
So when the INPUT is HIGH the OUTPUT is LOW.
When the INPUT is LOW the OUTPUT is HIGH.
-----------------------------------------------------
Please bare in mind (altough not showing here) that besides the INPUT and OUTPUT pin the NOT gate also has VDD (5Volt) and VSS (Ground) pins which need to be connected to 5 Volts and GROUND.
This makes it possible for the LED to turn ON even when the switch is open.
This NOT gate would have 4 pins.
1 VDD (5volts)
2 VSS (Ground)
3 Input pin.
4 Output pin.
There are also IC'S with 2 or more NOT Gates on 1 IC.