|
本帖最后由 fpgaw 于 2010-7-6 05:41 编辑
我的双向三态门,怎么仿真结果不对.是不是程序有问题
LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
ENTITY BIDIR_BUFF8 IS
PORT
(
A,B : INOUT STD_LOGIC_VECTOR (7 DOWNTO 0);
EN : IN STD_LOGIC;
DIR : IN STD_LOGIC
);
END BIDIR_BUFF8;
ARCHITECTURE behave OF BIDIR_BUFF8 IS
SIGNAL A_TEMP,B_TEMP:STD_LOGIC_VECTOR(7 DOWNTO 0);
BEGIN
PROCESS(A,B,EN,DIR)
BEGIN
IF(EN='0')THEN
IF(DIR='1')THEN
B_TEMP<=A;
ELSE
A_TEMP<=B;
END IF;
ELSE
A_TEMP<=(OTHERS=>'Z');
B_TEMP<=(OTHERS=>'Z');
END IF;
END PROCESS;
B<=B_TEMP;
A<=A_TEMP;
END behave;Sample Text |
|