module demux2to4(I, SEL, Y); input [1:0] SEL; input I; output [3:0] Y; reg [3:0] Y; always @(I or SEL) begin Y = 4'd0; case (SEL) 2'b00 : Y[0] = I; 2'b01 : Y[1] = I; 2'b10 : Y[2] = I; 2'b11 : Y[3] = I; default : Y = 4'hx; endcase end endmodule