集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 4149|回复: 9

verilog异步触发问题

[复制链接]
AAT 发表于 2010-6-27 23:49:09 | 显示全部楼层 |阅读模式
两个敏感信号,a,b,其中我要b信号实现异步触发
请问高手我能否这样写
reg c;
reg[3:0]count
always @(posedge a or posedge b)
  begin
  count<=count+1;
  temp<=16'h1234;
if(b==1)
   begin
   c <=temp[count];
   
    end
  end
为什么提示这个错误:The logic for count[3:0] does not match a standard flip-flop
VVC 发表于 2010-6-28 01:24:16 | 显示全部楼层
乱七八糟,不明白楼主写这段代码要实现一个什么功能?为什么没有时钟?
CHAN 发表于 2010-6-28 01:59:43 | 显示全部楼层
最好把整个源程序贴出来看看!
CHANG 发表于 2010-6-28 02:47:08 | 显示全部楼层
你的c跟a无关吗?,<br>
那就把c单独拿出来放在以b为敏感表的always块里。<br>
另外你定义count时末尾少了;<br>
不知道是不是这个原因导致error。
ups 发表于 2010-6-28 04:22:59 | 显示全部楼层
应该视位宽定义和后面的1宽度不同造成的吧
CHA 发表于 2010-6-28 05:07:14 | 显示全部楼层
我作仿真时也出过&ldquo;The logic for count[3:0] does not match a standard flip-flop &rdquo;类似的问题,<br>
可能是信号&ldquo;C&rdquo;在多于一个模块中赋值的问题。有整个的程序吗?
HANG 发表于 2010-6-28 06:51:47 | 显示全部楼层
c &lt;=temp[count];<br>
这里temp是什么东西,有没有declare,temp[count]又想实现什么功能?
CHAN 发表于 2010-6-28 08:36:20 | 显示全部楼层
楼主最好给个全的代码!不然别人看不懂的,也没法帮你解决问题!
ups 发表于 2010-6-28 09:53:26 | 显示全部楼层
这个程序 没有能够看明白 。。。
longt 发表于 2010-6-28 10:36:35 | 显示全部楼层
module register (c,a,b,rst);<br>
output c;<br>
input a,b,rst;<br>
wire [15:0] temp;<br>
reg c;<br>
reg[3:0]count;<br>
assign temp=16'h1234;<br>
always @(posedge a or posedge b or posedge rst) begin<br>
&nbsp; &nbsp; if(rst) begin<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;count&lt;=0;<br>
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;c&lt;=0;<br>
&nbsp; &nbsp; end<br>
&nbsp; &nbsp; else<br>
if (a)&nbsp; &nbsp;&nbsp;&nbsp;<br>
count&lt;=count+1;<br>
else<br>
if(b)&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br>
c &lt;=temp[count] ;&nbsp; &nbsp;&nbsp;&nbsp;<br>
end&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br>
endmodule<br>
<br>
揣摩楼主的用意,写了段代码,请大家指正了~
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|集成电路技术分享 ( 京ICP备20003123号-1 )

GMT+8, 2024-6-26 21:56 , Processed in 0.074197 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表