From Renesas document for CD4024, the minimum reset pulse width at 5V (@25°C) is 200ns. As has been pointed out by Carloc and Dwayne Reid, the generated reset signal by your circuit was way too brief to be registered by the binary ripple counter as proper reset. As Q5 goes high, the reset circuit triggers the reset pin to high. This causes CD4024 to initiate the clearing of all Qx output. However, individual Qx might not be cleared at the same time. So there can be 2 scenarios:
- If all the other Qx are cleared before Q5 is cleared, then as Q5 goes low, the reset signal goes low (deactivated) and everything is fine and dandy
- If Q5 is cleared before any other Qx are cleared, then as Q5 goes low, the reset signal goes low (deactivated) causing CD4024 to not clear those Qx that were not successfully cleared
The minimum reset pulse width is to avoid the undesirable scenario 2. This is the period needed to guarantee all Qx outputs are cleared to zero.
Dwayne Reid offered a reset circuit using an RC filter to lengthen the pulse width. However, this solution requires the RC time constant to be small enough such that the reset pulse width does not exceed the CLK clock period. Otherwise the counter will miss the next clock signal. A better solution is to use synchronous reset circuit as advised by Vince Patron.
Here is one such circuit:
The idea is to activate the reset signal (high) for half the clock cycle, i.e. the RESET goes high (activated) when CLK and Q5 go low and high, respectively. And it remains high even Q5 instantly goes low as the result of the reset. The RESET only goes low (deactivated) when CLK goes high after half the cycle. This will give enough time for the CD4042 to properly reset (clear all its outputs Qx) before the RESET signal is deactivated. The only thing you need to ensure is that the clock period is not smaller than twice the minimum reset pulse width. For CD4024, the clock period should be >400ns at 5V (@25°C). If you use 74HC4024, then the clock period should be >40ns at 4.5V (@25°C).
reset after 15 bits are shifted
Whatever the relation between bits and clk to the 4024, starting from 0 the latter will need a 16th clk edge to assert Q5 . \$\endgroup\$