문제

I am writing a verilog file. I am using the following code to function as a multiplexer:

assign out = raddr_mux ? a:b

However, the output wave seems strange. enter image description here

As you can see at the lower part of the image, the red line indicates that the raddr_mux is not defined. However, sometimes, the output out got value, sometimes the output out has nothing. I am wondering how the undefined will affect the selection behavior. Thank you!

도움이 되었습니까?

해결책

An x on an input means undefined, that is it is either 0 or 1.

If both inputs to a mux are at the same value it does not matter what the select value is, the output is still defined as it has to be one of the inputs. In our example the select is x but both inputs and output are 0, 4 then 5.

If the inputs are not the same, the output is x, it is undefined as it could be either of the input values.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top