|
本帖最后由 dspmatlab 于 2011-7-25 10:22 编辑
回复 12# njithjw
都试过 不行的 不知道程序有问题不 发上来请指正 谢谢
延时译码程序:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY e IS
PORT(D:IN STD_LOGIC;
CLK:IN STD_LOGIC;
Q:OUT STD_LOGIC);
END e;
ARCHITECTURE behav OF e IS
BEGIN
PROCESS(CLK)
BEGIN
IF(CLK'EVENT AND CLK='1') THEN Q<=D;
END IF;
END PROCESS;
END behav;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY not_not IS
PORT(n:IN STD_LOGIC;
t:OUT STD_LOGIC);
END not_not;
ARCHITECTURE behav OF not_not IS
signal not1:std_logic;
BEGIN
not1<=not(n);
t<=not(not1);
END behav;
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY work;
ENTITY yimays IS
PORT(beg: IN STD_LOGIC;
end1: IN STD_LOGIC;
O: OUT STD_LOGIC_VECTOR(3 DOWNTO 0));
END yimays;
ARCHITECTURE behav OF yimays IS
COMPONENT e IS
PORT(D,CLK:IN std_logic;
Q:OUT std_logic);
END COMPONENT;
COMPONENT not_not IS
PORT(n : IN STD_LOGIC;
t : OUT STD_LOGIC);
END COMPONENT;
SIGNAL Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12,Q13,Q14,Q15,out1,out2,out3,out4,out5,out6,out7,out8,out9,out10,out11,out12,out13,out14,out15:std_logic;
attribute preserve : boolean;
attribute preserve of out1,out2,out3,out4,out5,out6,out7,out8,out9,out10,out11,out12,out13,out14,out15 : signal is true;
BEGIN
U1: not_not PORT MAP(beg,out1);
U2: not_not PORT MAP(out1,out2);
U3: not_not PORT MAP(out2,out3);
U4: not_not PORT MAP(out3,out4);
U5: not_not PORT MAP(out4,out5);
U6: not_not PORT MAP(out5,out6);
U7: not_not PORT MAP(out6,out7);
U8: not_not PORT MAP(out7,out8);
U9: not_not PORT MAP(out8,out9);
U10: not_not PORT MAP(out9,out10);
U11: not_not PORT MAP(out10,out11);
U12: not_not PORT MAP(out11,out12);
U13: not_not PORT MAP(out12,out13);
U14: not_not PORT MAP(out13,out14);
U15: not_not PORT MAP(out14,out15);
U16: e PORT MAP(out1,end1,Q1);
U17: e PORT MAP(out2,end1,Q2);
U18: e PORT MAP(out3,end1,Q3);
U19: e PORT MAP(out4,end1,Q4);
U20: e PORT MAP(out5,end1,Q5);
U21: e PORT MAP(out6,end1,Q6);
U22: e PORT MAP(out7,end1,Q7);
U23: e PORT MAP(out8,end1,Q8);
U24: e PORT MAP(out9,end1,Q9);
U25: e PORT MAP(out10,end1,Q10);
U26: e PORT MAP(out11,end1,Q11);
U27: e PORT MAP(out12,end1,Q12);
U28: e PORT MAP(out13,end1,Q13);
U29: e PORT MAP(out14,end1,Q14);
U30: e PORT MAP(out15,end1,Q15);
O(0)<=(Q1 XOR Q2)OR(Q3 XOR Q4)OR(Q5 XOR Q6)OR(Q7 XOR Q8)OR(Q9 XOR Q10)OR(Q11 XOR Q12)OR(Q13 XOR Q14)OR Q15;
O(1)<=(Q2 XOR Q3)OR(Q3 XOR Q4)OR(Q6 XOR Q7)OR(Q7 XOR Q8)OR(Q10 XOR Q11)OR(Q11 XOR Q12)OR(Q14 XOR Q15)OR Q15;
O(2)<=(Q4 XOR Q5)OR(Q5 XOR Q6)OR(Q6 XOR Q7)OR(Q7 XOR Q8)OR(Q12 XOR Q13)OR(Q13 XOR Q14)OR(Q14 XOR Q15)OR Q15;
O(3)<=(Q8 XOR Q9)OR(Q9 XOR Q10)OR(Q10 XOR Q11)OR(Q11 XOR Q12)OR(Q12 XOR Q13)OR(Q13 XOR Q14)OR(Q14 XOR Q15)OR Q15;
END behav; |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?我要注册
x
|