switch.vhd

来自「< FPGA数字电子系统设计与开发实例导航> 一书的代码」· VHDL 代码 · 共 25 行

VHD
25
字号
-- 库声明
library IEEE;
use IEEE.STD_LOGIC_1164.all;
-- 实体声明
entity switch is
  port (
       din1 : in STD_LOGIC;
       din2 : in STD_LOGIC;
       sel : in STD_LOGIC;
       dout : out STD_LOGIC
  );
end switch;

--}} End of automatically maintained section
-- 结构体
architecture switch of switch is
begin

	-- 使用select语句
	with sel select
	dout <= din1 when '0',
			din2 when others;
			
end switch;

⌨️ 快捷键说明

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