Languages
An xbit
-type signal can take four values: 1
, 0
, x
, and z
. While I understand the need for x (unknown) and z (high impedance) values, sometimes I just want to suppress them to zeros to avoid problems in the subsequent blocks that use the signal. For wire/reg
-type signals, this is easy. How can I do it for xbit
-type signals?
One way to suppress 'x'
and 'z'
values in xbit
-type signals to 0's is to use buf_xbit
or inv_xbit
primitive. These primitives have a parameter named 'twostate'
. When this parameter has a non-zero value (e.g. 1), the primitive outputs 0 whenever the input is 'x'
or 'z'
.
For example, the following buf_xbit
and inv_xbit
instances will produce 0 as outputs when their input in
is 'x'
or 'z'
.
buf_xbit #(.twostate(1)) X1 (.in(in), .out(Y)); inv_xbit #(.twostate(1)) X2 (.in(in), .out(Z));
When composing model schematics in GLISTER, you can enable this 'twostate'
parameter for a buf_xbit
or inv_xbit
instance by selecting the Force 2-State Output option in its Edit Object Properties window as shown below.
Please login or Register to submit your answer
xbit 타입 신호는 1
, 0
, x
, 그리고 z
의 4가지 값을 가질 수 있습니다. Unknown
상태를 의미하는 x
와 high impedance
상태를 의미하는 z
값이 왜 필요한지는 잘 이해하고 있습니다만, 가끔은 신호가 x
와 z
값 없이 0
과 1
만으로 표현되었으면 하는 때가 있습니다. 특히 그 신호를 입력으로 사용하는 블럭들에서 x
와 z
값이 문제를 일으킬 때가 그렇습니다. wire
나 reg
타입 신호에서는 코드를 사용해 x
와 z
값을 모두 0
으로 쉽게 바꿀 수 있는데, xbit
타입 신호에 대해서는 어떻게 하면 되나요?
One way to suppress 'x'
and 'z'
values in xbit
-type signals to 0's is to use buf_xbit
or inv_xbit
primitive. These primitives have a parameter named 'twostate'
. When this parameter has a non-zero value (e.g. 1), the primitive outputs 0 whenever the input is 'x'
or 'z'
.
For example, the following buf_xbit
and inv_xbit
instances will produce 0 as outputs when their input in
is 'x'
or 'z'
.
buf_xbit #(.twostate(1)) X1 (.in(in), .out(Y)); inv_xbit #(.twostate(1)) X2 (.in(in), .out(Z));
When composing model schematics in GLISTER, you can enable this 'twostate'
parameter for a buf_xbit
or inv_xbit
instance by selecting the Force 2-State Output option in its Edit Object Properties window as shown below.
Please login or Register to submit your answer