我开始学习 SystemVerilog 。我陷入了优先级编码器的困境,无法获得这一部分:
priority if (encoder_in == {{14{1'bx}},1'b1,{1{1'b0}}})
答案 0 :(得分:0)
这实际上是3个常量的串联。
{ {14{1'bx}}, 1'b1, {1{1'b0}} }
1--^^^^^^^^^^
2--------------^^^^
3--------------------^^^^^^^^^
是复制运算符,它生成14位的“ x”。
是一位1
是具有单个重复的复制运算符。我不知道为什么要用这种方式。
以下将是等效表达式:
{{14{1'bx}}, 1'b1, 1'b0}
或这个
{{14{1'bx}}, 2'b10}
或者这个:
16'xxxxxxxxxxxxxx10
接下来,priority
是系统Verilog修饰符,可以应用于if
或case
运算符。了解系统Verilog中的unique
末尾priority
修饰符。