AND Gate Stays Open

It would help if you had added a schematic, but from what I can see, you are missing one vital component. A pull-down resistor. What this does, is it makes sure that the inputs are at 0V when there is no voltage present at the input. Once the button is pressed, you will get your 5V and when both buttons are pressed, you get 5V at both inputs.

As it is right now, your inputs are ‘floating’ which means they are in a state that is unknown, which the IC could determine as a ‘1’ state, which is why your LED is always on. This will also be why the same is true for all outputs. With these ICs, you should always tie unused inputs to GND via a pull-down resistor.

schematic

simulate this circuit – Schematic created using CircuitLab

Look at the above schematic. The top one is how I see your configuration at the moment (please correct me if I am wrong). When there is no voltage applied to the input, it is left with a floating voltage and may not be at 0V.

The bottom one is how it should be. Some pull-down resistors will ensure that when there is no voltage present at the input, they will stay at 0V.

Add these resistors and you should see your problem go away.

The inputs on bipolar TTL families (74xx, 74LSxx, and others without a “C” in the middle) will source current – when left unconnected they will act as a logic High. For the 74LS family, you have to draw about 0.4 mA from an input for it to be recognized as a logic Low.

Traditionally, we would put switches between the input pin and Ground to ensure that the input could be pulled low enough to be seen as a Low, and add a pull-up resistor from the pin to +5V to ensure that the input would be High when the switch was open.

If you want the switch between the input pin and +5V, you would need a pull-down resistor under 2000 Ohms to ensure the input was Low when the switch is open.

Leave a Comment