Complete the code to declare the state type in a Moore machine.
type state_type is ([1]);States in VHDL are declared as an enumerated type listing each state separated by commas.
Complete the code to define the state register signal.
signal current_state : [1] := IDLE;The state register must be of the state_type defined for the states.
Fix the error in the process sensitivity list for the Moore machine.
process([1]) begin if rising_edge(clk) then -- state transitions end if; end process;
The process should be sensitive only to the clock signal for synchronous state transitions.
Fill both blanks to complete the output logic of the Moore machine.
with current_state select output_signal <= [1] when IDLE, [2] when PROCESS, '0' when others;
Outputs depend only on the current state in a Moore machine. Here, output is '0' in IDLE and '1' in PROCESS.
Fill all three blanks to complete the state transition logic inside the clocked process.
process(clk) begin if rising_edge(clk) then if rst = '1' then current_state <= [1]; else case current_state is when IDLE => if start = '1' then current_state <= [2]; else current_state <= IDLE; end if; when PROCESS => if done = '1' then current_state <= [3]; else current_state <= PROCESS; end if; when others => current_state <= IDLE; end case; end if; end if; end process;
On reset, state goes to IDLE. From IDLE, if start is '1', go to PROCESS. From PROCESS, if done is '1', go to DONE.
