How to start a binary ripple counter from the middle?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
8 replies · 3K views
rasen58
Messages
71
Reaction score
2
I needed to make a ripple counter start from 3 and end at 17. I got it to reset to 0 when it reaches 17, but I can't get it to start from 3.
I am using 5 JK latches with LEDS attached to the outputs of each to represent each number.
To get it to stop at 17, I nanded the msb and lsb and connected it to the active low resets on the latches.
To start them at 3, I tried ORing the 3 msbs, and ORing the output of that to the 2 lsbs anded
3 = 00011, so if the msbs are all 0 and the 2 lsbs aren't 11, then it should output a 0. This works, but it also causes a problem, because now the reset is always low and it can never become a 1.
 
Physics news on Phys.org
Can I ask to what purpose you need to start and stop in these arbitrary positions? The more routine way to approach a problem like this is to let the counter run normally but treat the output differently.
 
Oh, my teacher just asked us to try it
 
Ahh, I see. Well, JK latches all start with both of their outputs low as far as I know, so that should tell you what you need to do to have the two you want start off high instead. Then you need to see what happens the first time each one toggles, which will lead you to another change you'll need to make. You do not need to tie any other gates to the first two.

Edit : I thought about this a minute longer and the initial thought I had isn't going to work. Not sure that it's possible now that I think about it more.
 
Last edited:
rasen58 said:
To get it to stop at 17, I nanded the msb and lsb and connected it to the active low resets on the latches.

Sometimes JKs have presets and resets. If not, there's always another way to reset or set a flip flop state. Your global reset signal should be another way, in addition to counter rollover, to start at 3.
 
aralbrec said:
If not, there's always another way to reset or set a flip flop state.

Through J and K. I didn't seem to finish my sentences in a few posts :)
 
How else would you reset a flip flop without an actual reset pin?
 
rasen58 said:
How else would you reset a flip flop without an actual reset pin?

When J=0 and K=1, the flip flop is reset on the next edge.
When J=1 and K=0, the flip flop is set on the next edge.

But I was not thinking of a ripple counter, sorry.

Instead of placing logic at the input, you can place logic at the output. One way is to count from 0 to 14 and add 3 with external logic. That would take a lot of gates and is not a good way to go.

Another idea which might be a winner is to change the bit values coming out of the two least significant bits. The two least significant bits count 00,01,10,11 but you want them to count 11,00,01,10. Can you add some logic at the output of those two smallest flip flops to make the translation?
 
Last edited: