inverting an AND gate without inverters?

t06afre

Joined May 11, 2009
5,934
Don't use the Posts: ### since that changes with every post made. Use the post # in the thread.

7400 gates were not meant to drive LEDs high directly.

You can use 7400 gates to sink current through a series resistor and LED with the anode of the LED connected to +5V. In this case the LED will display the inverted logic output (LED ON with LOW output).
It is just what I have been trying to say in my last postings. In this case the teacher was looking for how a TTL gate is able to sink more current than it can source. Twisting my brain this was the only logical answer to this question.
 

WBahn

Joined Mar 31, 2012
30,060
It is just what I have been trying to say in my last postings. In this case the teacher was looking for how a TTL gate is able to sink more current than it can source. Twisting my brain this was the only logical answer to this question.
It's hard to tell what the context of the teacher's comments were. My take was one of two things:

1) There are other ways to effectively achieve a logic inversion other than using another logic gate (an inverter). Assuming the gate can drive the load with either output level (not a good assumption here), you can simply reverse the diode and switch the supply it is tied to. If that isn't an option, you can use a transistor to implement the inversion function.

2) Another way, but it doesn't quite work here, is to change to negative (or active-LO) logic, in which case the AND gate implements the OR function (when the LED is driven ON by sinking current through the gate).
 

WBahn

Joined Mar 31, 2012
30,060
As I see it this was kind of a trick question. Then the both inputs to the AND gate is zero. The LED should be on(light) then both the inputs to AND is 1 the LED should be off
@Wbhan Your numbers postings in this furum was 7374 then I posted my answer
Okay... So now I know that you were referring to Post #13. I still don't see the brain fart you are referring to. I may well be looking right at it and not seeing it because I am seeing what I meant to write and not what I actually wrote. I'm certainly as susceptible to that as anyone.

Perhaps I was misinterpreting what you were meaning to say in your prior post as I thought you were telling DerStrom8 that it didn't matter the totem-pole output meant that it didn't matter whether you were trying to source or sink current from a TTL part. But, assuming that that wasn't what you meant, I'm now figuring that you were saying that the output of a microcontroller should be about the same as that of discrete logic gates because both use a totem-pole output. Since most microcontrollers these days are CMOS, I don't know if that is a particularly good assertion anymore since CMOS outputs, particularly in larger scale integration, lend themselves much better to symmetric drive capabilities. But many microcontrollers really can't drive LEDs well in either direction as even their sinking capability can be under 2mA.
 

MikeML

Joined Oct 2, 2009
5,444
When we think of an AND gate, we are conditioned to think of voltage levels: Two High inputs make a High output.

What stops us from thinking thus: Two High inputs makes the output of an AND gate source current, if either of the inputs is Low, then the output sinks current.

If we wire a LED from the positive supply to the gate output, it will light if either input is Low and it will extinguish if both inputs are High.

Sounds like a NAND function to me.
 

WBahn

Joined Mar 31, 2012
30,060
Oh, we've pretty well established that having the AND gate sink current to light the LED will implement a positive logic NAND functionality.

What I'm curious about at this point is finding out more about the OP's original circuit that was supposedly implementing an AND function with an LED. What was the actual circuit? Did the LED light when both inputs to the AND were HI? What kind of LED and what current limiting resistors were used?
 
Top