CMOS Logic Gates

6
CMOS Logic gates

description

Verilog Code for CMOS NAND and CMOS NOR ( 2 input gates0

Transcript of CMOS Logic Gates

Page 1: CMOS Logic Gates

CMOS Logic gates

Page 2: CMOS Logic Gates

CMOS NAND Logic//CMOS logic gatesmodule fet_nand2(out, in_a,in_b);Input in_a,in_b;output out;wire wn// this wire connects the series nmos switchesSupply1 vdd;Supply0 gnd;pmosp1 (vdd,out,in_a);pmosp2(vdd,out,in_b);nmosn1(gnd,wn,in_a);nmosn2(wn,out,in_b)endmodule

Page 3: CMOS Logic Gates

CMOS NOR Logic

module fet_nor2(out, in_a,in_b);input in_a,in_b;output out;wire wp// this wire connects the series pmos switchessupply1 vdd;supply0 gnd;pmosp1 (vdd,wp,in_a);pmosp2(wp,out,in_b);nmosn1(gnd,out,in_a);nmosn2(gnd,out,in_b)endmodule

Page 4: CMOS Logic Gates

D Latchmodule d_latch (q,q_bar,d);input d;output q,q_bar;reg q,q_bar;always@(d)begin#(t_d)q=d;#(t_d)q_bar=~d;endendmodule

Page 5: CMOS Logic Gates

Gated D-latch with enable control

Page 6: CMOS Logic Gates

D latch ( structural description)module d_latch(q,q_bar,d,enable);input d,enable;output q,q_bar;reg q,q_bar;always @ (d and enable)begin #(t_d)q=d;#(t_d)q_bar = ~d;endendmodule