simple 74LSxx testing: why does my AND gate behave like an OR gate?

Thread Starter

xed_over

Joined Feb 5, 2018
19
even though its been many, many, many years since I've been in school... this Homework forum seemed the right place to ask my questions...
I'm sure this question may have been asked and answered many times over, but searching for keywords of 'and' and 'or' can be quite difficult...

I'm using 74LSxx chips.
It took me a while to figure out that leaving my inputs floating gives me a high output. That really confused me at first. Then I discovered this article on using pullup/pulldown resistors: http://www.learningaboutelectronics.com/Articles/How-to-connect-a-pull-down-resistor.php
I've wired my breadboard exactly as they have depicted in their pictures, yet pressing either switch still produces output -- just like an OR gate, instead of an AND gate. I've also tried pulling all the inputs for the unused gates on the same chip to ground, but the results are still the same.

I also discovered this "IC tester" Arduino project: http://www.instructables.com/id/74LS-Series-Digital-Logic-Tester/
I tested my chips, and it correctly reports my AND gate (74LS08) as an AND gate, and my OR gate (74LS32) as an OR gate.

I don't understand what I'm doing wrong still. Why is my "simple tester" circuit not working?
 

dl324

Joined Mar 30, 2015
18,221
Welcome to AAC!

Post a clearly focused picture of your breadboard so we can see for ourselves how you have it wired.
 

Alec_t

Joined Sep 17, 2013
15,105
74LSxx chips have an internal input pull-up resistance of ~20kΩ. Using an external resistor to ground to pull an input down to the guaranteed logic 0 level of <=0.8V, when the Vcc supply is 5V, would need a pull-down resistor of ~ <=4.7kΩ if I understand the datasheet correctly. Using a 10kΩ resistor would put the input in no-man's land between guaranteed logic levels.
 
Last edited:

MrChips

Joined Oct 2, 2009
34,629
A 10kΩ pull-down resistor is not going to do it. Whoever wrote that article is wrong.

Use 1kΩ for pull-down of 74LSxx gate and 220Ω for 74xx gates.
 

Thread Starter

xed_over

Joined Feb 5, 2018
19
dl324: no, but I'll do that when I get back home tonight. But I suspect your hint has a lot to do with Alec_t's answer.

Alec_t: ah, crap -- you're going to make me do math :(
yeah, I didn't really get all that from my cursory reading of the datasheet :(
but that makes a lot of sense.
I didn't have any 4.7k handy (on order)... so I replaced the 10k with 1k (as MrChips also suggests) and it works perfectly, as expected.

Thanks everyone!
 

MrChips

Joined Oct 2, 2009
34,629
The math is simple and straight forward.
Just use the corollary of Ohm's Law.

R = V / I

Check up the data sheet for VIL and IIL

VIL = 0.4V
IIL= 0.4mA

R = VIL / IIL = 0.4V / 0.4mA = 1kΩ
 

ebp

Joined Feb 8, 2018
2,332
Ah, TTL. The good(?) old days. Can you still buy it off the shelf? (I once waited a full year for some 74LS138, during the great TTL famine.)

VIL = 0.8V maximum
IIL= -0.4mA maximum

To put that in words:
The maximum input voltage that is guaranteed to be logic LOW is 0.8 volts, and in order to establish that voltage you must be able to "sink" to ground a current of 0.4 mA (the minus sign means the terminal in question for the condition being considered is "current sourcing" - current will flow from it to ground, remembering that conventional current flows from positive to negative). Normally a TTL input that is open circuit behaves as logic HIGH, but good practice dictates that a pullup resistor is used to be sure of meeting the minimum input voltage of 2.0 V for HIGH.

A 2k pulldown will work, but just meets the spec.

TTL outputs are spec'd so that the voltage they produce when fully loaded is less than VIL for LOW (0.4 V value MrChips stated) and greater than VIH for HIGH.

https://www.fairchildsemi.com/application-notes/AN/AN-319.pdf might be worth a peek. It's actually originally from National Semi.
 
Top