Skip to content

Instantly share code, notes, and snippets.

@cs8425
Created April 14, 2012 11:08
Show Gist options
  • Save cs8425/2383619 to your computer and use it in GitHub Desktop.
Save cs8425/2383619 to your computer and use it in GitHub Desktop.
mux4
module mux4( d, s, y );
input [3:0]d;
input [1:0]s;
output y;
wire [3:0]d;
wire [1:0]s;
wire y;
assign y= (s == 2'b00)? d[0]: (s == 2'b01)? d[1]: (s == 2'b10)? d[2] : d[3];
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment