Verilog HDL ?操作员 [英] Verilog HDL ? operator
本文介绍了Verilog HDL ?操作员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
? 在 Verilog 中有什么作用?
What does the ? do in Verilog?
例如:下面的命令是什么意思?
For ex: what does that mean of the following command?
input first_din;
input [7:0] din;
output [127:0] parity;
reg [127:0] parity;
wire [7:0] feedback;
assign feedback = din ^ (first_din ? 8'b0 : parity[127:120]);
推荐答案
在这段代码中,?
是条件运算符"(?:
) 的一部分.请参阅免费的 IEEE Std 1800-2012,表 11-1 - 运算符和数据类型.它用于对多路复用器建模.在您的情况下,first_din
是选择,8'b0
和 parity[127:120]
是数据输入.
In this code, ?
is part of the "Conditional operator" (?:
). Refer to the free IEEE Std 1800-2012, Table 11-1—Operators and data types. It is used to model a multiplexer. In your case, first_din
is the select, and 8'b0
and parity[127:120]
are the data inputs.
这篇关于Verilog HDL ?操作员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文