首页 > 解决方案 > VHDL 3 位加法器。实体声明错误

问题描述

我对 VHDL 很陌生,我有一段代码无法找出错误。消息是:

Error (10500): VHDL syntax error at 3badder.vhd(6) near text "3";  expecting an identifier

我的代码:

    library ieee;
    use ieee.std_logic_1164.all;
    use ieee.std_logic_arith.all;
    use ieee.std_logic_unsigned.all;

    entity 3badder is
      port( a : in std_logic;
        b : in std_logic;
        c : in std_logic;
        sum : out std_logic;
        carry : out std_logic);
    end 3badder;

标签: vhdl

解决方案


名称不能以数字开头,将名称从“3badder”更改为“badder3”。

编辑:

看看一些 VHDL 参考。快速搜索后发现的一个:

https://www.ics.uci.edu/~jmoorkan/vhdlref/Synario%20VHDL%20Manual.pdf

“在 VHDL 中,名称……必须以字母开头……”(2-9)


推荐阅读