One-hot FSM: derive logic by inspection
15%fsmGiven a 10-state FSM with one input in and two outputs, derive the next-state and output logic by inspection, assuming a one-hot encoding where state[i] corresponds to state Si. This is combinational logic only — no clock, no registers.
The transition structure (each row: where the state goes for each value of in):
| State | in = 0 | in = 1 |
|---|---|---|
| S0 | S0 | S1 |
| S1 | S0 | S2 |
| S2 | S0 | S3 |
| S3 | S0 | S4 |
| S4 | S0 | S5 |
| S5 | S8 | S6 |
| S6 | S9 | S7 |
| S7 | S0 | S7 |
| S8 | S0 | S1 |
| S9 | S0 | S1 |
Outputs (functions of state only): out1 = 1 in states S8 and S9; out2 = 1 in states S7 and S9.
For a one-hot design, each next_state[i] is the OR over all incoming arcs of state[source] & (in condition) — for example, S2 is entered only from S1 when in = 1, so next_state[2] = state[1] & in. Write all ten equations this way (plus out1 and out2). Do not decode the state with case statements or equality comparisons: the grader applies non-one-hot state patterns, which only the inspection-derived sum-of-products equations reproduce.