529038792 发表于 2010-5-21 22:29:14

当无时钟脉冲时,控制器就输出为“0”,只要一个脉冲触发它,则它的输出就是“1

本帖最后由 fpgaw 于 2010-5-23 06:55 编辑

功能如下:当无时钟脉冲输入到控制器时,控制器就输出为“0”,只要由一个脉冲触发它时,则它的输出就是“1”,而且这个“1”是永远保持下去
我的程序是:library ieee;
use ieee.std_logic_1164.all;
entity keyon is
port(en:in std_logic;
      q:out std_logic);
end entity keyon;
architecture one of keyon is
begin
process(en)
begin
if (en'event) and (en='1') then
q<='1';
end if;
end process;
end architecture one;
波形全为高电平,这是怎么回事呢?

luckymiaojw 发表于 2010-5-22 17:03:18

use ieee.std_logic_1164.all;
entity keyon is
port(en:in std_logic;
      qut std_logic);
end entity keyon;
architecture one of keyon is
signal q:std_logic:=0;
begin
process(en)
begin
if (en'event) and (en='1') then
q<='1';
end if;
end process;
end architecture one;

weibode01 发表于 2010-11-9 11:13:04

VHDL啊。。。。我们不学这个。。。
页: [1]
查看完整版本: 当无时钟脉冲时,控制器就输出为“0”,只要一个脉冲触发它,则它的输出就是“1