Merge remote-tracking branch 'origin/master' into xc7mux
[yosys.git] / tests / asicworld / code_hdl_models_mux_using_if.v
1 //-----------------------------------------------------
2 // Design Name : mux_using_if
3 // File Name : mux_using_if.v
4 // Function : 2:1 Mux using If
5 // Coder : Deepak Kumar Tala
6 //-----------------------------------------------------
7 module mux_using_if(
8 din_0 , // Mux first input
9 din_1 , // Mux Second input
10 sel , // Select input
11 mux_out // Mux output
12 );
13 //-----------Input Ports---------------
14 input din_0, din_1, sel ;
15 //-----------Output Ports---------------
16 output mux_out;
17 //------------Internal Variables--------
18 reg mux_out;
19 //-------------Code Starts Here---------
20 always @ (sel or din_0 or din_1)
21 begin : MUX
22 if (sel == 1'b0) begin
23 mux_out = din_0;
24 end else begin
25 mux_out = din_1 ;
26 end
27 end
28
29 endmodule //End Of Module mux