看了1本书,发现好像是写错了,关于连续赋值

[复制链接]
 楼主| redcar 发表于 2012-9-9 00:15 | 显示全部楼层 |阅读模式
Verilog HDL应用程序设计实例精讲
这本书里面的1个例子

//异步清零输入的下降沿D触发器
module test1(q,d,clr,clk);
input d,clr,clk;
output q;
reg q;//输出,寄存器类型
always @(clr)//清零信号
begin
        if(!clr)//下降沿清零
                assign q = 0;
                else                 
                deassign  q;
end
always @(negedge clk)//下降沿时钟
begin
q = d;
end
endmodule
编译失败了.
Error (10043): Verilog HDL unsupported feature error at test1.v(11): Procedural Continuous Assignment to register is not supported

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
GoldSunMonkey 发表于 2012-9-9 16:04 | 显示全部楼层
代码风格太差了。
javasun 发表于 2012-9-9 21:23 | 显示全部楼层
这风格 最好不要在不同的always块里对同一个值赋值
这里q 被多个always赋值 可能有问题
诲人不倦啊
推荐一本FPGA Prototyping by Verilog Examples:Xilinx Spartan-3 Version
Backkom80 发表于 2012-9-10 11:11 | 显示全部楼层
这书写的,......
您需要登录后才可以回帖 登录 | 注册

本版积分规则

20

主题

228

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部