1 / 31

//HDL Example 10-1 //-------------------- //CMOS inverter Fig. 10-22 (a) module inverter (Y,A);

//HDL Example 10-1 //-------------------- //CMOS inverter Fig. 10-22 (a) module inverter (Y,A); input A; output Y; supply1 PWR; supply0 GRD; pmos (Y,PWR,A); //(Drain,source,gate) nmos (Y,GRD,A); //(Drain,source,gate) endmodule. //HDL Example 10-2

habib
Download Presentation

//HDL Example 10-1 //-------------------- //CMOS inverter Fig. 10-22 (a) module inverter (Y,A);

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. //HDL Example 10-1 • //-------------------- • //CMOS inverter Fig. 10-22 (a) • module inverter (Y,A); • input A; • output Y; • supply1 PWR; • supply0 GRD; • pmos (Y,PWR,A); //(Drain,source,gate) • nmos (Y,GRD,A); //(Drain,source,gate) • endmodule

  2. //HDL Example 10-2 • //----------------------------- • //CMOS 2-input NAND Fig. 10-22(b) • module NAND2 (Y,A,B); • input A,B; • output Y; • supply1 PWR; • supply0 GRD; • wire W1; //terminal between two nmos • pmos (Y,PWR,A); //source connected to Vdd • pmos (Y,PWR,B); // parallel connection • nmos (Y,W1,A); // serial connction • nmos (W1,GRD,B); // source connected to ground • endmodule

  3. //HDL Example 10-3 //------------------- //XOR with CMOS switchs Fig. 10-25 module SXOR (A,B,Y); input A,B; output Y; wire Anot, Bnot; //instantiate inverter inverter v1 (Anot,A); inverter v2 (Bnot,B); //instantiate cmos switch cmos (Y,B,Anot,A); //(output,input,ncontrol,pcontrol) cmos (Y,Bnot,A,Anot); endmodule //CMOS inverter Fig. 10-22(a) module inverter (Y,A); input A; output Y; supply1 PWR; supply0 GRD; pmos (Y,PWR,A); //(Drain,source,gate) nmos (Y,GRD,A); //(Drain,source,gate) endmodule //Stimulus to test SXOR module test_SXOR; reg A,B; wire Y; //Instantiate SXOR SXOR X1 (A,B,Y); //Apply truth table initial begin A=1'b0; B=1'b0; #5 A=1'b0; B=1'b1; #5 A=1'b1; B=1'b0; #5 A=1'b1; B=1'b1; end //display results initial $monitor ("A =%b B= %b Y =%b",A,B,Y); endmodule

More Related