源代码
module mux_4_1(
a,b,c,d,s0,s1,s2,s3,y
);
input wire a,b,c,d,s0,s1,s2,s3;
output reg y;
always @(s0,s1,s2,s3)begin
case({s0,s1,s2,s3})
4'b0001:y<=a;
4'b0010:y<=b;
4'b0100:y<=c;
4'b1000:y<=d;
default:y<=1'b0;
endcase
end
endmodule
信号连接图