Let's say we want to show the count sequence 001->010->100->111 using D flip flops. Next step would be making a state table.
After simplifying using K-map, we get D^A=C', D^B=B', D^C=A. Then I built the circuit with two 7474 ICs and it works. If the counter starts with 000, it will go through the wrong sequence (000->110->101->011) . I am confused about how the counter is able to 'avoid' the wrong starting sequences and always get the correct starting sequences every time. I am using 74LS74N IC with both the clear and preset input activated FYI. The function table for both PRE and CLR set high is as follows. Given that it can also start with 000 or any other combination not in the correct sequence, it seems to be magical to me with the fact that it always begins with one of the combinations in the correct sequence every time I powered up the circuit.