summaryrefslogtreecommitdiff
path: root/tests/asicworld/code_hdl_models_mux21_switch.v
blob: 519c07fc5bd6e82e7f0436a3dd04207aa0c3d7f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//-----------------------------------------------------
// Design Name : mux21_switch
// File Name   : mux21_switch.v
// Function    : 2:1 Mux using Switch Primitives
// Coder       : Deepak Kumar Tala
//-----------------------------------------------------
module mux21_switch (out, ctrl, in1, in2);
   
   output out;                    
   input  ctrl, in1, in2;         
   wire          w;            

   supply1 power;             
   supply0 ground;      
   
   pmos N1 (w, power, ctrl);     
   nmos N2 (w, ground, ctrl);   
   
   cmos C1 (out, in1, w, ctrl);   
   cmos C2 (out, in2, ctrl, w);
   
endmodule