Pushbutton and Counter

Discussion in 'Homework Help' started by Outcast, Mar 17, 2013.

  1. Outcast

    Thread Starter New Member

    Mar 17, 2013
    3
    0
    Hi how do I connect a pushbutton to a counter (74191)? Should I connect to D/U pin (as per attached pic) or to a data pin?

    I am suppose to come up with a circuit that counts only up to 5 and a reset button to clear counter.

    I have tried implementing the circuit in flip-flops however was told to redo using 74191 which I am having trouble understanding.

    I have attached the circuit that I came up with.
     
  2. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    I found your first post moderated. I have approved it. The forum software is very suspicious of off site hosting of pictures, this is why we request you keep it local. Since we offer a huge numbers of ways to show images this is much preferred.

    How to Display Attachments Full Size
     
    Outcast likes this.
  3. WBahn

    Moderator

    Mar 31, 2012
    17,726
    4,788
    Your circuit has a number of problems. In no particular order:

    As more LEDs turn on, they will get dimmer since the resistor is controlling the total current through all of them.

    When your reset switch is open, your P/L input will be floating.

    You are susceptible to glitches on your decoder output as the count goes from 011 to 100. There are several paths the outputs can take and a third of them will produce a pulse on the output of the NAND gate.

    I'm assuming that your V2 block is producing a free running clock. Since you have the count enable tied LO, the output will change on every clock pulse. All you have control over is whether it counts up or counts down.

    Your "insert" switch (what kind of a meaningful name is "insert"?) has the same problem as your other switch, namely that it will leave the U/D input floating when not closed.
     
    Outcast likes this.
  4. Outcast

    Thread Starter New Member

    Mar 17, 2013
    3
    0
    Thanks for pointing out my mistakes. This is my first time designing and implementing a circuit and I having a hard time figuring out how to use a 74191.

    I have revised my circuit. The 'INSERT' button is suppose to increase the count (by 1) everytime it is pressed until the count reaches 5 (101).

    The counter should then stop counting even if INSERT is pushed again. And the RESET button is supposed to reset the count back to 0.

    [​IMG]
     
  5. WBahn

    Moderator

    Mar 31, 2012
    17,726
    4,788
    You're moving in the right direction, at least conceptually. Now you are at least trying to enable the count based on the output. However, now the only time your count is enabled is when Q0 and Q2 are both HI.

    You still have the problem that your whenever your counter is not counting up it is counting down.

    Take a step back and list, very specifically, what your inputs are and what you want the circuit to do on the next clock pulse under all possible combinations of the inputs and the current count value. Once you have that (and only AFTER you have that), map those desired behaviors to the inputs that need to be applied to the counter in order to achieve that behavior.
     
    Outcast likes this.
  6. Outcast

    Thread Starter New Member

    Mar 17, 2013
    3
    0
    Hi, I have revised my circuit. Since for Texas Instrument 74191, to count up, an active low signal has to be sent to Pin 5. I understood that I should not connect a pushbutton to this pin as this will toggle the counter to either count up/down depending on state of the pushbutton.

    The U3A NAND gate will become 0 when Q0 (LSB) & Q2 (MSB) [101 = 5] are high. At other times the output @ U3A is high. This will enable U4A AND gate to have high input which will be sent to the enable pin when the INSERT pushbutton is press.

    So when count reaches 5, the U3A NAND will be 0 and the counter will no longer count until RESET is press, sending a low signal to PL (LOAD) to clear the counter.

    Please any feedback on my direction of thoughts and design. Thanks!

    [​IMG]
     
  7. WBahn

    Moderator

    Mar 31, 2012
    17,726
    4,788
    Do NOT leave inputs to logic gates floating!

    True, most (if not all) TTL logic families will treat a floating input as a HI, but it is very poor practice to rely on this. It leaves you very susceptible to noise.

    So revise your design such that every input is always driven either HI or LO.

    I still recommend making a detailed list of behavior as a function of input and state. It's a real simple list! It is also the FIRST step in problem solving, namely define the damn problem!
     
Loading...