我一直在尝试使这些if语句起作用,但是我无法摆脱语法错误。
这是我得到的错误:
ERROR:HDLCompiler:806-“ D:/Lab_7/control.vhd”第34行:“ =”附近的语法错误。 错误:ProjectMgmt-解析设计层次结构时发现1个错误。
entity control is
port (
opcode : in std_logic_vector(3 downto 0);
alu_src : out std_logic;
alu_op : out std_logic_vector(1 downto 0)
);
end entity control;
architecture main of control is
begin
process(opcode)
begin
if opcode = "0100" then
alu_src <= "1";
elsif opcode = "0101" then
alu_src <= "1";
elsif opcode = "0000" then
alu_src <= "0";
elsif opcode = "0001" then
alu_src <= "0";
elsif opcode = "0010" then
alu_src <= "0";
elsif opcode = "0011" then
alu_src <= "0";
else
alu_src = '0';
end if;
end process;
end architecture main;
答案 0 :(得分:0)
您在std_logic信号中使用双引号。对else语句使用单引号。