Author Topic: Help/Question with 74LS08P AND test circuit  (Read 4762 times)

0 Members and 1 Guest are viewing this topic.

Offline gsansoucieTopic starter

  • Newbie
  • Posts: 2
Help/Question with 74LS08P AND test circuit
« on: July 21, 2013, 10:34:36 pm »
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 Ground

Pin 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=-
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Help/Question with 74LS08P AND test circuit
« Reply #1 on: July 21, 2013, 10:39:08 pm »
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.
No longer active here - try the IRC channel if you just can't be without me :)
 

Online edavid

  • Super Contributor
  • ***
  • Posts: 3427
  • Country: us
Re: Help/Question with 74LS08P AND test circuit
« Reply #2 on: July 21, 2013, 10:54:47 pm »
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.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Help/Question with 74LS08P AND test circuit
« Reply #3 on: July 21, 2013, 11:29:27 pm »
I'm wiring up a simple AND gate, using an HD74LS08P that I picked up at Radio Shack.

Wait - RadioShack's still stocking the old 74LS parts? :wtf: The 74HC ones are easier to work with and usually cheaper!
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline gsansoucieTopic starter

  • Newbie
  • Posts: 2
Re: Help/Question with 74LS08P AND test circuit
« Reply #4 on: July 21, 2013, 11:39:44 pm »
I'm wiring up a simple AND gate, using an HD74LS08P that I picked up at Radio Shack.

Wait - RadioShack's still stocking the old 74LS parts? :wtf: The 74HC ones are easier to work with and usually cheaper!

Yes, 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.

 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: Help/Question with 74LS08P AND test circuit
« Reply #5 on: July 22, 2013, 02:57:12 am »
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. 
 

Offline MrAureliusR

  • Supporter
  • ****
  • Posts: 373
  • Country: ca
Re: Help/Question with 74LS08P AND test circuit
« Reply #6 on: July 22, 2013, 03:24:57 am »
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 example http://www.atmel.ca/Images/doc0006.pdf
--------------------------------------
Canadian hacker
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: Help/Question with 74LS08P AND test circuit
« Reply #7 on: July 23, 2013, 02:12:32 am »
Wow, that is good!  Lack of exposure on my part.

Perhaps datasheets should list author's names?
« Last Edit: July 23, 2013, 02:16:29 am by Paul Moir »
 

Offline dfmischler

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: us
Re: Help/Question with 74LS08P AND test circuit
« Reply #8 on: July 23, 2013, 10:54:47 am »
Pin 3 (output) to an LED + (Which is connected to ground via a 1K Ohm Resister - overkill, but it was handy)

Check 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.

« Last Edit: July 23, 2013, 12:53:32 pm by dfmischler »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf