Setting D Flip Flop Counter to Initial State

Thread Starter

bobsbugsbegone

Joined Nov 17, 2024
3
Hello all,
As the title implies, I’m currently designing / drawing a 4 bit counter composed of 4 D flip flops. I’m unfamiliar with circuits and was wondering how I would go about creating a reset button that would set the counter to its initial state in the sequence, which isn’t 0. Currently, my circuit successfully counts from 5-> 0 -> 9 -> 3 but I have no way of resetting it. I’m aware that if I were to connect the clear outputs of each D flip flop to a button, then the counter resets to 0. But, I was wondering how to reset it back to 5 once the reset button is hit. Thank you for your time.
 

Ian0

Joined Aug 7, 2020
13,097
Use the SET input on those latches that you need to start on 1 and the CLEAR input on those that start on 0.
 

Papabravo

Joined Feb 24, 2006
22,058
In addition to the initial reset to a non-zero state you might want to consider what happens if the counter manages to get to an illegal state. That is a state that is not part of your desired sequence. It might be the case that it will recover from some of the 12 illegal states but not others.
 

WBahn

Joined Mar 31, 2012
32,702
In addition to the initial reset to a non-zero state you might want to consider what happens if the counter manages to get to an illegal state. That is a state that is not part of your desired sequence. It might be the case that it will recover from some of the 12 illegal states but not others.
And first you need to decide if you want it to recover automatically. Sometimes, the proper action is to force it into a trap state so that it doesn't recover, as that could lead to undesirable effects.
 

Papabravo

Joined Feb 24, 2006
22,058
And first you need to decide if you want it to recover automatically. Sometimes, the proper action is to force it into a trap state so that it doesn't recover, as that could lead to undesirable effects.
Also a valid point, akin to a fielder's choice.
 
Top