我有一個非常奇怪的問題,我不是100%,爲什麼編譯器抱怨。 的代碼如下:VHDL中的簡單IF語句中的數據類型問題
variable a : std_logic_vector(2 downto 0);
variable b : std_logic;
....
if (a = "100") AND (b) then
-- do something
elsif (a = "011") OR (b) then
-- do something else
我得到那麼錯誤信息:
"AND can not have such operands in this context",
"OR can not have such operands in this context", respectively for the second IF
聲明。
任何人都知道爲什麼VHDL不喜歡這種結構,以及是否有解決方法?
感謝, 吉姆