My homework assignment is to design a 3-bit counter using D flipflops. Now here are the twists:
- it has to be able to count from 0 through N and 0 through M, where 2 <N <= 4 and 5 < M (but otherwise I can choose N and M) in a modulus style so if N was 3 the counter would go 0-1-2-3-0-1-2-3-0-... and if M was six it would go 0-1-2-3-4-5-6-0-1-2-3-4-5-6-0-... and so forth.
- it has to be able to count forwards and backwards for both (0-N, N-0, 0-M and M-0)
- it has to have a state where it stops counting and just sits still at some the number 1