11. Implement a Low-Switching Route FSM

Loading simulator…

Gray encoding is preferred when state bits cross clock domains, drive asynchronous decode logic, or physically switch at slightly different times.

Since only one state bit changes between adjacent Gray-coded states, the probability of transient multi-bit decode glitches can be reduced.

It can also reduce simultaneous switching activity.

Gray encoding does not remove the need for proper synchronization or hazard-aware logic.

The excitation table is:

Q2Q1Q0XQ2+Q1+Q0+D2D1D0
0000001001
0001010010
0010011011
0011000000
0110010010
0111001001
0100000000
0101110110
1100010010
1101100100
1000110110
1001000000
1010, 1Don't CareXXX
1110, 1Don't CareXXX

The state codes 101 and 111 are unused by the FSM.

Invalid States are treated as don't-care conditions during logic minimization.

After Boolean minimization, the D-input equations are:

D2 = Q1·Q0'·X + Q2·Q1'·X'
D1 = Q0·X' + Q2·X' + Q2'·Q0'·X
D0 = Q1·Q0·X + Q1'·Q2'·X'

Therefore, the combinational logic connected to the three D flip-flop inputs is:

D2 = Q1·Q0'·X + Q2·Q1'·X'

D1 = Q0·X' + Q2·X' + Q2'·Q0'·X

D0 = Q1·Q0·X + Q1'·Q2'·X'

These equations are valid for all legal FSM states.