Newbie Question About an AND Gate

Thread Starter

codewizard1969

Joined Feb 18, 2017
3
Just started experimenting with electronics. I ran into some confusion and I was hoping someone could point out what I suspect is just a newbie mistake. I hooked up an AND gate (74LS08N) to a breadboard, thought I would not see a lit LED as I have not hooked up anything to PIN 1A or 1B, but I am getting output on 1Y. What I am I getting wrong?

breadboard-ho.jpg
 

djsfantasi

Joined Apr 11, 2010
9,156
You aren't doing something wrong, just getting unexpected results.

You just learned by experiment what a TTL gate does when it's inputs are not connected or as it is called, floating. TTL gates are designed such that an unconnected gate is considered a high input.

Thus, when both inputs to a TTL AND gate are not connected, you have two high signals and an AND gate's output is high in that case.

Other types of logic don't work in this way and a a circuit maker, you have to ensure there are no floating inputs.
 

crutschow

Joined Mar 14, 2008
34,280
You made the rookie mistake of thinking that an unconnected input is zero.
It is actually floating and can assume a high state, such as TTL logic does, or an undefined state (possible either one or zero or in between) such as CMOS logic does.
 

WBahn

Joined Mar 31, 2012
29,976
Furthermore, in some logic technologies, such as CMOS, not only can it be undefined as in you don't know which state it takes on, but it can be undefined as in it is in neither state or, worse, it is trying to be in both states at the same time. Because of the design of CMOS gates it is possible to turn on both the pull-down and the pull-up transistors with a floating input which creates a short between the power supplies. This is known as "shoot through" because current shoots through the gate from power to ground. It can permanently damage or even destroy the gate.
 

ian field

Joined Oct 27, 2012
6,536
Just started experimenting with electronics. I ran into some confusion and I was hoping someone could point out what I suspect is just a newbie mistake. I hooked up an AND gate (74LS08N) to a breadboard, thought I would not see a lit LED as I have not hooked up anything to PIN 1A or 1B, but I am getting output on 1Y. What I am I getting wrong?

View attachment 120805
Everyone else has pretty much nailed it, add pull down resistors to all inputs (say about 2k2 or 4k7) then you can apply logic levels and you should get the results expected.

You can get SIL resistor arrays made for just this job - you will almost always find them on boards with CMOS for the reasons others have mentioned.
 

AnalogKid

Joined Aug 1, 2013
10,986
If you look at the datasheet, you will see that there is a negative number for the logic low input current. This is because current flows out of the input pin, through whatever is driving the pin, to GND. For this reason, there is a maximum value for the pull down resistor that assures that the gate input sees a voltage low enough to be a logic 0 condition. That voltage also is on the datasheet, and you can calculate the max resistor value with Ohm's Law. The min value is 0 ohms; it is ok to connect the input directly to GND.

ak
 

MrChips

Joined Oct 2, 2009
30,701
Everyone else has pretty much nailed it, add pull down resistors to all inputs (say about 2k2 or 4k7) then you can apply logic levels and you should get the results expected.
For 74LS08,

IIL = -1.6mA
VI = 0.4V

RPULLDOWN = VI/IIL = 0.4V/0.0016A = 250Ω

Hence you would need a pulldown resistor of about 200-220Ω.
 
Top