- このコンテキストではそのようなオペランドを持つことはできません
誰かが何が間違っているのか、それを修正する方法を教えてもらえますか?
インターネットで問題を検索しようとしましたが、なぜ STD_LOGIC_VECTOR に追加できないのですか? 問題を正しく説明するものは見つかりませんでした。ここで皆さんにお聞きしますが、何が問題なのですか?
entity Modes is
Port ( RST : in STD_LOGIC;
CLK_33MHZ : in STD_LOGIC;
BTN : in STD_LOGIC;
LED : out STD_LOGIC);
end Modes;
architecture Behavioral of Modes is
signal ledstatus : STD_LOGIC;
signal mode : STD_LOGIC_VECTOR(1 downto 0);
signal modestatus : STD_LOGIC_VECTOR (1 downto 0);
begin
process(CLK_33MHZ,RST)
variable cnt : integer range 0 to 33000000;
begin
if(RST = '1') then
cnt := 0;
mode <= "00";
LED <= '0';
ledstatus <= '0';
elsif(rising_edge(CLK_33MHZ)) then
if(BTN = '1') then
elsif(mode = "11") then
mode <= "00";
else
**mode <= mode + "01";** -- the problem in the code
end if;
if(mode = "00") then
LED <= '0';
elsif(mode = "01") then
LED <= '1';
elsif(mode = "10") then
if(cnt = 33000000) then
LED <= not ledstatus;
else
cnt := cnt + 1;
end if;
elsif(mode = "11") then
if(cnt = 330000) then
LED <= not ledstatus;
else
cnt := cnt + 1;
end if;
end if;
end if;
LED <= ledstatus;
end process;
end Behavioral;