AND Gate Stays Open











up vote
5
down vote

favorite












I have a very simple circuit on a breadboard with two push-button switches, an AND gate (74LS08), and an LED. I have the two switches hooked up to pins 1 and 2, while the LED goes from 3 to ground. Pin 14 is given 5 volts, while pin 7 goes to ground.



I'm just trying to test to see if the AND gate works and so far it seems as though it doesn't. As soon as I plug in 5 volts to pin 14, I get current through all the output pins, 3, 6, 10, and 13, regardless of what's going on with their respective input pins, even if pin 7 isn't grounded.



enter image description here



Obviously, the LED should only turn on when both switches are switched on, but once 5 volts is supplied to pin 14, it doesn't matter what I do to the buttons. I've tried a couple of the same AND gates from the pack, as well as some OR gates, and they all do it.










share|improve this question









New contributor




user2303321 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 10




    It's amazing how robust semiconductors have become, withstanding the total absence of current limitation without any apparent trouble.
    – Dmitry Grigoryev
    14 hours ago















up vote
5
down vote

favorite












I have a very simple circuit on a breadboard with two push-button switches, an AND gate (74LS08), and an LED. I have the two switches hooked up to pins 1 and 2, while the LED goes from 3 to ground. Pin 14 is given 5 volts, while pin 7 goes to ground.



I'm just trying to test to see if the AND gate works and so far it seems as though it doesn't. As soon as I plug in 5 volts to pin 14, I get current through all the output pins, 3, 6, 10, and 13, regardless of what's going on with their respective input pins, even if pin 7 isn't grounded.



enter image description here



Obviously, the LED should only turn on when both switches are switched on, but once 5 volts is supplied to pin 14, it doesn't matter what I do to the buttons. I've tried a couple of the same AND gates from the pack, as well as some OR gates, and they all do it.










share|improve this question









New contributor




user2303321 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 10




    It's amazing how robust semiconductors have become, withstanding the total absence of current limitation without any apparent trouble.
    – Dmitry Grigoryev
    14 hours ago













up vote
5
down vote

favorite









up vote
5
down vote

favorite











I have a very simple circuit on a breadboard with two push-button switches, an AND gate (74LS08), and an LED. I have the two switches hooked up to pins 1 and 2, while the LED goes from 3 to ground. Pin 14 is given 5 volts, while pin 7 goes to ground.



I'm just trying to test to see if the AND gate works and so far it seems as though it doesn't. As soon as I plug in 5 volts to pin 14, I get current through all the output pins, 3, 6, 10, and 13, regardless of what's going on with their respective input pins, even if pin 7 isn't grounded.



enter image description here



Obviously, the LED should only turn on when both switches are switched on, but once 5 volts is supplied to pin 14, it doesn't matter what I do to the buttons. I've tried a couple of the same AND gates from the pack, as well as some OR gates, and they all do it.










share|improve this question









New contributor




user2303321 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have a very simple circuit on a breadboard with two push-button switches, an AND gate (74LS08), and an LED. I have the two switches hooked up to pins 1 and 2, while the LED goes from 3 to ground. Pin 14 is given 5 volts, while pin 7 goes to ground.



I'm just trying to test to see if the AND gate works and so far it seems as though it doesn't. As soon as I plug in 5 volts to pin 14, I get current through all the output pins, 3, 6, 10, and 13, regardless of what's going on with their respective input pins, even if pin 7 isn't grounded.



enter image description here



Obviously, the LED should only turn on when both switches are switched on, but once 5 volts is supplied to pin 14, it doesn't matter what I do to the buttons. I've tried a couple of the same AND gates from the pack, as well as some OR gates, and they all do it.







logic-gates breadboard






share|improve this question









New contributor




user2303321 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




user2303321 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 11 hours ago









jdv

268212




268212






New contributor




user2303321 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 16 hours ago









user2303321

322




322




New contributor




user2303321 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user2303321 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user2303321 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 10




    It's amazing how robust semiconductors have become, withstanding the total absence of current limitation without any apparent trouble.
    – Dmitry Grigoryev
    14 hours ago














  • 10




    It's amazing how robust semiconductors have become, withstanding the total absence of current limitation without any apparent trouble.
    – Dmitry Grigoryev
    14 hours ago








10




10




It's amazing how robust semiconductors have become, withstanding the total absence of current limitation without any apparent trouble.
– Dmitry Grigoryev
14 hours ago




It's amazing how robust semiconductors have become, withstanding the total absence of current limitation without any apparent trouble.
– Dmitry Grigoryev
14 hours ago










4 Answers
4






active

oldest

votes

















up vote
13
down vote













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.






share|improve this answer



















  • 1




    Yes, you are correct with your first diagram. I added 100k resistors between ground and pins 1 and 2. This works but a new problem has presented itself. There is some confusing behavior from the switches. I press switch 1 and the light turns on and stays on, but it should not turn on until switch two is also on. Then I turn switch one off and back on again, but this time it just flickers on and then off again. Switch 2 presents the same strange behavior.
    – user2303321
    16 hours ago






  • 4




    I see you also don't have a current limiting resistor on the output of your gate. You should have something like a 270 or 330 ohm resistor in series with the LED, to limit the current. Try that, then edit your question with an update photo and draw a schematic too, that may help
    – MCG
    16 hours ago






  • 1




    You might consider using a smaller pull-down resistance as well, perhaps 10k, though I don't see why 100k shouldn't work.
    – DerStrom8
    15 hours ago






  • 4




    @DerStrom8: since he's using a 74LS08, he will need a pull-down of 2K or less to guarantee the input is seen as Low. 10K would be fine with a CMOS part (74AC, etc.)
    – Peter Bennett
    6 hours ago










  • Cheers @PeterBennett, I didn't bother looking at the datasheet.
    – DerStrom8
    1 hour ago


















up vote
5
down vote













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.






share|improve this answer




























    up vote
    0
    down vote















    schematic





    simulate this circuit – Schematic created using CircuitLab



    This is because your circuit never put entries to 0v (entries of the gate).
    you have to use pull-up/pull-down to manage signal on entries of the gate.



    So when you do not use the button, the 5 volt is supplied ...
    if you use it it connects entry to gnd



    the output of the gate changes.






    share|improve this answer



















    • 2




      I don't understand what that means. Could you please elaborate? I'm a complete beginner.
      – user2303321
      16 hours ago










    • How to I put entries to 0v?
      – user2303321
      16 hours ago










    • I think you have drawn your schematic completely differently to the breadboard circuit shown. For one, your schematic shows resistors, the breadboard does not. You also have the buttons connecting the inputs to GND when you can see that they are actually pulling the inputs up to VCC
      – MCG
      16 hours ago






    • 1




      Yes, that is fine, but this configuration will work differently to how OP explained in his last paragraph. His configuration can work with the addition of resistors, as in my answer. OP's last paragraph shows how he expects his circuit to work, and this one does the opposite.
      – MCG
      16 hours ago






    • 1




      The LS TTL family is also not very symmetric for input/output currents, 100K may not pull the input sufficiently low. 10K should be better (and get rid of flicker). Also the nominal current drive capability for a high output is much worse than low output so your circuit will be stressing the output stage. That's fine if this is just a learning toy, but it won't be reliable. See Texas Instruments sn74ls08.pdf datasheet for details. Note they have 3 different TTL families on the DS, they all behave slightly differently.
      – isdi
      13 hours ago


















    up vote
    0
    down vote













    TL;DR: Separated from 5V by a simple switch EQUALS "pin not connected" DOESN'T EQUAL "no voltage applied" DOESN'T EQUAL "logical 0".



    An unconnected input of a true TTL chip (74xx, 74Sxx, 74LSxx) behaves as if it is connected to 5V DC, whereas on a CMOS chip (74HCxx, 74ACTxx, CD40xx), it behaves as if it is connected to 5V AC.



    In any case, unless your LED has a (rare) built in current limiting resistor, YOU NEED ONE.






    share|improve this answer





















    • These points aren't completely wrong or without value, but they are rather poorly stated, and have already been explained much more clearly and accurately by others.
      – Chris Stratton
      6 hours ago












    • My intent was to add an answer with colour and brevity to a colourful and brief problem :)
      – rackandboneman
      6 hours ago










    • @rackandboneman How does an unconnected input on a CMOS chip behave like it was connected to a 5V AC line?
      – Nayuki
      1 hour ago











    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("schematics", function () {
    StackExchange.schematics.init();
    });
    }, "cicuitlab");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "135"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    user2303321 is a new contributor. Be nice, and check out our Code of Conduct.










     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f406311%2fand-gate-stays-open%23new-answer', 'question_page');
    }
    );

    Post as a guest
































    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    13
    down vote













    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.






    share|improve this answer



















    • 1




      Yes, you are correct with your first diagram. I added 100k resistors between ground and pins 1 and 2. This works but a new problem has presented itself. There is some confusing behavior from the switches. I press switch 1 and the light turns on and stays on, but it should not turn on until switch two is also on. Then I turn switch one off and back on again, but this time it just flickers on and then off again. Switch 2 presents the same strange behavior.
      – user2303321
      16 hours ago






    • 4




      I see you also don't have a current limiting resistor on the output of your gate. You should have something like a 270 or 330 ohm resistor in series with the LED, to limit the current. Try that, then edit your question with an update photo and draw a schematic too, that may help
      – MCG
      16 hours ago






    • 1




      You might consider using a smaller pull-down resistance as well, perhaps 10k, though I don't see why 100k shouldn't work.
      – DerStrom8
      15 hours ago






    • 4




      @DerStrom8: since he's using a 74LS08, he will need a pull-down of 2K or less to guarantee the input is seen as Low. 10K would be fine with a CMOS part (74AC, etc.)
      – Peter Bennett
      6 hours ago










    • Cheers @PeterBennett, I didn't bother looking at the datasheet.
      – DerStrom8
      1 hour ago















    up vote
    13
    down vote













    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.






    share|improve this answer



















    • 1




      Yes, you are correct with your first diagram. I added 100k resistors between ground and pins 1 and 2. This works but a new problem has presented itself. There is some confusing behavior from the switches. I press switch 1 and the light turns on and stays on, but it should not turn on until switch two is also on. Then I turn switch one off and back on again, but this time it just flickers on and then off again. Switch 2 presents the same strange behavior.
      – user2303321
      16 hours ago






    • 4




      I see you also don't have a current limiting resistor on the output of your gate. You should have something like a 270 or 330 ohm resistor in series with the LED, to limit the current. Try that, then edit your question with an update photo and draw a schematic too, that may help
      – MCG
      16 hours ago






    • 1




      You might consider using a smaller pull-down resistance as well, perhaps 10k, though I don't see why 100k shouldn't work.
      – DerStrom8
      15 hours ago






    • 4




      @DerStrom8: since he's using a 74LS08, he will need a pull-down of 2K or less to guarantee the input is seen as Low. 10K would be fine with a CMOS part (74AC, etc.)
      – Peter Bennett
      6 hours ago










    • Cheers @PeterBennett, I didn't bother looking at the datasheet.
      – DerStrom8
      1 hour ago













    up vote
    13
    down vote










    up vote
    13
    down vote









    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.






    share|improve this answer














    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.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 16 hours ago

























    answered 16 hours ago









    MCG

    5,22231442




    5,22231442








    • 1




      Yes, you are correct with your first diagram. I added 100k resistors between ground and pins 1 and 2. This works but a new problem has presented itself. There is some confusing behavior from the switches. I press switch 1 and the light turns on and stays on, but it should not turn on until switch two is also on. Then I turn switch one off and back on again, but this time it just flickers on and then off again. Switch 2 presents the same strange behavior.
      – user2303321
      16 hours ago






    • 4




      I see you also don't have a current limiting resistor on the output of your gate. You should have something like a 270 or 330 ohm resistor in series with the LED, to limit the current. Try that, then edit your question with an update photo and draw a schematic too, that may help
      – MCG
      16 hours ago






    • 1




      You might consider using a smaller pull-down resistance as well, perhaps 10k, though I don't see why 100k shouldn't work.
      – DerStrom8
      15 hours ago






    • 4




      @DerStrom8: since he's using a 74LS08, he will need a pull-down of 2K or less to guarantee the input is seen as Low. 10K would be fine with a CMOS part (74AC, etc.)
      – Peter Bennett
      6 hours ago










    • Cheers @PeterBennett, I didn't bother looking at the datasheet.
      – DerStrom8
      1 hour ago














    • 1




      Yes, you are correct with your first diagram. I added 100k resistors between ground and pins 1 and 2. This works but a new problem has presented itself. There is some confusing behavior from the switches. I press switch 1 and the light turns on and stays on, but it should not turn on until switch two is also on. Then I turn switch one off and back on again, but this time it just flickers on and then off again. Switch 2 presents the same strange behavior.
      – user2303321
      16 hours ago






    • 4




      I see you also don't have a current limiting resistor on the output of your gate. You should have something like a 270 or 330 ohm resistor in series with the LED, to limit the current. Try that, then edit your question with an update photo and draw a schematic too, that may help
      – MCG
      16 hours ago






    • 1




      You might consider using a smaller pull-down resistance as well, perhaps 10k, though I don't see why 100k shouldn't work.
      – DerStrom8
      15 hours ago






    • 4




      @DerStrom8: since he's using a 74LS08, he will need a pull-down of 2K or less to guarantee the input is seen as Low. 10K would be fine with a CMOS part (74AC, etc.)
      – Peter Bennett
      6 hours ago










    • Cheers @PeterBennett, I didn't bother looking at the datasheet.
      – DerStrom8
      1 hour ago








    1




    1




    Yes, you are correct with your first diagram. I added 100k resistors between ground and pins 1 and 2. This works but a new problem has presented itself. There is some confusing behavior from the switches. I press switch 1 and the light turns on and stays on, but it should not turn on until switch two is also on. Then I turn switch one off and back on again, but this time it just flickers on and then off again. Switch 2 presents the same strange behavior.
    – user2303321
    16 hours ago




    Yes, you are correct with your first diagram. I added 100k resistors between ground and pins 1 and 2. This works but a new problem has presented itself. There is some confusing behavior from the switches. I press switch 1 and the light turns on and stays on, but it should not turn on until switch two is also on. Then I turn switch one off and back on again, but this time it just flickers on and then off again. Switch 2 presents the same strange behavior.
    – user2303321
    16 hours ago




    4




    4




    I see you also don't have a current limiting resistor on the output of your gate. You should have something like a 270 or 330 ohm resistor in series with the LED, to limit the current. Try that, then edit your question with an update photo and draw a schematic too, that may help
    – MCG
    16 hours ago




    I see you also don't have a current limiting resistor on the output of your gate. You should have something like a 270 or 330 ohm resistor in series with the LED, to limit the current. Try that, then edit your question with an update photo and draw a schematic too, that may help
    – MCG
    16 hours ago




    1




    1




    You might consider using a smaller pull-down resistance as well, perhaps 10k, though I don't see why 100k shouldn't work.
    – DerStrom8
    15 hours ago




    You might consider using a smaller pull-down resistance as well, perhaps 10k, though I don't see why 100k shouldn't work.
    – DerStrom8
    15 hours ago




    4




    4




    @DerStrom8: since he's using a 74LS08, he will need a pull-down of 2K or less to guarantee the input is seen as Low. 10K would be fine with a CMOS part (74AC, etc.)
    – Peter Bennett
    6 hours ago




    @DerStrom8: since he's using a 74LS08, he will need a pull-down of 2K or less to guarantee the input is seen as Low. 10K would be fine with a CMOS part (74AC, etc.)
    – Peter Bennett
    6 hours ago












    Cheers @PeterBennett, I didn't bother looking at the datasheet.
    – DerStrom8
    1 hour ago




    Cheers @PeterBennett, I didn't bother looking at the datasheet.
    – DerStrom8
    1 hour ago












    up vote
    5
    down vote













    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.






    share|improve this answer

























      up vote
      5
      down vote













      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.






      share|improve this answer























        up vote
        5
        down vote










        up vote
        5
        down vote









        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 10 hours ago









        Peter Bennett

        36.1k12866




        36.1k12866






















            up vote
            0
            down vote















            schematic





            simulate this circuit – Schematic created using CircuitLab



            This is because your circuit never put entries to 0v (entries of the gate).
            you have to use pull-up/pull-down to manage signal on entries of the gate.



            So when you do not use the button, the 5 volt is supplied ...
            if you use it it connects entry to gnd



            the output of the gate changes.






            share|improve this answer



















            • 2




              I don't understand what that means. Could you please elaborate? I'm a complete beginner.
              – user2303321
              16 hours ago










            • How to I put entries to 0v?
              – user2303321
              16 hours ago










            • I think you have drawn your schematic completely differently to the breadboard circuit shown. For one, your schematic shows resistors, the breadboard does not. You also have the buttons connecting the inputs to GND when you can see that they are actually pulling the inputs up to VCC
              – MCG
              16 hours ago






            • 1




              Yes, that is fine, but this configuration will work differently to how OP explained in his last paragraph. His configuration can work with the addition of resistors, as in my answer. OP's last paragraph shows how he expects his circuit to work, and this one does the opposite.
              – MCG
              16 hours ago






            • 1




              The LS TTL family is also not very symmetric for input/output currents, 100K may not pull the input sufficiently low. 10K should be better (and get rid of flicker). Also the nominal current drive capability for a high output is much worse than low output so your circuit will be stressing the output stage. That's fine if this is just a learning toy, but it won't be reliable. See Texas Instruments sn74ls08.pdf datasheet for details. Note they have 3 different TTL families on the DS, they all behave slightly differently.
              – isdi
              13 hours ago















            up vote
            0
            down vote















            schematic





            simulate this circuit – Schematic created using CircuitLab



            This is because your circuit never put entries to 0v (entries of the gate).
            you have to use pull-up/pull-down to manage signal on entries of the gate.



            So when you do not use the button, the 5 volt is supplied ...
            if you use it it connects entry to gnd



            the output of the gate changes.






            share|improve this answer



















            • 2




              I don't understand what that means. Could you please elaborate? I'm a complete beginner.
              – user2303321
              16 hours ago










            • How to I put entries to 0v?
              – user2303321
              16 hours ago










            • I think you have drawn your schematic completely differently to the breadboard circuit shown. For one, your schematic shows resistors, the breadboard does not. You also have the buttons connecting the inputs to GND when you can see that they are actually pulling the inputs up to VCC
              – MCG
              16 hours ago






            • 1




              Yes, that is fine, but this configuration will work differently to how OP explained in his last paragraph. His configuration can work with the addition of resistors, as in my answer. OP's last paragraph shows how he expects his circuit to work, and this one does the opposite.
              – MCG
              16 hours ago






            • 1




              The LS TTL family is also not very symmetric for input/output currents, 100K may not pull the input sufficiently low. 10K should be better (and get rid of flicker). Also the nominal current drive capability for a high output is much worse than low output so your circuit will be stressing the output stage. That's fine if this is just a learning toy, but it won't be reliable. See Texas Instruments sn74ls08.pdf datasheet for details. Note they have 3 different TTL families on the DS, they all behave slightly differently.
              – isdi
              13 hours ago













            up vote
            0
            down vote










            up vote
            0
            down vote











            schematic





            simulate this circuit – Schematic created using CircuitLab



            This is because your circuit never put entries to 0v (entries of the gate).
            you have to use pull-up/pull-down to manage signal on entries of the gate.



            So when you do not use the button, the 5 volt is supplied ...
            if you use it it connects entry to gnd



            the output of the gate changes.






            share|improve this answer
















            schematic





            simulate this circuit – Schematic created using CircuitLab



            This is because your circuit never put entries to 0v (entries of the gate).
            you have to use pull-up/pull-down to manage signal on entries of the gate.



            So when you do not use the button, the 5 volt is supplied ...
            if you use it it connects entry to gnd



            the output of the gate changes.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 16 hours ago

























            answered 16 hours ago









            francois P

            1367




            1367








            • 2




              I don't understand what that means. Could you please elaborate? I'm a complete beginner.
              – user2303321
              16 hours ago










            • How to I put entries to 0v?
              – user2303321
              16 hours ago










            • I think you have drawn your schematic completely differently to the breadboard circuit shown. For one, your schematic shows resistors, the breadboard does not. You also have the buttons connecting the inputs to GND when you can see that they are actually pulling the inputs up to VCC
              – MCG
              16 hours ago






            • 1




              Yes, that is fine, but this configuration will work differently to how OP explained in his last paragraph. His configuration can work with the addition of resistors, as in my answer. OP's last paragraph shows how he expects his circuit to work, and this one does the opposite.
              – MCG
              16 hours ago






            • 1




              The LS TTL family is also not very symmetric for input/output currents, 100K may not pull the input sufficiently low. 10K should be better (and get rid of flicker). Also the nominal current drive capability for a high output is much worse than low output so your circuit will be stressing the output stage. That's fine if this is just a learning toy, but it won't be reliable. See Texas Instruments sn74ls08.pdf datasheet for details. Note they have 3 different TTL families on the DS, they all behave slightly differently.
              – isdi
              13 hours ago














            • 2




              I don't understand what that means. Could you please elaborate? I'm a complete beginner.
              – user2303321
              16 hours ago










            • How to I put entries to 0v?
              – user2303321
              16 hours ago










            • I think you have drawn your schematic completely differently to the breadboard circuit shown. For one, your schematic shows resistors, the breadboard does not. You also have the buttons connecting the inputs to GND when you can see that they are actually pulling the inputs up to VCC
              – MCG
              16 hours ago






            • 1




              Yes, that is fine, but this configuration will work differently to how OP explained in his last paragraph. His configuration can work with the addition of resistors, as in my answer. OP's last paragraph shows how he expects his circuit to work, and this one does the opposite.
              – MCG
              16 hours ago






            • 1




              The LS TTL family is also not very symmetric for input/output currents, 100K may not pull the input sufficiently low. 10K should be better (and get rid of flicker). Also the nominal current drive capability for a high output is much worse than low output so your circuit will be stressing the output stage. That's fine if this is just a learning toy, but it won't be reliable. See Texas Instruments sn74ls08.pdf datasheet for details. Note they have 3 different TTL families on the DS, they all behave slightly differently.
              – isdi
              13 hours ago








            2




            2




            I don't understand what that means. Could you please elaborate? I'm a complete beginner.
            – user2303321
            16 hours ago




            I don't understand what that means. Could you please elaborate? I'm a complete beginner.
            – user2303321
            16 hours ago












            How to I put entries to 0v?
            – user2303321
            16 hours ago




            How to I put entries to 0v?
            – user2303321
            16 hours ago












            I think you have drawn your schematic completely differently to the breadboard circuit shown. For one, your schematic shows resistors, the breadboard does not. You also have the buttons connecting the inputs to GND when you can see that they are actually pulling the inputs up to VCC
            – MCG
            16 hours ago




            I think you have drawn your schematic completely differently to the breadboard circuit shown. For one, your schematic shows resistors, the breadboard does not. You also have the buttons connecting the inputs to GND when you can see that they are actually pulling the inputs up to VCC
            – MCG
            16 hours ago




            1




            1




            Yes, that is fine, but this configuration will work differently to how OP explained in his last paragraph. His configuration can work with the addition of resistors, as in my answer. OP's last paragraph shows how he expects his circuit to work, and this one does the opposite.
            – MCG
            16 hours ago




            Yes, that is fine, but this configuration will work differently to how OP explained in his last paragraph. His configuration can work with the addition of resistors, as in my answer. OP's last paragraph shows how he expects his circuit to work, and this one does the opposite.
            – MCG
            16 hours ago




            1




            1




            The LS TTL family is also not very symmetric for input/output currents, 100K may not pull the input sufficiently low. 10K should be better (and get rid of flicker). Also the nominal current drive capability for a high output is much worse than low output so your circuit will be stressing the output stage. That's fine if this is just a learning toy, but it won't be reliable. See Texas Instruments sn74ls08.pdf datasheet for details. Note they have 3 different TTL families on the DS, they all behave slightly differently.
            – isdi
            13 hours ago




            The LS TTL family is also not very symmetric for input/output currents, 100K may not pull the input sufficiently low. 10K should be better (and get rid of flicker). Also the nominal current drive capability for a high output is much worse than low output so your circuit will be stressing the output stage. That's fine if this is just a learning toy, but it won't be reliable. See Texas Instruments sn74ls08.pdf datasheet for details. Note they have 3 different TTL families on the DS, they all behave slightly differently.
            – isdi
            13 hours ago










            up vote
            0
            down vote













            TL;DR: Separated from 5V by a simple switch EQUALS "pin not connected" DOESN'T EQUAL "no voltage applied" DOESN'T EQUAL "logical 0".



            An unconnected input of a true TTL chip (74xx, 74Sxx, 74LSxx) behaves as if it is connected to 5V DC, whereas on a CMOS chip (74HCxx, 74ACTxx, CD40xx), it behaves as if it is connected to 5V AC.



            In any case, unless your LED has a (rare) built in current limiting resistor, YOU NEED ONE.






            share|improve this answer





















            • These points aren't completely wrong or without value, but they are rather poorly stated, and have already been explained much more clearly and accurately by others.
              – Chris Stratton
              6 hours ago












            • My intent was to add an answer with colour and brevity to a colourful and brief problem :)
              – rackandboneman
              6 hours ago










            • @rackandboneman How does an unconnected input on a CMOS chip behave like it was connected to a 5V AC line?
              – Nayuki
              1 hour ago















            up vote
            0
            down vote













            TL;DR: Separated from 5V by a simple switch EQUALS "pin not connected" DOESN'T EQUAL "no voltage applied" DOESN'T EQUAL "logical 0".



            An unconnected input of a true TTL chip (74xx, 74Sxx, 74LSxx) behaves as if it is connected to 5V DC, whereas on a CMOS chip (74HCxx, 74ACTxx, CD40xx), it behaves as if it is connected to 5V AC.



            In any case, unless your LED has a (rare) built in current limiting resistor, YOU NEED ONE.






            share|improve this answer





















            • These points aren't completely wrong or without value, but they are rather poorly stated, and have already been explained much more clearly and accurately by others.
              – Chris Stratton
              6 hours ago












            • My intent was to add an answer with colour and brevity to a colourful and brief problem :)
              – rackandboneman
              6 hours ago










            • @rackandboneman How does an unconnected input on a CMOS chip behave like it was connected to a 5V AC line?
              – Nayuki
              1 hour ago













            up vote
            0
            down vote










            up vote
            0
            down vote









            TL;DR: Separated from 5V by a simple switch EQUALS "pin not connected" DOESN'T EQUAL "no voltage applied" DOESN'T EQUAL "logical 0".



            An unconnected input of a true TTL chip (74xx, 74Sxx, 74LSxx) behaves as if it is connected to 5V DC, whereas on a CMOS chip (74HCxx, 74ACTxx, CD40xx), it behaves as if it is connected to 5V AC.



            In any case, unless your LED has a (rare) built in current limiting resistor, YOU NEED ONE.






            share|improve this answer












            TL;DR: Separated from 5V by a simple switch EQUALS "pin not connected" DOESN'T EQUAL "no voltage applied" DOESN'T EQUAL "logical 0".



            An unconnected input of a true TTL chip (74xx, 74Sxx, 74LSxx) behaves as if it is connected to 5V DC, whereas on a CMOS chip (74HCxx, 74ACTxx, CD40xx), it behaves as if it is connected to 5V AC.



            In any case, unless your LED has a (rare) built in current limiting resistor, YOU NEED ONE.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 6 hours ago









            rackandboneman

            1,96749




            1,96749












            • These points aren't completely wrong or without value, but they are rather poorly stated, and have already been explained much more clearly and accurately by others.
              – Chris Stratton
              6 hours ago












            • My intent was to add an answer with colour and brevity to a colourful and brief problem :)
              – rackandboneman
              6 hours ago










            • @rackandboneman How does an unconnected input on a CMOS chip behave like it was connected to a 5V AC line?
              – Nayuki
              1 hour ago


















            • These points aren't completely wrong or without value, but they are rather poorly stated, and have already been explained much more clearly and accurately by others.
              – Chris Stratton
              6 hours ago












            • My intent was to add an answer with colour and brevity to a colourful and brief problem :)
              – rackandboneman
              6 hours ago










            • @rackandboneman How does an unconnected input on a CMOS chip behave like it was connected to a 5V AC line?
              – Nayuki
              1 hour ago
















            These points aren't completely wrong or without value, but they are rather poorly stated, and have already been explained much more clearly and accurately by others.
            – Chris Stratton
            6 hours ago






            These points aren't completely wrong or without value, but they are rather poorly stated, and have already been explained much more clearly and accurately by others.
            – Chris Stratton
            6 hours ago














            My intent was to add an answer with colour and brevity to a colourful and brief problem :)
            – rackandboneman
            6 hours ago




            My intent was to add an answer with colour and brevity to a colourful and brief problem :)
            – rackandboneman
            6 hours ago












            @rackandboneman How does an unconnected input on a CMOS chip behave like it was connected to a 5V AC line?
            – Nayuki
            1 hour ago




            @rackandboneman How does an unconnected input on a CMOS chip behave like it was connected to a 5V AC line?
            – Nayuki
            1 hour ago










            user2303321 is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            user2303321 is a new contributor. Be nice, and check out our Code of Conduct.













            user2303321 is a new contributor. Be nice, and check out our Code of Conduct.












            user2303321 is a new contributor. Be nice, and check out our Code of Conduct.















             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f406311%2fand-gate-stays-open%23new-answer', 'question_page');
            }
            );

            Post as a guest




















































































            Popular posts from this blog

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?