//这是4:1多路复用器
utf8mb4_bin
//这是完整的加法器
Library ieee;
use ieee.std_logic_1164.all;
ENTITY fourMux IS
PORT(B : IN BIT_VECTOR (0 to 3);
sel : IN BIT_VECTOR(0 to 1);
clk : IN BIT;
output : OUT BIT);
END fourMux;
ARCHITECTURE example OF fourMux IS
BEGIN
PROCESS (clk)
VARIABLE temp : BIT;
BEGIN
IF(clk = '1') THEN
IF sel = "00" THEN
temp := B (0);
ELSIF sel = "01" THEN
temp := B (1);
ELSIF sel = "10" THEN
temp := B (2);
ELSE
temp := B (3);
END IF;
output <= temp AFTER 5ns;
END IF;
END PROCESS;
END example;
// fourbit加法器
Library ieee;
use ieee.std_logic_1164.all;
entity fullAdders is
port(x,y,Cin :in std_logic;
sum, Cout:out std_logic);
end fullAdders;
architecture level of fullAdders is
begin
sum <= (x xor y xor Cin);
Cout <= (x and y) or (x and Cin) or (x and Cin);
end level;
这是我到目前为止所拥有的。我很困惑要将我的fourMux与完整的加法器一起使用?有什么建议吗?我从这里做什么?我尝试使用来自组件的端口映射,但没有成功。