Design an up/down counter that has an input switch x and counts as follows:
If x = 0, the counter counts 1, 2, 3, 4, 5, 6, 7 and repeats
If x = 1, the counter counts 7, 6, 5, 4, 3, 2, 1 and repeats
The counter should be designed using D flip-flops and using the state equation method. (No credit will be given if the circuit is designed using the excitation table method.) Draw the final logic diagram. Note that count 0 is unused and should be treated as a "don't care" state.