我编写了两个在 ISE Design Suite 中成功模拟的代码:
-- 2X1 Multiplexer
library IEEE;
use IEEE.STD_LOGIC_1164.all;
package mux2to1_pkg is
component mux2to1
port(d1,d0: in std_logic;
s: in std_logic;
f: out std_logic);
end component;
end mux2to1_pkg;
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity mux2to1 is
port(d1,d0: in std_logic;
s: in std_logic;
f: out std_logic);
end mux2to1;
architecture behavioral of mux2to1 is
begin
f <= (d0 and not s) or
(d1 and s);
end behavioral;
和
-- 6X1 Multiplexer
library IEEE;
use IEEE.STD_LOGIC_1164.all;
package mux6to1_pkg is
component mux6to1
port(d: in std_logic_vector(5 downto 0);
s: in std_logic_vector(2 downto 0);
f: out std_logic);
end component;
end mux6to1_pkg;
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use WORK.mux2to1_pkg.all;
entity mux6to1 is
port(d: in std_logic_vector(5 downto 0);
s: in std_logic_vector(2 downto 0);
f: out std_logic);
end mux6to1;
architecture structural of mux6to1 is
signal m1,m2,m3,m4: std_logic;
begin
mux1: mux2to1 port map(d(5),d(4),s(0),m1);
mux2: mux2to1 port map(d(3),d(2),s(0),m2);
mux3: mux2to1 port map(d(1),d(0),s(0),m3);
mux4: mux2to1 port map(m2,m3,s(1),m4);
mux5: mux2to1 port map(m1,m4,s(2),f);
end structural;
问题是当我想在 Active-HDL 中模拟 MUX6to1 时,输出根本不会改变。这个节目有什么秘诀?泰。