关于VHDL时钟上升沿触发某信号置高电平并延时一段时间的问题
自己的程序如下,clk为计数用的时钟信号,要求busy信号每次都捕捉clk1的上升沿并产生1.2微秒的高电平延时,clk为周期0.1微秒的时钟,计数12次后将busy信号...
自己的程序如下,clk为计数用的时钟信号,要求busy信号每次都捕捉clk1的上升沿并产生1.2微秒的高电平延时,clk为周期0.1微秒的时钟,计数12次后将busy信号置低,在下个clk1上升沿到来后重复上述动作(clk1周期远大于clk) 求大家帮我改改程序,不是编译通不过就是结果出不来。。 一定要clk1的沿触发而非clk1电平触发!!
library ieee;
use ieee.std_logic_1164.all;
entity adtest is
port(clk:in std_logic;
clk1:in std_logic;
busy: buffer std_logic);
end adtest;
architecture example of adtest is
type array1 is array(0 to 100) of integer;
signal temp: array1;
signal tmp: integer range 0 to 100000;
signal result:integer range 0 to 100000:=0;
begin
process(clk,clk1)
begin
if clk'event and clk='1'then
result<=result+1;
end if;
if clk1'event and clk1='1' then
busy<='1';
temp(0)<=result;
if clk1='1'then
for i in 1 to 100 loop
temp(i)<=result;
if (temp(i)-temp(0)=12) then exit;
end if;
end loop;
busy<='0';
end if;
end if;
end process;
end example; 展开
library ieee;
use ieee.std_logic_1164.all;
entity adtest is
port(clk:in std_logic;
clk1:in std_logic;
busy: buffer std_logic);
end adtest;
architecture example of adtest is
type array1 is array(0 to 100) of integer;
signal temp: array1;
signal tmp: integer range 0 to 100000;
signal result:integer range 0 to 100000:=0;
begin
process(clk,clk1)
begin
if clk'event and clk='1'then
result<=result+1;
end if;
if clk1'event and clk1='1' then
busy<='1';
temp(0)<=result;
if clk1='1'then
for i in 1 to 100 loop
temp(i)<=result;
if (temp(i)-temp(0)=12) then exit;
end if;
end loop;
busy<='0';
end if;
end if;
end process;
end example; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询