256 to 1 4 bit multiplexer

// in[sel*4 +: 4] 语法是Verilog中用于提取位段(切片)的操作。它的含义是:从 sel * 4 开始,提取4个位(即每个选择对应的4位宽输入)。
module top_module( 
    input [1023:0] in,
    input [7:0] sel,
    output [3:0] out );
    assign out = in[sel*4 +:4];
endmodule