欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 资讯 > vivado报错:concurrent assignment to a non-ret ‘out‘ is not permitted

vivado报错:concurrent assignment to a non-ret ‘out‘ is not permitted

2025/10/18 9:48:22 来源:https://blog.csdn.net/w0801101117/article/details/141166597  浏览:    关键词:vivado报错:concurrent assignment to a non-ret ‘out‘ is not permitted

最近学习Xilinx FPGA时,想要写一个4-16译码器,即根据 4 bits 的输入信号来将 16 bits 的输出信号的某一位设置为 1。
在使用 assign 语句时,Vivado 报错Error:concurrent assignment to a non-ret 'out' is not permitted
在这里插入图片描述
查询 assign 语句的语法规则发现,该语句的左值(即等号左侧的变量)必须是wire类型,而不能是reg类型。
修改代码后报错消失:

module decoder_4_16 (input [3:0] in,output wire [15:0] out
);assign out = 16'b1 << in;endmodule

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词