我是 VHDL 新手,并且遵循 xilinx 提供的实验室,但我在某些方面迷失了方向。在其中一个实验室中,我制作了一个 2 位宽的 2to1 多路复用器。在我目前的实验室中,我应该使用两个旧的多路复用器来构建一个 3to1 多路复用器。它根本没有解释如何做到这一点,所以我正在暗中尝试这个。我收到以下错误代码。
[HDL 9-806] “结束”附近的语法错误。[“C:/Nexys 4 >Projects/lab1_5_dataflow/lab1_5_dataflow.srcs/sources_1/new/mux_2bit_3_to_1_dat>aflow.vhd”:48]
[HDL 9-806] “;”附近的语法错误。[“C:/Nexys 4 >Projects/lab1_5_dataflow/lab1_5_dataflow.srcs/sources_1/new/mux_2bit_3_to_1_dat>aflow.vhd”:52]
[HDL 9-806] “=>”附近的语法错误。[“C:/Nexys 4 >Projects/lab1_5_dataflow/lab1_5_dataflow.srcs/sources_1/new/mux_2bit_3_to_1_dat>aflow.vhd”:55]
[HDL 9-806] “;”附近的语法错误。[“C:/Nexys 4 >Projects/lab1_5_dataflow/lab1_5_dataflow.srcs/sources_1/new/mux_2bit_3_to_1_dat>aflow.vhd”:59]
[HDL 9-806] “=>”附近的语法错误。[“C:/Nexys 4 >Projects/lab1_5_dataflow/lab1_5_dataflow.srcs/sources_1/new/mux_2bit_3_to_1_dat>aflow.vhd”:62]
这是我的主要源文件的代码。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mux_2bit_3_to_1_dataflow is
Port ( u : in STD_LOGIC_VECTOR (1 downto 0);
v : in STD_LOGIC_VECTOR (1 downto 0);
w : in STD_LOGIC_VECTOR (1 downto 0);
s : in STD_LOGIC_VECTOR (1 downto 0);
o : out STD_LOGIC_VECTOR (1 downto 0));
end mux_2bit_3_to_1_dataflow;
architecture Behavioral of mux_2bit_3_to_1_dataflow is
component mux_2bit_2_to_1 port
(
x, y : in STD_LOGIC_VECTOR;
s : in STD_LOGIC;
m : out STD_LOGIC_VECTOR
) end component;
signal a : STD_LOGIC_VECTOR;
begin
mux1 : mux_2bit_2_to_1 port map (
x => u; LINE 52
y => v;
s => s(1);
m => a LINE 55
);
mux2 : mux_2bit_2_to_1 port map (
x => a; LINE 59
y => w;
s => s(0);
m => o; LINE 62
);
end Behavioral;
这是我添加到项目中的 2 对 1 多路复用器的源文件。
entity mux_2bit_2_to_1 is
Port ( x : in STD_LOGIC_VECTOR (1 downto 0);
y : in STD_LOGIC_VECTOR (1 downto 0);
s : in STD_LOGIC;
m : out STD_LOGIC_VECTOR (1 downto 0));
end mux_2bit_2_to_1;
architecture Behavioral of mux_2bit_2_to_1 is
begin
m(0) <= (x(0) and not s) or (y(0) and s);
m(1) <= (x(1) and not s) or (y(1) and s);
end Behavioral;