top.v 302 Bytes
Newer Older
1 2 3 4 5 6
module mux16 (D, S, Y); 
 	input  [15:0] D;
 	input  [3:0] S;
 	output Y;
`ifndef BUG	
assign Y = D[S];
7
`else
8 9 10 11 12 13 14 15 16 17
assign Y = D[S+1];
`endif 
endmodule


module top (
input [3:0] S,
input [15:0] D,
output M16
);
18

19 20 21 22 23
mux16 u_mux16 (
        .S (S[3:0]),
        .D (D[15:0]),
        .Y (M16)
    );
24 25

endmodule