RTL Design #46 · 2026-11-08 · One-hot FSMs · Easy · about 10 min
A one-hot FSM that resets into limbo
seq is a small sequencer with three one-hot states: IDLE, RUN and DONE. Exactly one bit of state is meant to be set at a time, and the next-state logic is a one-hot reverse case (case (1'b1)).
IDLE→RUNwhenstartis high.RUNholds untilfinishis high, then →DONE.busyis high for every cycle inRUN.DONE→IDLEthe next cycle.donepulses for that single cycle.rst_n(synchronous, active low) returns the sequencer toIDLE.
Out of reset, start never seems to do anything: busy and done stay low forever. Fix seq.sv.
Write and run your answer in the browser. The hidden tests check it, and it’s free.