2017-01-23 107 views
0

我收到第16行的此消息:接近「'」:語法錯誤。我不確定我的錯誤是什麼。任何幫助將非常感激!在進程中使用if/then語句時VHDL語法錯誤

library IEEE; 
use IEEE.std_logic_1164.all; 

entity SystemI is 
    port (ABCD : in std_logic_vector(3 downto 0); 
      F : out std_logic); 
end entity; 

architecture SystemI_arch of SystemI is 

begin 

    process (ABCD) 
     begin 

      if (ABCD='0001') then 
       F <= '1'; 
      elsif (ABCD='0011') then 
       F <= '1'; 
      elsif (ABCD='1001') then 
       F <= '1'; 
      elsif (ABCD='1011') then 
       F <= '1'; 
      else 
       F <= '0'; 
      end if; 

    end process; 

end architecture; 
+0

[VHDL語法錯誤(可能的重複http://stackoverflow.com/questions/ 29478821/VHDL-語法錯誤) – user1155120

回答

0

您正在使用您的比較,這是用於單比特/字符常量單引號(')。對於載體,您需要使用"

將所有if/elsif語句的所有比較更改爲(ABCD="0001")

編輯:

另外,還可以用等效選擇的信號分配替換整個過程:

with ABCD select 
    F <= '1' when "0001" | "0011" | "1001" | "1011", '0' when others;