module parameterized_mux ( result, data, sel );

// NOTE: Parameters must be declared in the same order as the Properties
//       are specified in the Cell Specification document.
	parameter LPM_WIDTH = 8;
	parameter LPM_SIZE = 4;
	parameter LPM_WIDTHS = 2;

	input [(LPM_SIZE * LPM_WIDTH)-1:0] data;
	input [LPM_WIDTHS-1:0] sel;
	output [LPM_WIDTH-1:0] result;

	integer i, j, m, n;
	reg [LPM_WIDTH-1:0] tmp_result;

	always @(*)
	begin
		tmp_result = 0;
		for (m=0; m<LPM_WIDTH; m=m+1)
		begin
			n = sel * LPM_WIDTH + m;
			tmp_result[m] = data[n];
		end
	end

	assign result = tmp_result;

endmodule // parameterized_mux

