一个关于延迟检测的问题

2019-03-25 09:11发布

以下的代码,老是通不过编译,显示的错误是:Error (10822): HDL error at test17.vhd(384): couldn't implement registers for assignments on this clock edge 这段代码的主要意思是当speed2有下降沿时,通过外部时钟开始计数,等到“11111111”时间后,如果speed2还是低电平,则给计数器result加1,否则不加。主要是防止信号误操作的。 请各位大侠帮忙看看,是顺序有问题,还是哪里 有问题。谢谢   test:process(speed2,EXTCLK)
 begin
 case speedtest3 is
when 0 =>
    if speed2'event and speed2='0'then
     m<='1';
     end if;
     when 1 =>
   result1<=result;
     result<="0000000000000000";
end case;
if(m<='1')then
  if EXTCLK'event and EXTCLK='1'then
     if counter100="11111111" then
        if(speed2<='0')then
        result<=result+1;
        counter100<="00000000";
        m<='0';
        else m<='0';
        counter100<="00000000";
        end if; 
      else
      counter100<=counter100+1;
     end if;
     end if;
     end if;
 end process; 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
1条回答
eeleader
1楼-- · 2019-03-25 14:22
< /

楼主这种写法,不符合D触发器的工作原理。所以你的表达方式有问题。

 

建议你仔细研究一下HDL代码标准寄存器触发表达格式。

一周热门 更多>