如何修复移位运算符语法错误?
我正在尝试编译我的代码,但在使用算术右移运算符时出现错误:>>>
。这是代码:
if (from_id_hmic[117:115]==3'b011)
begin
reg_stat[rt[0]]>>>1'b1;
end
这是错误:
Error: E:/Modeltech_pe_edu_10.0/examples/hmic.v(86): near ">>>": syntax error, unexpected >>>
我的错误是什么?
I am trying to compile my code, but I am getting errors when using the arithmetic right shift operator: >>>
. Here is the code:
if (from_id_hmic[117:115]==3'b011)
begin
reg_stat[rt[0]]>>>1'b1;
end
Here is the error:
Error: E:/Modeltech_pe_edu_10.0/examples/hmic.v(86): near ">>>": syntax error, unexpected >>>
What is my mistake?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 Verilog 语句不完整。你需要做一个任务。仅仅尝试执行移位是不够的,就像
a + 2;
是一个不完整的语句一样。您可能想要这样的东西:或者也许:
>>>=
是“二进制算术移位赋值运算符”(请参阅 IEEE Std 1800-2009“运算符和数据类型”)。You have an incomplete Verilog statement. You need to make an assignment. Just trying to perform a shift is insufficient, just as
a + 2;
is an incomplete statement. You probably want something like this:or perhaps:
>>>=
is a "binary arithmetic shift assignment operator" (refer to IEEE Std 1800-2009 "Operators and data types").