mux2.vhd

来自「vhdl code for GIF Image Viewer」· VHDL 代码 · 共 22 行

VHD
22
字号
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity mux2 is
	 Generic ( size : integer := 8 );
    Port ( d0 : in std_logic_vector(size-1 downto 0);
           d1 : in std_logic_vector(size-1 downto 0);
           s : in std_logic;
           o : out std_logic_vector(size-1 downto 0));
end mux2;

architecture Behavioral of mux2 is
	signal ss : std_logic_vector(size-1 downto 0);
begin

ss <= (others => s);
o <= (d1 and ss) or (d0 and not ss);

end Behavioral;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?