【发布时间】:2014-02-18 14:02:02
【问题描述】:
这2个vhdl代码有什么区别?
第一:
library IEEE;
use IEEE.Std_Logic_1164.all;
entity mux4 is
port(
in1, in2, in3, in4 : in std_logic;
ctrl: in std_logic_vector(1 downto 0);
sai: out std_logic
);
end mux4;
architecture mux_bhv of mux4 is
begin
process(in1, in2, in3, in4, ctrl)
begin case ctrl is
when "00" => sai <= in1;
when "01" => sai <= in2;
when "10" => sai <= in3;
when "11" => sai <= in4;
when others => null;
end case;
end process;
end mux_bhv;
第二:
library IEEE;
use IEEE.Std_Logic_1164.all;
entity mux4x1 is
port(w, x, y, z: in std_logic_vector(7 downto 0);
s: in std_logic_vector(1 downto 0);
m: out std_logic_vector(7 downto 0)
);
end mux4x1;
architecture circuito of mux4x1 is
begin
m <= w when s = "00" else
x when s = "01" else
y when s = "10" else
z;
end circuito;
【问题讨论】:
-
我的代码没有被识别,所以我把它们上传到了 pastebin:pastebin.com/mvDVnUNnpastebin.com/GQFh9uBZ
-
我知道它们都是mux,但是代码之间有区别吗?
-
您会考虑合成产生的电路差异,还是仿真差异?一个是
std_logic之间的复用器,另一个是std_logic_vector(7 downto 0)之间的复用器;我认为这不是像您所追求的那样明显的区别... -
您怀疑有什么不同,为什么?
标签: vhdl