BartlebyScrivener
Member level 5
- Joined
- Feb 8, 2012
- Messages
- 90
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 2,081
I am trying to create a module which switches x input data packets to a single output packet according to a one hot input.
If x was a fixed value, I would just create a case statement,
But with variable x, how do I define all cases?
Thanks.
If x was a fixed value, I would just create a case statement,
Code:
case (onehot)
4'b0000 : o_data = i_data[0];
4'b0001 : o_data = i_data[1];
4'b0010 : o_data = i_data[2];
4'b0100 : o_data = i_data[3];
4'b1000 : o_data = i_data[4];
default : o_data = 'z;
endcase
But with variable x, how do I define all cases?
Thanks.
Last edited: