Help/Question with 74LS08P AND test circuit - Page 1
Forum section: electronics / beginners

author: gsansoucie
author_rank: Newbie
timestamp: July 21, 2013, 10:34:36 pm
content: Hi all.I'm wiring up a simple AND gate, using an HD74LS08P that I picked up at Radio Shack.Its a pretty basic circuit. I am using a 7805 with a 9v to get my 5V supply.I have:+5V Vcc (Pin 14)Pin 7 to GroundPin 3 (output) to an LED + (Which is connected to ground via a 1K Ohm Resister - overkill, but it was handy)For my simple test, I connect both Pin 1 and Pin 2 to +5V and the LED lights. I get this.What I am confused about is when both Pin 1 & Pin 2 are disconnected, the LED lights. I have to connect Pin 1 & Pin 2 to ground to get the LED to turn off.I've seen a number of simple Logic gate circuits online that connect the inputs to +5V through momentary switches so you can test out the logic (hold both down to light the LED). When I connect my momentary switches, the LED lights. In fact, the LED remains lit when I press either button, both, or no buttons.I get the same behavior on all of the gates on the chip.Is this normal or do I have a bad chip?Thanks in advance,-=Glen=-

author: c4757p
author_rank: Super Contributor
timestamp: July 21, 2013, 10:39:08 pm
content: Don't assume that floating inputs default to zero. Those circuits would have been specifically designed with that in mind. In fact, many logic families have input circuits that will tend to drift to a logic 1 if left unconnected. Others will become very sensitive to nearby electrical noise and toggle randomly.You can add a resistor between the gate input and either power or ground to make it default to that.

author: edavid
author_rank: Super Contributor
timestamp: July 21, 2013, 10:54:47 pm
content: To be a little more specific, unconnected 74, 74LS, 74F, 74S, 74AS inputs float to logic 1. This can save time when breadboarding, but it's considered poor form to have unconnected inputs in a real circuit.On CD4000, 74C, 74HC, 74AC and other CMOS families, unconnected inputs have an undefined level. You should connect all inputs, even on a breadboard.

author: c4757p
author_rank: Super Contributor
timestamp: July 21, 2013, 11:29:27 pm
content: Quote from: gsansoucie on July 21, 2013, 10:34:36 pmWait - RadioShack's still stocking the old 74LS parts?The 74HC ones are easier to work with and usually cheaper!

author: gsansoucie
author_rank: Newbie
timestamp: July 21, 2013, 11:39:44 pm
content: Quote from: c4757p on July 21, 2013, 11:29:27 pmYes, they are.I have a bunch of HCT's on order, but until they get here, I am resigned to the LSs.A 1k pull down resistor did the trick by the way.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: July 22, 2013, 02:57:12 am
content: To improve your datasheet-fu, have a quick look at the parameter IIL(Input current for low input) on a typical 74LS08 datasheet. Notice it's negative.Datasheets are great because if properly done they'll tell you everything you need to know. However they will never spell it out for you, if it's not the good stuff they can throw on page one with the other marketing bits.

author: MrAureliusR
author_rank: Unknown
timestamp: July 22, 2013, 03:24:57 am
content: That's not always true -- sometimes datasheets are extremely specific. Zilog's datasheets, for example, are always very thorough and detailed, as are Atmel's (for the most part) ... for examplehttp://www.atmel.ca/Images/doc0006.pdf

author: Paul Moir
author_rank: Frequent Contributor
timestamp: July 23, 2013, 02:12:32 am
content: Wow, that is good! Lack of exposure on my part.Perhaps datasheets should list author's names?

author: dfmischler
author_rank: Frequent Contributor
timestamp: July 23, 2013, 10:54:47 am
content: Quote from: gsansoucie on July 21, 2013, 10:34:36 pmCheck the data sheet carefully under "Recommended Operating Conditions" and I think you will find that you can't safely source enough current to turn on LEDs that way with classic TTL parts. The Fairchild data sheet I checked recommends no more than -0.4mA with the output high. You are operating in the short circuit output range. But you might be able to sink enough current to light the LED if you tie the anode to +5 through a resistor and have the LED come on when the output is low. The data sheet says you can safely sink 8mA per output with the output low. You should probably use an open collector driver (e.g. 7406, 7407) to pull the LED low if you need more current. This is why you always see TTL circuits operating external stuff with negative logic (i.e. the output is ON when it is LOW). Of course, that is also one of the reasons why NAND gates are more common than AND.To the best of my knowledge the 74HCT08 parts from all manufacturers can source or sink up to 25mA per output (but only 50mA for the whole package) so that is a major improvement over classic TTL.