概述
仅供参考,若发现错误请与我联系!
1.代码截图
2.测试代码截图
3.波形截图
4. 代码
library ieee;
use ieee.std_logic_1164.all;
entity zuoye8 is
port(T,clk,ret:in std_logic;
Q:buffer std_logic);
end entity zuoye8;
architecture jgt of zuoye8 is
begin
process(clk,ret) is
begin
if(ret='0')then
q<='1';
else
if(clk'event and clk='1') then
if(T='1') then
Q <= not(q);
else Q<=q;
end if;
end if;
end if;
end process;
end jgt;
5.测试代码
library ieee;
use ieee.std_logic_1164.all;
entity zuoye8_t is
end entity zuoye8_t;
architecture jgt_1 of zuoye8_t is
component zuoye8 is
port(T,clk,ret:in std_logic;
Q:buffer std_logic);
end component zuoye8;
signal clk,T,ret:std_logic:='0';
signal Q:std_logic:='0';
begin
instant:zuoye8 port map
(
ret=>ret,clk=>clk,T=>T,Q=>Q);
process
begin
clk<='0';
wait for 50 ns;
clk<='1';
wait for 50 ns;
end process;
process
begin
ret<='1';
wait for 120 ns;
ret<='0';
wait for 120 ns;
end process;
process
begin
T <= '0';
wait for 10 ns;
T <= '1';
wait for 10 ns;
end process;
end jgt_1;
最后
以上就是怕孤独御姐为你收集整理的Modelsim 仿真T触发器仅供参考,若发现错误请与我联系!的全部内容,希望文章能够帮你解决Modelsim 仿真T触发器仅供参考,若发现错误请与我联系!所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复