3 second countdown increment

Thread Starter

heliosdguu

Joined Apr 30, 2024
11
I have a 30 second countdown circuit with 2 74ls90, 555 timer, and 2 seven segment Is there a way to add 3 seconds to its count whenever I activate a button? For example, if the count is currently at 20, it will become 23 when I press the button. I prefer to not use microcontrollers and just stick to sequential circuits.
 

MisterBill2

Joined Jan 23, 2018
19,476
A simple binary adder IC is all it would take to add tho the four least significant bits. The counter will input one half-byte, and then when +3 is required the first two bits of the second input will be ones. (+5 volts). That could be a 74LS83A, a four-bit adder. That is about as simple as it can get.
 
Last edited:

Thread Starter

heliosdguu

Joined Apr 30, 2024
11
A simple binary adder IC is all it would take to add tho the four least significant bits. The counter will input one half-byte, and then when +3 is required the first two bits of the second input will be ones. (+5 volts). That could be a 74LS83A, a four-bit adder. That is about as simple as it can get.
Hello, thank you for responding. I've tried implementing an adder ic but I'm having trouble deciding where to connect its output. I've set the 4 inputs of the adder to add 0011, the other inputs are from the outputs of the first 74ls190. I'm having trouble deciding where the outputs of the adder ic should be. Also, will using an adder ic make the sums pile up? I need something that when i press the button twice, will add 6 seconds, pressing it thrice will add 9 seconds and so on.
 

Attachments

AnalogKid

Joined Aug 1, 2013
11,209
First, it takes two 4-bit adders (or one 8-bit adder). You need the 2nd adder to handle a carry from the first one, such as changing a count of 8 into an 11.

Second, adding to the output of the counter does not actually change the number of clocks before the count reaches 0. What you need to do is change the content of the counters to reflect an increase of 3. To do this is a bit more complex.

Take the counter outputs through the binary adders, increase the value by 3, and send the result to the counter preset inputs. When you pull the LOAD- input low, the counters' internal values will jump to the value at the output of the adder.

A problem is that the counter preset inputs already are being used to set the initial count value (30). So now you need a 2 x 8 multiplexer to switch the counter inputs between the fixed initial value and the output of the adder.

NOTE: The 190 has an asynchronous load, so there is a possibility of an unstable loop from the counter output to the adder to the counter input.

This is getting very messy.

ak
 
Last edited:

WBahn

Joined Mar 31, 2012
30,303
Your circuit is based on BCD counters, so using a single 8-bit binary adder is going to probably cause you more problems than it is worth (but it can be done).

You need to look into, and understand, BCD arithmetic.
 

Thread Starter

heliosdguu

Joined Apr 30, 2024
11
First, it takes two 4-bit adders (or one 8-bit adder). You need the 2nd adder to handle a carry from the first one, such as changing a count of 8 into an 11.

Second, adding to the output of the counter does not actually change the number of clocks before the count reaches 0. What you need to do is change the content of the counters to reflect an increase of 3. To do this is a bit more complex.

Take the counter outputs through the binary adders, increase the value by 3, and send the result to the counter preset inputs. When you pull the LOAD- input low, the counters' internal values will jump to the value at the output of the adder.

A problem is that the counter preset inputs already are being used to set the initial count value (30). So now you need a 2 x 8 multiplexer to switch the counter inputs between the fixed initial value and the output of the adder.

NOTE: The 190 has an asynchronous load, so there is a possibility of an unstable loop from the counter output to the adder to the counter input.

This is getting very messy.

ak
Would it be easier if i start at 0. Then every time the button is pressed adds 3 seconds to the countdown? For example the first press would count down 3 to 0, but when i press it at 2, adds 3 seconds so now it counts down from 5 to 0
 

MisterBill2

Joined Jan 23, 2018
19,476
OK, I see a failure to communicate here! I understood that one press of the button added three seconds ONCE, AND THAT WAS ALL!!
THAT was the reason for only a single 4-bit added single digit adder.
Allowing repeated addition totally changes the game!!
Now the action requirements are totally different in every aspect!! The request should have stated:"add three seconds EVERY TIME I PRESS a button.
Now the counter needs to be a presettable down counter, with another, up-counter providing the preset number. And it will not be simple to add counts after the count has started.
I very much doubt that function is even available in TTL.or LSTTL devices.
At this point it certainly looks like a task for a micro-controller.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
11,209
Your circuit is based on BCD counters, so using a single 8-bit binary adder is going to probably cause you more problems than it is worth (but it can be done).
My bad. I remembered the carry, then forgot why it was necessary. AND, a binary adder won't work. I don't know of a single IC that is a 2-digit BCD adder, so two, 1-digit BCD adders are necessary.

ak
 

djsfantasi

Joined Apr 11, 2010
9,188
OR the clock (pushbutton) input with another counter configured to count up to three (or two). This 2nd counter is driven by an oscillator made from a flip flop. I said “or two” because the button already counted once.

Edit: I reread the original post. I imagined he said he was limited to certain ICs that included flip flops.
 

MisterBill2

Joined Jan 23, 2018
19,476
Now this has become what could be a mid-seventies TTL design project. Or maybe the 1980's era using low power 74LS logic. It may even be that the TS wants to be able to add to the count while it is counting down. Suddenly we have a pre-settable down counter with an up counter delivering the preset value, advancing in increments of three. Now it is definitely a prime candidate for a small micro-controller. Making it more challenging would be adding the three seconds while it is counting down. Possible with logic but really very tricky. Simple with a micro..
 

WBahn

Joined Mar 31, 2012
30,303
As a school assignment, the option of using an MCU is probably not an option -- and would defeat the purpose if this is a digital logic design course. How to approach the solution depends on what the actual problem really is. As usual, we are having to pull that information out piecemeal while guessing at much of it.

@heliosdguu What is the actual assignment you were given and what are the constraints that your solution has to abide by? That will enable us to help guide you toward a valid solution instead of sending you off down rabbit holes because we are making bad guesses about what it is you actually need to accomplish.
 

Thread Starter

heliosdguu

Joined Apr 30, 2024
11
As a school assignment, the option of using an MCU is probably not an option -- and would defeat the purpose if this is a digital logic design course. How to approach the solution depends on what the actual problem really is. As usual, we are having to pull that information out piecemeal while guessing at much of it.

@heliosdguu What is the actual assignment you were given and what are the constraints that your solution has to abide by? That will enable us to help guide you toward a valid solution instead of sending you off down rabbit holes because we are making bad guesses about what it is you actually need to accomplish.
Basically this is how the circuit should work. The initial press of the button would begin counting down from 3 to 0 using counters and seven segment display. If i press the button while it's counting down, it will add another 3 seconds. It is important that the counter does not stop counting down. For example the count down is at 2, and i press the button, it will countdown from 5 to 0 (adding 3 seconds to 2). Meanwhile if the count is at 4 and i press the button again, it will count down from 7 to 0. And so on.
 

WBahn

Joined Mar 31, 2012
30,303
Basically this is how the circuit should work. The initial press of the button would begin counting down from 3 to 0 using counters and seven segment display. If i press the button while it's counting down, it will add another 3 seconds. It is important that the counter does not stop counting down. For example the count down is at 2, and i press the button, it will countdown from 5 to 0 (adding 3 seconds to 2). Meanwhile if the count is at 4 and i press the button again, it will count down from 7 to 0. And so on.
There are some devil's in the details here. For instance, a person could easily push and release the button several times within a one second period, so should each of those be acted upon? Or is it acceptable for the circuit to only recognize a single push within each one second interval? If the latter, the design because a lot simpler as a synchronous state machine. The former is a lot more complex as it must now be asynchronous, with all of the demons that come along with such a design.
 

Thread Starter

heliosdguu

Joined Apr 30, 2024
11
There are some devil's in the details here. For instance, a person could easily push and release the button several times within a one second period, so should each of those be acted upon? Or is it acceptable for the circuit to only recognize a single push within each one second interval? If the latter, the design because a lot simpler as a synchronous state machine. The former is a lot more complex as it must now be asynchronous, with all of the demons that come along with such a design.
I can use a switch instead to prevent the button registering multiple inputs accidentally. I'm limited to counters, sequential, and combinational circuits
 

WBahn

Joined Mar 31, 2012
30,303
I can use a switch instead to prevent the button registering multiple inputs accidentally. I'm limited to counters, sequential, and combinational circuits
A switch versus a button makes no difference -- in the case of accidentally creating multiple input events, both will do that unless they are properly debounced. And, in either case, both are capable of being intentionally activated multiple times between the moment that the counter changes from one value to the next. The question is what behavior is required when this happens?

To help you focus on the relevant issue, consider the following:

Under normal conditions, the display would change values once each second. Let's assume that these start out perfectly synchronized to a wall clock whose second hand jumps from one second mark to the next at one-second boundaries (instead of moving smoothly). So your circuit starts counting down and at one boundary changes from 17 to 16. Then, half a second later, the person presses the button. What should happen and, more importantly, when should it happen? Should the display immediately change to 19? If so, when should it change to 18? Half a second later (i.e., at the next one-second boundary)? Or one second after the button was pressed? Or should the display change to 18 at the next second boundary, reflecting the normal change to 15 and the additional 3 seconds due to the button press?

Once you know what is expected to happen upon a single press of the button, you are in a better position to decide what should happen if the button (or switch) is activated multiple times between counter changes as some of the possibilities will have been ruled out.

If the details of the required behavior hasn't been specified, then you need to do one of three things: (1) Request clarification by presenting specific situations and asking the customer (instructor) what the required behavior is (this is the best approach, particularly if it is taken very early in the project, as it allows the customer to think more carefully about the fine print in light of what their actual needs are, which are frequently not as well understood by the customer as they thought they were), (2) Make a decision yourself about how the circuit will behave, claiming that since no required behavior was specified, any reasonable behavior must be acceptable (this is the worst approach, as it cuts the customer out of the decision loop and forces you to assume what is important to them, but is sometimes the only approach available), or (3) Identify the unspecified behaviors, decide what you think the proper behavior should be (and why), possibly including several alternatives, and present that to the customer for their consideration and decision (this is often the best approach in practice because customers frequently don't know what their true needs are, or what the consequences of various decisions might be, so this allows a back-and-forth discussion to help reveal what is really important and what kind of flexibility exists to find an acceptable compromise between what is truly needed and what is merely wanted).
 

MisterBill2

Joined Jan 23, 2018
19,476
Changing while counting is a problem because pre-settable counters start from the preset value. So it will require an up-down counter , with a very fast up count rate. Then every push of the button will implement a change of direction and deliver 3 "up"pulses, and return to counting down.
 

Thread Starter

heliosdguu

Joined Apr 30, 2024
11
Hllo,
A switch versus a button makes no difference -- in the case of accidentally creating multiple input events, both will do that unless they are properly debounced. And, in either case, both are capable of being intentionally activated multiple times between the moment that the counter changes from one value to the next. The question is what behavior is required when this happens?

To help you focus on the relevant issue, consider the following:

Under normal conditions, the display would change values once each second. Let's assume that these start out perfectly synchronized to a wall clock whose second hand jumps from one second mark to the next at one-second boundaries (instead of moving smoothly). So your circuit starts counting down and at one boundary changes from 17 to 16. Then, half a second later, the person presses the button. What should happen and, more importantly, when should it happen? Should the display immediately change to 19? If so, when should it change to 18? Half a second later (i.e., at the next one-second boundary)? Or one second after the button was pressed? Or should the display change to 18 at the next second boundary, reflecting the normal change to 15 and the additional 3 seconds due to the button press?

Once you know what is expected to happen upon a single press of the button, you are in a better position to decide what should happen if the button (or switch) is activated multiple times between counter changes as some of the possibilities will have been ruled out.

If the details of the required behavior hasn't been specified, then you need to do one of three things: (1) Request clarification by presenting specific situations and asking the customer (instructor) what the required behavior is (this is the best approach, particularly if it is taken very early in the project, as it allows the customer to think more carefully about the fine print in light of what their actual needs are, which are frequently not as well understood by the customer as they thought they were), (2) Make a decision yourself about how the circuit will behave, claiming that since no required behavior was specified, any reasonable behavior must be acceptable (this is the worst approach, as it cuts the customer out of the decision loop and forces you to assume what is important to them, but is sometimes the only approach available), or (3) Identify the unspecified behaviors, decide what you think the proper behavior should be (and why), possibly including several alternatives, and present that to the customer for their consideration and decision (this is often the best approach in practice because customers frequently don't know what their true needs are, or what the consequences of various decisions might be, so this allows a back-and-forth discussion to help reveal what is really important and what kind of flexibility exists to find an acceptable compromise between what is truly needed and what is merely wanted).
Hello, it doesnt matter if it changes at half a second, the important thing is that it adds the seconds instantly after a button or switch is activated. It does not matter if it is exactly fine tuned to the clock, as long as it can count
 

Thread Starter

heliosdguu

Joined Apr 30, 2024
11
Changing while counting is a problem because pre-settable counters start from the preset value. So it will require an up-down counter , with a very fast up count rate. Then every push of the button will implement a change of direction and deliver 3 "up"pulses, and return to counting down.
Hello do you have an idea to make this work? I have tried using a monostable 555 timer to activate an astable 555 that supplies 3 high signals, but it proceeds to count down rapidly instead of going up
 

MrChips

Joined Oct 2, 2009
31,108
Doable.
Increment/decrement the timer with short clock pulses, e.g. 1ms wide with 1s period.

On the half phase point, inject three 1ms wide pulses.
 
Top