综合资讯 技术文章 原文阅读 在线商城 下载专区 DATASHEET 技术论坛 商务频道

电子技术 | 技术资料 | 嵌入式系统 | 单片机专题 | DSP专题
EDA/PLD专题 | 电源技术专题 | 电子制作专题 | 其他综合 | 芯片选型

所在的位置:首页在线阅读EDA/PLD专题VHDL程序举例-组合逻辑正文
 
8位总线收发器:74245

-- Octal Bus Transceiver
-- This example shows the use of the high impedance literal 'Z' provided by std_logic.
-- The aggregate '(others => 'Z')' means all of the bits of B must be forced to 'Z'. 
-- Ports A and B must be resolved for this model to work correctly (hence std_logic rather than std_ulogic). 
-- download from: www.pld.com.cn & www.fpga.com.cn

library IEEE;   
use IEEE.Std_logic_1164.all;

entity HCT245 is
   port(A, B : inout std_logic_vector(7 downto 0);
         DIR, GBAR : in std_logic);
end HCT245;

architecture VER1 of HCT245 is
begin
   A <= B when (GBAR = '0') and (DIR = '0') else (others => 'Z');
   B <= A when (GBAR = '0') and (DIR = '1') else (others => 'Z');
end VER1;

 

注: 一些PLD只允许I/O口对外三态,不支持内部三态,使用时要注意


返回 上一页 下一页   信息发布:工号01   转引自: 【 】 【打印】 【关闭

关于我们 ┋ 友情链接


深圳市福田区海滨广场福业大厦12C
电话:0755-88305880 25960580 传真:0755-88305880
Copyright©2005-2007 无忧电子开发网版权所有

粤ICP备05064233号