Consider this VHDL snippet of a three-process FSM with synchronous reset. What will be the value of state after the first rising clock edge when reset is '1'?
architecture Behavioral of fsm is type state_type is (IDLE, WORK, DONE); signal state, next_state: state_type := IDLE; begin -- State register process process(clk) begin if rising_edge(clk) then if reset = '1' then state <= IDLE; else state <= next_state; end if; end if; end process; -- Next state logic process process(state, start) begin case state is when IDLE => if start = '1' then next_state <= WORK; else next_state <= IDLE; end if; when WORK => next_state <= DONE; when DONE => next_state <= IDLE; end case; end process; -- Output logic process process(state) begin done <= '0'; case state is when DONE => done <= '1'; when others => done <= '0'; end case; end process; end Behavioral;
Remember that synchronous reset sets the state at the clock edge.
Since reset is '1' at the rising edge, the state register process sets state to IDLE. The next state logic does not affect the current state immediately.
Given the same FSM as above, if reset is '0' and start is '1' at the rising clock edge, what will be the value of next_state immediately after the clock edge?
Same as challenge c1Check the next state logic process for the IDLE state when start is '1'.
When in IDLE and start is '1', the next state logic sets next_state to WORK.
Which option contains an error that will cause the state register process to not work as intended in a three-process FSM?
process(clk) begin if rising_edge(clk) then if reset = '1' then state <= IDLE; else state <= next_state; end if; end if; end process;
Check which signal is assigned inside the state register process.
Option A incorrectly assigns next_state inside the state register process instead of state. This breaks the FSM behavior.
Which option contains a syntax error in the output logic process of a three-process FSM?
process(state) begin done <= '0'; case state is when DONE => done <= '1'; when others => done <= '0'; end case; end process;
Check for missing semicolons and correct case syntax.
Option C is missing the semicolon after end case, causing a syntax error.
A three-process FSM has the states IDLE, WORK, and DONE. The output done is '1' only in the DONE state. How many unique output values and states does this FSM have?
Count the states and distinct output values based on the output logic.
The FSM has three states: IDLE, WORK, and DONE. The output done is '1' only in DONE, and '0' otherwise, so there are two unique output values.
