2

VHDL では、同じ変数を使用する case ステートメント内の変数を更新できますか? case ステートメントは、rising_edge(clk) ブロック内にあります。ありがとうございました。

                    case State_var is
                    when "00" => 
                        if (Valid= '1') then
                            State_var := "00";
                        else
                            State_var := "01";
                        end if;
                    when "01" => 
                        if (Valid = '1') then
                            State_var := "00";
                        else
                            State_var := "10";
                        end if;
                    when "10" => 
                        if (Valid = '1') then
                            State_var := "11";
                        else
                            State_var := "01";
                        end if;
                    when "11" => 
                        if (Valid = '1') then
                            State_var := "11";
                        else
                            State_var := "10";
                        end if;
                    when others => null;
                end case;
4

3 に答える 3

2

はい、できます。caseまた、次のステートメントのみを使用できます。

process(...)
...
variable state: std_logic_vector(2 downto 0);
...
begin
...
state := Valid & State_var;
...
    case state is
            when "000"  => State_var := "01";
            when "001"  => State_var := "10";
            when "010"  => State_var := "01";
            when "011"  => State_var := "10";
            when "100"  => State_var := "00";
            when "101"  => State_var := "00";
            when others => State_var := "11";
    end case;
...
end process;
于 2013-10-18T22:22:44.013 に答える