Problem
Design an up-down Red ID counter using your own Red ID number. In this device, there are two expected inputs, namely U and D (U denotes upward counting and D denotes downward counting), and the outputs (not the states) of this device are used to represent the actual counted number.
For example, if your Red ID number is "87654321" and your actual input values are: U=1, D=0, then the outputs of the counter should show the following sequence: 8,7,6,5,4,3,2,1,8 (repeating);
If your Red ID number is "87654321" and your actual input values are: U=0, D=1, then the outputs of the counter should show the following sequence: 8,1,2,3,4,5,6,7,8 (repeating). For all other input combinations: U=D=0 and U=D=1, the outputs of the counter should stay at their current values without any changes. You need to design an FSM with appropriate number of states to reflect your counted output sequence.