quartus吧 关注:2,965贴子:7,374
  • 1回复贴,共1
遇到了毛刺现象,怎么修正
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY CNT99 IS
PORT (CLK,RST,EN : IN STD_LOGIC;
CQ: OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
DQ: OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
COUNT : OUT STD_LOGIC);
END;
ARCHITECTURE ARCH OF CNT99 IS
BEGIN
PROCESS(CLK, RST, EN)
VARIABLE CQI: STD_LOGIC_VECTOR(3 DOWNTO 0);
VARIABLE CQO: STD_LOGIC_VECTOR(3 DOWNTO 0);
BEGIN
IF RST= '1' THEN CQI:="1001" ; CQO:="1001";
ELSIF CLK'EVENT AND CLK='1' THEN
IF EN='1' THEN
IF (CQI= "0000" AND CQO/="0000")
THEN CQI:="1001";
CQO:=CQO-1;
ELSE CQI:=CQI-1; ----CQI是个位 CQO是十位
END IF;
END IF;
END IF;
IF ( CQI= "0000" AND CQI= "0000")
THEN COUNT <= '1';
ELSE COUNT <= '0';
END IF;
CQ <= CQI;
DQ<= CQO;
END PROCESS;
END ARCH;
99秒的倒计时波形图如下


IP属地:陕西1楼2017-05-03 11:02回复
    你这个是时序仿真,做功能仿真就好了


    来自Android客户端2楼2017-05-13 14:59
    回复