3(a) Design a synchronous counter with an external input X. When X = 1, the counter goes
through the state sequence 1, 4, 3, 6, 2, 5 and repeats. With X = 0, the counter counts in
the reverse direction. For states 0 & 7 assume don't cares as your next states. Design the
counter using D flip-flops and minimum logic gates. Draw the logic diagram. Show all
steps.
(b) From your design, what will be the next state if the counter starts in '0' state with X = 1
on power up? (Answer this part once your design is completed.)