绑定,未知标识符和静态名称错误

时间:2015-04-17 09:22:15

标签: vhdl

我有这段代码

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

entity mux_4to1 is
    Port ( A : in std_logic;
           B : in std_logic;
           C : in std_logic;
           S : in std_logic_vector (1 downto 0);
           Y : out std_logic);
end mux_4to1;

architecture Behavioral of mux_4to1 is
component mux_2to1
    Port ( A : in std_logic;
           B : in std_logic;
           S : in std_logic;
           Y : out std_logic);
end component;

signal t1, t2 : std_logic;

begin
MUX1: mux_2to1 port map (A, B, S(0), t2);
MUX2: mux_2to1 port map (C, D, S(0), t1);
MUX3: mux_2to1 port map (t2, t1, S(1), Y);

end Behavioral;


entity mux_2to1 is
port
(A, B, S: in std_logic;
Y: out std_logic);
end mux_2to1;

architecture behav of mux_2to1 is
begin
Y <= A when(S='1') else B ;
end behav;

我得到了多个错误: enter image description here

这段代码甚至不是我的,我不是我自己在youtube视频上找到它并且它对我不起作用,我也注意到在组件名称声明之后如果我添加{ {1}}而不只是component mux_2to1 is它会让我收到此错误enter image description here,在youtube的原始代码中,它有component mux_2to1。当然我搜索了所有这些错误,但vhdl社区并不是那么大,程序对我和我对vhdl的了解太复杂,所以我无法按照给出的解决方案。

0 个答案:

没有答案