Assignment 1
Assignment 1
Q–1 Design a CMOS inverter which gets a rail to rail square wave as the input
with rise/fall times of 20 ps. Your inverter should have equal rise/fall times of
200 + 2×nn ps, where nn represents the last two digits of your roll number. The
design involves the choice of appropriate widths for n and p channel transistors
such that it meets the rise/fall time requirements with the given load. Measure
the rise/fall times of the output by finding the time taken by the output to
traverse between 10% of VDD and 90% of VDD.
Code:
* Minimum Inverter
.subckt inv supply Inp Output
* This subcircuit defines a CMOS inverter with equal n and p widths
.param Wn=0.349u
.param Wp=1.134u
.param l=0.18u
MP1 Output Inp Supply Supply cmosp
+ L=l W=wp AD = {wp*0.36U} AS = {wp*0.36U} PD = {2*(wp+0.36U)} PS =
{2*(wp+0.36U)}
MN1 Output Inp 0 0 cmosn
+ L=l W=wn AD = {wn*0.36U} AS = {wn*0.36U} PD = {2*(wn+0.36U)} PS =
{2*(wn+0.36U)}
.ends
Q–2 Use ng-spice to plot the static transfer characteristics of this inverter by
using a DC sweep on the input from 0 to VDD. Determine the static noise margins
for it by drawing tangents with slope = -1.
Code:
* Minimum Inverter
.subckt inv supply Inp Output
* This subcircuit defines a CMOS inverter with equal n and p widths
.param Wn=0.24u
.param Wp=0.24u
.param l=0.18u
.param l=0.18u
Code:
*question 3
.include models-180nm
.subckt pmos G D S
.param Wp=1.134u
.param l=0.18u
Mp D G S S cmosp
+ L=l W=wp AD = {wp*0.36U} AS = {wp*0.36U} PD = {2*(wp+0.36U)} PS =
{2*(wp+0.36U)}
.ends
.subckt nmos G D S
.param Wn=0.349u
.param l=0.18u
Mn D G S S cmosn
+ L=l W=wn AD = {wn*0.36U} AS = {wn*0.36U} PD = {2*(wn+0.36U)} PS =
{2*(wn+0.36U)}
.ends
*supply voltage
Vdd supply 0 dc 1.8
*load capacitance
C1 out 0 0.05pF
*circuit calling
x1 B d supply pmos
x2 C out d pmos
x3 A out supply pmos
x4 A out k nmos
x5 B k 0 nmos
x6 C k 0 nmos
*a part
VA A 0 DC {0.9*1.8}
VB B 0 DC {0.1*1.8}
VC C 0 DC 0 PULSE(0 1.8 0nS 20pS 20pS 4nS 8.0nS)
*b part
*VA A 0 DC {0.9*1.8}
*VC C 0 DC {0.1*1.8}
*VB B 0 DC 0 PULSE(0 1.8 0nS 20pS 20pS 4nS 8.0nS)
*c part
*VB B 0 DC {0.1*1.8}
*VC C 0 DC {0.9*1.8}
*VA A 0 DC 0 PULSE(0 1.8 0nS 20pS 20pS 4nS 8.0nS)
.tran 1ps 40ns 0ns
.control
run
plot 2+v(A) 4+v(B) 6+v(C) v(out)
meas tran drise TRIG v(out) VAL=0.18 RISE=2 TARG v(out) VAL=1.62 RISE=2
meas tran dfall TRIG v(out) VAL=1.62 FALL=2 TARG v(out) VAL=0.18 FALL=2
.endc
.end
a)
As we can see A is permanent on, and B is off so the output is just complement
of C, rise time and fall time of the following is calculated using meas
b)
As we can see A is permanent on, and C is off so the output is just complement
of B, rise time and fall time of the following is calculated using meas
c)