请问 我的ISE工程 生成了TESTBENCH文件 用modelsim仿真的时候 只能出来一个周期
时间:10-02
整理:3721RD
点击:
library ieee;
use ieee.std_logic_1164.all;
entity div10 is
generic(n:integer :=10);
port (clk:in std_logic;
q:out std_logic);
end div10;
architecture behave of div10 is
signal count :integer range n-1 downto 0:=n-1;
begin
process(clk)
begin
if (clk'event and clk='1' and clk'last_value ='0') then
count = n/2 then
q<='0';
else
q<='1';
end if;
if count<=0 then
count<=n-1;
end if;
end if;
end process;
end behave;
use ieee.std_logic_1164.all;
entity div10 is
generic(n:integer :=10);
port (clk:in std_logic;
q:out std_logic);
end div10;
architecture behave of div10 is
signal count :integer range n-1 downto 0:=n-1;
begin
process(clk)
begin
if (clk'event and clk='1' and clk'last_value ='0') then
count = n/2 then
q<='0';
else
q<='1';
end if;
if count<=0 then
count<=n-1;
end if;
end if;
end process;
end behave;