- 在这种情况下不能有这样的操作数
有人可以告诉我出了什么问题以及如何解决吗?
我试图在互联网上搜索问题,为什么我不能添加到 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;