Skip to content

Instantly share code, notes, and snippets.

@embed0
Last active April 15, 2018 07:31
Show Gist options
  • Save embed0/1936b90f60e2b982b18310b754a6838e to your computer and use it in GitHub Desktop.
Save embed0/1936b90f60e2b982b18310b754a6838e to your computer and use it in GitHub Desktop.
//mux_2_1_1_bit_logic.v
module mux_2_1_1_bit_logic (x, y, s, m);
input x, y, s;
output m;
assign m = (~s & x) | (s & y);
endmodule
//#########################
//mux_2_1_1_bit.v
module mux_2_1_1_bit (SW, KEY, LEDR);
input [1:0] SW;
input [0:0] KEY;
output [0:0] LEDR;
mux_2_1_1_bit_logic logic(SW[0], SW[1], KEY[0], LEDR[0]);
endmodule
//#########################
//mux41.v
module mux41 (
input u,v,w,x,s0,s1;
output y;
)
wire k1,k2;
mux_2_1_1_bit_logic m1(u,v,s0,k1);
mux_2_1_1_bit_logic m2(w,x,s0,k2);
mux_2_1_1_bit_logic m3(k1,k2,s1,y);
endmodule
//#########################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment