← ProblemsCircuits / Sequential Logic / Finite State Machines

One-hot FSM logic: Y2 and Y4

15%fsm

The same six-state FSM is now to be implemented with a one-hot state encoding, using six flip-flops y[6:1], where y[1] corresponds to state A, y[2] to B, y[3] to C, y[4] to D, y[5] to E, and y[6] to F. The transition table (input w):

Present stateNext state if w=0Next state if w=1
ABA
BCD
CED
DFA
EED
FCD

Derive, by inspection (the usual one-hot shortcut: a next-state signal is the OR of all "arrows" into that state, each arrow being present-state bit AND input condition), the logic for Y2 and Y4 — the next-state inputs of flip-flops y[2] (state B) and y[4] (state D).

Your logic will only ever be tested with valid one-hot values on y[6:1].