Complete the code to declare the input signal for the sequence detector.
signal clk : std_logic;
signal reset : std_logic;
signal input_bit : [1];The input bit for the sequence detector is a single bit, so it should be declared as std_logic.
Complete the code to define the state type for the FSM.
type state_type is (IDLE, S1, S2, [1]);The FSM needs a state to represent the third step in the sequence detection, commonly named S3.
Fix the error in the process sensitivity list to include all necessary signals.
process([1]) begin if reset = '1' then current_state <= IDLE; elsif rising_edge(clk) then -- state transitions end if; end process;
The process sensitivity list must include both clk and reset to properly detect asynchronous reset and clock edges.
Fill both blanks to complete the state transition condition for detecting the sequence '101'.
if current_state = S1 and input_bit = '[1]' then next_state <= [2]; else next_state <= IDLE; end if;
When in state S1 and the input bit is '1', the FSM should move to state S2 to continue detecting the sequence.
Fill all three blanks to complete the output logic that asserts '1' when the sequence is detected.
with current_state select output_signal <= '[1]' when S3, '[2]' when others; process(clk) begin if rising_edge(clk) then if output_signal = '[3]' then detected <= '1'; else detected <= '0'; end if; end if; end process;
The output signal should be '1' when in state S3 indicating the sequence is detected, and '0' otherwise. The process sets detected accordingly.
