switcher_bus.vhd
来自「此为FPGA上的一个串口通信程序」· VHDL 代码 · 共 19 行
VHD
19 行
--
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity switch_bus is
generic(BUS_WIDTH:integer:=8);
port(din1:in std_logic_vector(BUS_WIDTH-1 downto 0);
din2:in std_logic_vector(BUS_WIDTH-1 downto 0);
sel:in std_logic;
dout:out std_logic_vector(BUS_WIDTH-1 downto 0));
end switch_bus;
architecture switch_bus of switch_bus is
begin
with sel select
dout<=din1 when '0',
din2 when others;
end switch_bus;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?