需要帮助找到语法错 误HDLCompiler:806

问题描述 投票:0回答:1

我一直试图让这些if语句工作,但我不能摆脱语法错误。

这是我得到的错误:

错误: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;
vhdl
1个回答
0
投票

您正在使用带有std_logic信号的双引号。像对else语句一样使用单引号。

© www.soinside.com 2019 - 2024. All rights reserved.