Professional Documents
Culture Documents
module mux16to1(out,x,s);
input [0:15] x;
input [0:3] s;
output out;
wire [0:15] y;
wire s1n,s0n,s2n,s3n;
and (y , x ,s ,s ,s ,s );.
;and (y , x ,s ,s ,s ,s )
.;and (y , x ,s ,s ,s ,s )
;and (y , x ,s ,s ,s ,s )
.;and (y ,x ,s ,s ,s ,s )
;and (y ,x ,s ,s ,s ,s )
.;and (y ,x ,s ,s ,s ,s )
;and (y ,x ,s ,s ,s ,s )
.;and (y ,x ,s ,s ,s ,s )
;and (y ,x ,s ,s ,s ,s )
.;and (y ,x ,s ,s ,s ,s )
;and (y ,x ,s ,s ,s ,s )
.;and (y ,x ,s ,s ,s ,s )
;and (y ,x ,s ,s ,s ,s )
.;and (y ,x ,s ,s ,s ,s )
;and (y ,x ,s ,s ,s ,s )
endmodule..
16 x 1 Multiplexer using 4 x 1 MUX
Post date: Nov 22, 2017 6:28:22 AM
HDL Test Bench File for 16:1 MUX [TESTMUX16.v]
module testmux_16;
mux16to1 mux(out,x,s);
initial
begin
$monitor("in=%b | sel=%b | out=%b", x,s,out);
end
initial
begin
in=16'b1000000000000000;
sel=4'b0000;
#30 in=16'b0100000000000000;
sel=4'b0001;
#30 in=16'b0010000000000000;
sel=4'b0010;
#30 in=16'b0001000000000000;
sel=4'b0011;
#30 in=16'b0000100000000000;
sel=4'b0100;
#30 in=16'b0000010000000000;
sel=4'b0101;
#30 in=16'b0000001000000000;
sel=4'b0110;
#30 in=16'b0000000100000000;
sel=4'b0111;
#30 in=16'b0000000010000000;
sel=4'b1000;
#30 in=16'b0000000001000000;
sel=4'b1001;
#30 in=16'b0000000000100000;
sel=4'b1010;
#30 in=16'b0000000000010000;
sel=4'b1011;
#30 in=16'b0000000000001000;
sel=4'b1100;
#30 in=16'b0000000000000100;
sel=4'b1101;
#30 in=16'b0000000000000010;
sel=4'b1110;
#30 in=16'b0000000000000001;
sel=4'b1111;
end
endmodule.
.
.
.
. b
b.
vb
s0.
s1
s2
s3
.