For instance, the datasheet of a TI SN74LS08 (AND Gate) says the following:
IOH High level output current = -0,4 mA max. IOL Low level output current = 8 mA max.
What does it means?
If I want to turn on a LED when both inputs are high, how must I connect it? And which is the maximum current can I get from the IC?. The basic schematic:
You would do better to use a 74ls00 so you can get the 8 ma thru the led when the output is low. You then tie the led to +5 thru about a 330 ohm resistor.
Anode to +5.
The gate has internal resistance which drops some voltage when current flows. So it means that the maximum source current from the output to 0V is 0.4mA without the voltage dropping to a point where the gate output is no longer 'high' (logic 1), or the max sink current is 8mA into the gate output from the +V line without the voltage rising to a point where the gate output is no longer 'low'.
If I want to turn on a LED when both inputs are high, how must I connect it?
As in your second pic, but the light will be dim because the gate sources only 0.4mA in the logic 1 state. To get it brighter you could use the gate output to drive a transistor which in turn drives the LED.
And which is the maximum current can I get from the IC?
Thanks, now it is more clear. But why are the leds working in the breadboard if the max output is 0,4mA?. My leds are T1-3mm standard 20mA and the logic is working fine.
In fact, I had to put 150ohm resistors because the first time the leds were burned. The schematic is exactly as the second pic.
At 0.4mA you're guaranteed to get logic 1, but you may be lucky with a particular example of a 74LS chip and get a few mA source current, albeit with an output voltage of, say, 2.5V.
You are using very old TTL low power logic ICs. They had a very low minimum logic high current (but some had more current than others) and a fairly high logic low current.
You are trying to light LEDs with the logic High current which might be high and might be low.
If you isnsist on using these old ICs then you should light the LEDs when the output is at a logic low, not a logic high.
Thanks a lot. Your help have been very useful, and finally i could understand the totem pole output type too, and with some tests with a multimeter now it is almost 100% clear.The datasheet did not lie xD.
After all, the thing I found confusing at first was the negative parameter IOH = -4mA.