⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dport16.vhd

📁 16位双向端口操作IP,对双向操作时很有用,希望有人喜欢!
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;

entity dport16 is
port(
		cin1 : in    std_logic;
		cin2 : in    std_logic;
		cout : in    std_logic;
		din1 : in    std_logic_vector(15 downto 0);
		din2 : in    std_logic_vector(15 downto 0);
		dout : out   std_logic_vector(15 downto 0);
		dio  : inout std_logic_vector(15 downto 0)
);
end dport16;

architecture a of dport16 is
begin

process(cin1,cin2,cout,din1,din2,dio)
begin
if cin1='1' then
	dio <= din1;
	dout <= (others=>'Z');
elsif cin2='1' then
	dio <= din2;
	dout <= (others=>'Z');
--else
--	dio <=(others=>'Z');
--end if;
elsif cout='1' then
	dio <=(others=>'Z');
	dout <= dio;
else
	dio <=(others=>'Z');
	dout <= (others=>'Z');
end if;
end process;

end a;    

⌨️ 快捷键说明

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