task sel4;
input A,B,C,D;
input [1:0]sel;
output Y;
case(sel):
0: Y = A;
1: Y = B;
2: Y = C;
3: Y = D;
endcase
endtask
function sel4;
input A,B,C,D;
input [1:0]sel;
case(sel):
0: sel4 = A;
1: sel4 = B;
2: sel4 = C;
3: sel4 = D;
endcase
endfunction
以上全是手打的,请采纳呀