How to start a binary ripple counter from the middle?

Click For Summary
The discussion focuses on creating a binary ripple counter that starts at 3 and resets at 17 using JK latches. The user successfully implemented a reset mechanism for 17 but struggles to initiate the counter at 3. Suggestions include using the preset and reset capabilities of JK latches, or manipulating the output logic to adjust the least significant bits to achieve the desired count sequence. Alternative methods discussed involve adding external logic to modify the output states or counting from 0 to 14 and then adding 3. The conversation highlights the complexity of customizing flip-flop behavior in ripple counters.
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?
 
I haven't looked at this, but what happens if you take as your output ¬Q where you want a 1 in that position?
 
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:

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
11K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
10
Views
4K
Replies
5
Views
13K
  • · Replies 1 ·
Replies
1
Views
14K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K