patroclus said:Yes, I suposed so.
As I said, the only thing I don't get now is that about leakage current. For the LED to have leakege current, it must be inversed biased, so it only happends when voltage in VM2 is above 4.1V or so. Then, the transistor should be off. But, how would this affect the transistor working area?
The resistor from base to emitter is usually a good idea, it guarantees the transistor switches off. As already mentioned, any current leakage from the base of the transistor down to ground will tend to switch it on, even if only slightly. Bear in mind that logic gates don't switch from 0V to 5V, they switch from low to high - the specification for which covers a wide range.
The suggestion of possible 'leakage' in the LED isn't reverse leakage, it's forward leakage before the LED turns on.
Also, I though that in PNP transistor, current came in through the emiter, and came out trhough base and collector..
It's probably best if you don't think of current in that way, there are actually two different thoughts on it any way - conventional current flow (from positive to negative) and electron flow (from negative to positive).
For PNP devices it's usually easiest to think of electron flow instead, that way everything works exactly the same - just a mirror image.
In this particular case though, don't think of it at all, think of it as a simple switch, take the base low to turn it on, and take it high to turn it off.