rrucha
Member level 3
I am implementing a MUX which basically selects which width of input data to use. Based on that, the output width of my MUX will change.
SO basically, when I use a case statement to select from the inputs, I also assign what out_width would be. Is that correct? Is there any other way, that is less messy, to do it?
And also, this SELECT gets set in another module that deals with the data. So is it safe to say that if that module takes care of setting the SELECT based on the data width coming to my module, I do not need to do anything else with my Select signal other than just taking it as an input?
Code:
input [width1-1:0] in1;
input [width2-1:0] in2;
input [width3-1:0] in3;
input [1:0] sel;
output [out_width-1:0] out;
SO basically, when I use a case statement to select from the inputs, I also assign what out_width would be. Is that correct? Is there any other way, that is less messy, to do it?
And also, this SELECT gets set in another module that deals with the data. So is it safe to say that if that module takes care of setting the SELECT based on the data width coming to my module, I do not need to do anything else with my Select signal other than just taking it as an input?
Last edited: