介绍
哈哈哈哈,这个实在太简单了,但是毕竟做了一下,就在这记录一下了,哈哈哈哈。
这个器件的实现的主要功能是,当信号ena是低电平时,输出等于输入,反之,输出高阻态。
设计文件
library ieee;
use ieee.std_logic_1164.all;
entity tri_state is
port(ena : in bit;
input : in std_logic_vector(7 downto 0);
output : out std_logic_vector(7 downto 0));
end tri_state;
architecture tri_state of tri_state is
begin
output <= input when (ena = '0')else
(others => 'Z');
end tri_state;
测试文件
library ieee;
use ieee.std_logic_1164.all;
entity tb_tri_state is
end tb_tri_state;
architecture tri_state of tb_tri_state is
component tri_state is
port(ena : in bit;
input : in std_logic_vector(7 downto 0);
output : out std_logic_ve