I am designing a 5-bit counter with two control inputs including direction (up/down) D and stop S.
Here is how counter works:
DS = 00: down (or decrease)
DS = 01: don't care
DS = 10: stop
DS = 11: up (increase)
I tried this as the reference here by using 5 D flip flops and logic gates.
However, the result requires a lot of logic gates.
There are some questions I am not clear now.
- For this problem, is there a way to know what kind of flip flops (SR, JK, D,...) will use the smallest number of logic gates?
- I referred the method to solve this problem by drawing state diagram and then implementing it as the reference above.
However, because the large number of bits (5 bits), the implementation is complex and mistake-prone.
Is there a better way to design instead the way above?
Also, are there any simpler counter that can do the task above?