Logic diagram for 4 to 1 MUX:
module mux(
input [3:0] x,
input [1:0] s,
output mux_out
);
wire a,b,c,d,e,f;
not g1(a,s[1]);
not g2(b,s[0]);
and g3(c,x[0],a,b);
and g4(d,x[1],a,s[0]);
and g5(e,x[2],s[1],b);
and g6(f,x[3],s[1],s[0]);
or g7(out,c,d,e,f);
endmodule
No comments:
Post a Comment