EE214B: Folded Cascode
EE214B: Folded Cascode
EE214B: Folded Cascode
Parameter Units Requirement Achieved One way to approach identifying the inversion level appro-
Settling Time1 ns 50 34.6 priate for a given design is to develop a figure of merit that
Dynamic Range dB 70 71.0 combines these two high-level performance characteristics.
Power Dissipation mW - 1.31 Assuming that a particular application values gain and speed
Dynamic Settling Error % 1.5 1.0
Static Settling Error % 0.3 0.239 equally, one can simply seek to maximize the product of these
two parameters (Figure 1b). The selected performance metric
is seen optimized in the region of moderate inversion. In the
particular case of the device technology used on this project
I. BACKGROUND (180nm Stanford process), the maxima is found around 12S/A.
This observation reveals moderate-weak inversion to be an
A. gm/ID Design intriguing and powerful design space. However, as enticingly
Fig. 2. Overview of work flow used to generate look-up tables. The output
of this onetime step is used as the basis for all subsequent analysis presented The basic Two-Stage with Compensation to the first-order has
in this paper. the same, high gain as the Telescopic Cascode (≈ (gmRo )2 )
but with higher output swing; here compensation is required
to prevent the introduction of two non-dominant poles (sym-
to determine ID or Csb , simulations are performed on the metrically at the between-stage nodes)–coming at the cost of
modeling file associated with the technology across four increased design complexity.
key parameter sweeps: L, Vgs , Vds , VS . From here multi- Meanwhile, although the Folded Cascode has worse noise
dimensional look-up tables are compiled that allow the de- performance than a basic Telescopic Cascode, it has the
signer to easily map a given sizing and operating conditions benefit of both a greater output swing and an output swing
to key design parameters.[1] decoupled from the input common-mode voltage. This noise
to output swing trade-off comes without a meaningful expense
B. Practicality Constraints to gain (at either low or high frequencies) relative to the basic
A series of constraints were imposed at the outset of the Telescopic Cascode.
design to ensure practical feasibility of the end-result.
TABLE II
P RACTICALITY C ONSTRAINTS
Parameter Constraint
Fanout ( C
C
L
) ≥1
S
CS
CF
2
Pole-Zero Cancellation dissallowed
(W/L)
Max Mirror Ratio 15 (W/L)max
min
Rail Voltage 1.8V
neutralization capacitor helped to lower the capacitance seen values (κ = 0.96, β = 0.25, gm/ID = 16S/A) and a 2D sweep
at Folded Cascode input, resulting in better bandwidth. This performed (Figure 5).
reduction of seen input capacitance (Cin ) also improved the
loop gain of the OTA due to its direct effect on the feedback
gain β (for detailed discussion, again, see Section II-C).
TABLE III
E FFECT OF X FACTOR ( WITH FIXED gm/ID,cascode = 15)
Fig. 5. Visualization of relationship between transistor lengths and loop gain.
The selected active load transistor and gain transistor channel lengths are
X Lo (dB) ST (ns) P (mW) rself N (µVrms ) DR (db) denoted by the white circle (0.7µm and 0.5µm, respectively).
0.8 51.56 39.4 0.95 0.137 258.0 70.16
1 51.67 34.6 1.39 0.177 70.96
1.2 50.89 32.1 1.92 0.220 225.1 71.34
From here, further optimizations were performed on the
OTA. Some of the remaining degrees of freedom that were ex-
plored include X, and the specific value of gm/ID,cascodestack .
While this knob provided revealing insights, the optimum
A gm/ID,cascodestack sweep from 10S/A to 25S/A was per-
was ultimately found near unity and as a result X=1 was
formed, and the resulting values plotted (Figure 6).
selected. See below for an informal exploration of the effects
of X on the operation of the circuit (Table III).
Overall, the optimization strategy focused on using the
performance targets to establish minimum acceptable values
for parameters. With minimum acceptable ranges, key remain-
ing degrees of freedom were iterated across in search of an
optimum. For example, the transient design specifications (e.g.
settling time, dynamic settling error, etc.) set the unity gain
frequency; knowing the desired OTA phase margin required
to achieve a critically damped response (e.i. 76◦ ), the location
of the desired non-dominant pole frequency was identified.
Derived equations (described later, Section II-C) used in
concert with the lookup-tables were then used to identify
the sizing+biasing required to attain the design specification-
derived circuit characteristics (e.g. ωp2 , ωu1 , etc).
One such degree of freedom was Length sizing. The tran-
sistors in the stage were divided into two groups based on
their function in the OTA: active load transistors and gain
transistors. The node at the input to the cascode stack acts Fig. 6. Effect of gm/ID,cascodestack on the OTA operation characteristics:
as a current divider with some of the signal going down into rself , PM and power consumption. The sweep was performed with X=1 (e.i.
the active loads (MN 2a/b ); this current division factor was all transistors had the same gm/ID ).
denoted as κ. Seeking to minimize κ across all frequencies,
As expected, a linear increase in gm/ID resulted in an
it was important to have the load transistor (MN 2a/b ) output
exponential increase in self loading as the devices get larger.
resistance due to channel length modulation (1/gds ) be large
Also as expected, the current consumption of the circuit
relative to the gain transistor (MN 3a/b ).2 This insight helped
decreases as the OTA moves into increasingly weak inversion;
guide length sizing.
one important observation made here was that the rate of
A second observation guiding length sizing was that the loop
power consumption decrease lessens as the OTA is pushed
gain of the OTA needed to be sufficiently large to meet the
further and further into weak inversion–becoming fairly flat
SSE specification. In order to understand the effect of channel
past gm/ID ≈ 15. Lastly, the phase margin can be observed
length on loop gain, some parameters were fixed to reasonable
as having a negative relationship to gm/ID ; as the OTA enters
2 At high frequencies the impedance looking up into the source of M
N 3a/b
weak inversion and the devices correspondingly increase in
is ≈ 1/gmN 3a/b . As 1/gmN 3a/b << 1/gdsN 2a/b , at high frequencies size, the node capacitances due to intrinsic and extrinsic
LN 3a/b
κ will be close to the ideal value of 1 largely independently of LN 2a/b
. At sources increase–bringing non-dominate poles to increasingly
low frequencies, κ will be more dependent on the length ratio. lower frequencies.
4
Ultimately a mid-range gm/ID of 16S/A was selected to Once those variables were defined to meet the design
balanced competing demands on power, gain and self-loading. targets, attention was turned to derive other variables that
Lastly, it was important to take into account the effect of depended on both gm/ID and the above block of parameters.
self-loading. This mechanism has the potential to significantly The following equations were solved in the order in which
impact the performance of the design. By presenting additional they appear below, using information gain from each preceding
capacitance at the output–the capacitive feedback pathway– expressions and lookup function table information:3
and associated loop gain, is altered.
CL,total
CF = ≈ 686f F
(1 + rself )( C L CS
CS CF + 1 − β)
CL CS
CL = CF ≈ 1.37pF
CS CF
CS
CS = CL ≈ 1.37pF
CL
ωu1 CL,total
gm1 = ≈ 2.9
βκ
gm1 X
It = ≈ 179µA
gm/Idcascode−stack
gm1
Cgg,1 = ≈ 940.7
2πfT,1
Fig. 7. Plot of self-loading iterations, converges to within 0.1% of the final Cin = Cgg,1 + Cgd,1 ≈ 1.08pF
value (0.2078) in only four iterations.
Cdd3 + Cdd,4
rself = ≈ 0.208
To account for the effects of self-loading, a simple iterative CL + (1 − β)CF
procedure employed: rself was initially set to zero and the CF
βresult = ≈ 0.2182
sizing script run; the effective capacitive network values were CF + CS + Cin
re-sized to account for the additional capacitance introduced gm3 + gmb3
by the intrinsic and extrinsic drain capacitances of the output ωp2,result = ≈ 3.76Grad/s
Css,3 + Cdd,2 + Cdd,1 + Cgd,1
transistors; this loop was traversed until the resulting rself ωp2,result 180
values converged to a level of agreement of 0.1% (Figure 7). P Mresult = atan( ) ≈ 85.44◦
ωu1 π
C. Detailed Calculation of Key Parameters Many of these equations match those described by Mur-
The calculations for the design flow draws on the gm/ID mann and Jespers.[1] However, there are key differences
approach outlined by Murmann and Jespers.[1] Modifications introduced by the added neutralization capacitor; in particular,
were made to incorporate neutralization, which was not em- the differences are seen in the equations for Cin and in
ployed in the text’s treatment of the Folded Cascode. the capacitance seen for the non-dominant pole wp2 . It is
κ was initially fixed at 1 to ungate usage of the lookup important to note that the resultant capacitance should be
tables. Once the intrinsic gains used to calculate κ were 2Cgd , but since Cdd includes a Cgd , only one extra Cgd was
computed, the resulting κ (0.955) was seen to be very close added in the calculation.
to the initial assumption. Length sizing was selected via the
approach discussed in Section II-A. Overall the following set D. Discrepancies between Matlab and HSpice
of equations define variables which are largely set by the
performance targets: All of the values calculated both in HSpice and Matlab were
collected in Table IV. The residual was subsequently computed
gm/Idcascode−stack to asses degree of agreement.
X= =1 Overall, the bulk of parameters matched quite well. For
gm/Id1
2 example, the calculations of the various intrinsic/extrinsic
0.5Vod,peak
Pnoise = ≈ 50nV 2 /Hz capacitances of the transistors had excellent agreement with
10DR/10 the associated HSpice .op simulation. Likewise, the gm/ID
log(1/DSE) also matched. This confirms the validity of the design process,
ωu1 = ≈ 300M rad/s
ST which leaned heavily on the use of analytical equations and
1 − SSE lookup tables.
Lo,min = ≈ 332.3
SSE
2γp γn 3 β was fixed to 0.25 (or, 3/4*β
α=2+ +4 ≈ 6.88 max ) for the calculation. At the end, β
X X was independently re-calculated based on the selected sizing to verify that
1 the initial assumption was reasonable; this independent calculation has been
κ= gds1 2gds2
≈ 0.955 denoted βresult . Ideally, β would be iterated for convergence however–
1 + gm 1 X + gm 2 because the β optimum curve is shallow–exact convergence is non-critical.
4 Represents the difference between the C
αKBoltzmann T gd,1 value and the neutralization
CL,total = ≈ 2.27pF capacitor. The difference is the remaining miller capacitance that can, in turn,
βPnoise experience miller amplification.
5
Fig. 8. A detailed schematic of the selected Folded Cascode OTA implementation. All transistors have been annotated with sizing information, gm/ID , and
(for PMOS devices only) bulk connection. All capacitor values have been noted along all with DC currents and bias voltages.
A .pz analysis of the open-loop behavior of the OTA reveals C. Common Mode Transient Response
the locations of the various poles and zeros. The design goal The output voltage versus time is shown in Figure 11. Of
of having the non-dominant pole be ≈ 4x away from the first note here is the symmetry as Vop and Vop swing apart.
pole is evident and appears to be properly executed. However,
both the non-dominant pole (fp2 ) and the unwanted LHP Zero
appear around 170MHz (Table V).
TABLE V
O PEN -L OOP L OW F REQUENCY P OLE -Z ERO L OCATIONS
D. Noise Performance
In the below, simulated plots (Figures 12 one can see
that the total integrated noise levels off at around 1 GHz
(≈ 238µV rms). In combination with the measured Vod,peak
(see Section III-E), this results in a dynamic range of 70.96dB,
which meets the desired specification.
Fig. 10. Transient simulation of the OTA response to an input step of 10mV.
* parameters
.param vocdes = 0.900
.param vsc_param = 1.067
.param vm2g_param = 0.541
.param vm3g_param = 0.811
.param vm4g_param = 1.003
.param vm5g_param = 1.273
.param it_param = 358.062u
.param cs_param = 1373.054f
.param cl_param = 1373.054f
.param cf_param = 686.527f
.param cn_param = 145.656f
.param w1_param = 222.160u
.param w2_param = 177.325u
.param w3_param = 56.772u
.param w4_param = 229.195u
.param w5_param = 356.950u
.param l1_param = 0.500u
.param l2_param = 0.700u
Fig. 13. Effect of input swing on OTA differential gain. .param l3_param = 0.500u
.param l4_param = 0.500u
A DC sweep simulation was performed in order to asses .param l5_param = 0.700u
* LSTB analysis
IV. C ONCLUSION vlstb_a vip_g vip ac 0
vlstb_b vim_g vim ac 0
Equations describing capacitance and pole locations, noise
and gain were derived for a Folded Cascode with neutraliza- * Output current measurement
vop_meas vop vop_c dc 0
tion. As a result this project provided a valuable outlet for the vom_meas vom vom_c dc 0
application of the analytical foundation built in EE214A.
* biasing
However perhaps more importantly, beyond analysis, the vm2g n_m2g 0 ’vm2g_param’
techniques taught in EE214B afforded the ability to gain vm3g n_m3g 0 ’vm3g_param’
vm4g n_m4g 0 ’vm4g_param’
exposure to Analog IC design. In doing so, this project vm5g n_m5g 0 ’vm5g_param’
helped flush-out intuition on the effect a given parameter has
* OTA circuit
on performance. The relationship between gm/ID and OTA it vdd vx_t ’it_param’
operation benchmarks such as speed, power consumption, loop m1a vx_ab vip_g vx_t vx_t pch W=’w1_param’ L=’l1_param’
m1b vx_ba vim_g vx_t vx_t pch W=’w1_param’ L=’l1_param’
gain, and self-loading was clearly revealed. Matlab plotting of m2a vx_ba n_m2g 0 0 nch W=’w2_param’ L=’l2_param’
parameter sweeps help clarify these relationships and visualize m2b vx_ab n_m2g 0 0 nch W=’w2_param’ L=’l2_param’
m3a vop n_m3g vx_ba 0 nch W=’w3_param’ L=’l3_param’
ways to tune the various knobs to try and meet specifications m3b vom n_m3g vx_ab 0 nch W=’w3_param’ L=’l3_param’
in the face of a wide, poorly-constrained design-space. m4a vop n_m4g n_m54a vdd pch W=’w4_param’ L=’l4_param’
m4b vom n_m4g n_m54b vdd pch W=’w4_param’ L=’l4_param’
The OTA managed to meet all performance targets. The m5a n_m54a n_m5g vdd vdd pch W=’w5_param’ L=’l5_param’
gain stage excels on many of the specifications (DR and SSE), m5b n_m54b n_m5g vdd vdd pch W=’w5_param’ L=’l5_param’
d1a 0 vx_t dwell 10p *size (see L2-3 slide 39)
however leaves further room for improvement of transient d1b 0 vx_t dwell 10p *size (see L2-3 slide 39)
performance. The slightly excessively high phase margin and
* feedback capacitors
therefore non-critically damped response which results in a cn_m vim_g vx_ab ’cn_param’
settling time that could be further optimized. cn_p vip_g vx_ba ’cn_param’
cs_m vim_c vim ’cs_param’
Ultimately the designer learned many lessons through the cs_p vip_c vip ’cs_param’
course of this project. These lessons came from carefully cl_p vop_c 0 ’cl_param’
cl_m vom_c 0 ’cl_param’
and systematically developing an design flow that emphasized cf_mp vim vop_c ’cf_param’
plotting results to assist observation-making and designing a cf_pm vip vom_c ’cf_param’
r_sm vim_c vim 10gig
fully stand-alone Matlab script for optimization. r_sp vip_c vip 10gig
**** diodes
subckt A PPENDIX C
element 0:d1a 0:d1b M ATLAB : D ESIGN F LOW
model 0:dwell 0:dwell
id -100.0000a -100.0000a This first Matlab script accepts parameters constrained by
vd -1.5990 -1.5990
req 0. 0. the design requirement specifications, in addition to a small
cap 1.1549f 1.1549f collection of design knobs (Lactiveload , Lgain , X, Vod,peak ,
**** mosfets
Vds,activeload ). Using this input information, sizing+biasing
subckt is calculated iteratively until self-loading effects have fully
element 0:m1a 0:m1b 0:m2a 0:m2b
model 0:pch 0:pch 0:nch 0:nch converged and returned in a vector corresponding to a range
region Saturati Saturati Saturati Saturati of gm/ID values.
id -182.2920u -182.2920u 363.8713u 363.8713u
ibs 0. 0. 0. 0. % LENGTH SIZING
ibd 0. 0. 0. 0. addpath(’/usr/class/ee214b/matlab/hspice_toolbox’);
vgs -531.9734m -531.9734m 541.0000m 541.0000m addpath(’/usr/class/ee214b/matlab’);
vds -1.3999 -1.3999 199.1007m 199.1007m load 180nch.mat;
vbs 0. 0. 0. 0. load 180pch.mat;
9
gm_gds1 = lookup(pch,’GM_GDS’,’GM_ID’,gm_Id./X,’VDS’,Vdd-
settling_error = 0.003; %from design spec Vt_comp-n_m23,’L’,L_gain,’VSB’,0)’;
G = 2; %from design spec gm_gds2 = lookup(nch,’GM_GDS’,’GM_ID’,gm_Id,’VDS’,n_m23,’
beta_max = 1/(1+G); L’,L_load,’VSB’,0)’;
beta = 0.75*beta_max; gm_gds3 = lookup(nch,’GM_GDS’,’GM_ID’,gm_Id,’VDS’,n_m34-
k = 0.95; n_m23,’L’,L_gain,’VSB’,n_m23)’;
L_gain = linspace(1,0.18,100); gm_gds4 = lookup(pch,’GM_GDS’,’GM_ID’,gm_Id,’VDS’,n_m45-
L_load = linspace(1,0.18,100); n_m34,’L’,L_gain,’VSB’,Vdd-n_m45)’;
gm_gds5 = lookup(pch,’GM_GDS’,’GM_ID’,gm_Id,’VDS’,Vdd-
gm_Id_2 = 16; n_m45,’L’,L_load,’VSB’,0)’;
gm_Id_3 = 16;
gm_Id_4 = 16; k = 1./(1+1./gm_gds1/X + 2./gm_gds2); %(1./gm_gds4)./(1./
gm_Id_5 = 16; gm_gds4 + 1./gm_gds1/X + 2./gm_gds2); %Murmann
gm_gds2 = lookup(nch,’GM_GDS’,’GM_ID’,gm_Id_2,’VDS’,0.2,’L’, suggest 0.9
L_load); Cl_tot = alpha./beta*k_b*T/p_noise; %Murmann p34
gm_gds3 = lookup(nch,’GM_GDS’,’GM_ID’,gm_Id_3,’VDS’,0.7,’L’, Cf = (Cl_tot)./(1+rself(length(rself)))./(Cl_Cs*Cs_Cf+(1-
L_gain); beta)); %Murmann p32
gm_gds4 = lookup(pch,’GM_GDS’,’GM_ID’,gm_Id_4,’VDS’,0.7,’L’, Cl = Cf.*Cl_Cs*Cs_Cf;
L_gain); Cs = Cl./Cl_Cs;
gm_gds5 = lookup(pch,’GM_GDS’,’GM_ID’,gm_Id_5,’VDS’,0.2,’L’, gm_1 = wu_1.*Cl_tot./beta./k;
L_load); It = gm_1./gm_Id.*X;
ft_1 = lookup(pch, ’GM_CGG’,’GM_ID’,gm_Id./X,’L’, L_gain,
for i = 1:length(gm_gds2) %L_load ’VSB’, 0, ’VDS’, Vdd-Vt_comp-n_m23)’/2/pi;
for j = 1:length(gm_gds3) %L_gain Cgg_1 = gm_1./(2*pi.*ft_1);
L0(i,j) = beta*k/(1/((1+gm_gds5(i)*gm_gds4(j))) + w_1 = It./lookup(pch,’ID_W’,’GM_ID’,gm_Id./X,’L’, L_gain,
1/((1+1/3*gm_gds2(i))*gm_gds3(j))); ’VSB’, 0, ’VDS’, Vdd-Vt_comp-n_m23)’;
end Cgd_1 = w_1.*lookup(pch, ’CGD_W’,’GM_ID’,gm_Id./X, ’L’,
end L_gain, ’VSB’, 0, ’VDS’,Vdd-Vt_comp-n_m23)’;
L0_minimum = (1-settling_error)/(settling_error); %L13-14 gm_3 = gm_Id.*It;
Slide 8 Cin = Cgg_1+Cgd_1; %before neutralization: Cin = Cgg_1+
Cgd_1.*gm_1./gm_3
figure(99);
imagesc(L_gain,L_load,L0) % COMPUTE RESULTING BENCHMARKS (rself, k, PM)
xlabel(’L_{gain} (um)’); w_2 = 2*It./lookup(nch, ’ID_W’, ’GM_ID’, gm_Id, ’L’,
ylabel(’L_{load} (um)’); L_load, ’VSB’, 0, ’VDS’, n_m23)’;
ylabel(colorbar,’Low Frequency Loop Gain’); w_3 = It./lookup(nch, ’ID_W’, ’GM_ID’, gm_Id, ’L’, L_gain
title(’Length Sizing Given Fixed K (K=0.95)’,’fontweight’,’ , ’VSB’, n_m23, ’VDS’, n_m34-n_m23)’;
bold’); w_4 = It./lookup(pch, ’ID_W’, ’GM_ID’, gm_Id, ’L’, L_gain
%% Part 3 (Limited Sweeping) , ’VSB’, Vdd-n_m45, ’VDS’, n_m45-n_m34)’;
% DESIGN/TECHNOLOGY SPECIFICATIONS w_5 = It./lookup(pch, ’ID_W’, ’GM_ID’, gm_Id, ’L’, L_load
close all; , ’VSB’, 0, ’VDS’, Vdd-n_m45)’;
clc; gmb_3 = gm_3.*lookup(nch,’GMB_GM’,’GM_ID’,gm_Id,’VDS’,
settling_error = 0.003; n_m34-n_m23,’VSB’,n_m23,’L’, L_gain)’;
settling_time = 10E-9; Cdd_1 = w_1.*lookup(pch,’CDD_W’,’GM_ID’,gm_Id./X,’VDS’,
dynamic_error = 0.001; Vdd-Vt_comp-n_m23,’VSB’, 0,’L’,L_gain)’;
Cl_Cs = 1; Cdd_2 = w_2.*lookup(nch,’CDD_W’,’GM_ID’,gm_Id,’VDS’,n_m23
Cs_Cf = 2; ,’VSB’, 0,’L’,L_load)’;
gamma_n = 0.84; Cdd_3 = w_3.*lookup(nch,’CDD_W’,’GM_ID’,gm_Id,’VDS’,n_m34
gamma_p = 0.88; -n_m23,’VSB’,n_m23,’L’,L_gain)’;
G = 2; Cdd_4 = w_4.*lookup(pch,’CDD_W’,’GM_ID’,gm_Id,’VDS’,n_m45
k_b = 1.38E-23; -n_m34,’VSB’, Vdd-n_m45,’L’,L_gain)’;
T = 300; %kelvin Css_3 = Cdd_3./lookup(nch,’CDD_CSS’, ’GM_ID’, gm_Id, ’VDS
DR = 70; %dB ’, n_m34-n_m23, ’VSB’,n_m23,’L’,L_gain)’;
Vdd = 1.8; %V
Vt_comp = 0.2; %V rself_new = (Cdd_3 + Cdd_4)./(Cl + (1-beta)*Cf); %Murmann
Vth = 0.5; %Threshold voltage (V) p32
%[min_residual, index] = min(abs(PM_result-76));
% ADJUSTABLE DESIGN PARAMETERS [min_residual, index] = min(abs(gm_Id-16));
beta_frac = 0.75; %larger can lead to smaller devices rself(length(rself)+1) = rself_new(index);
vod_peak = 1; end
L_load = 0.7;
L_gain = 0.5; figure;
rself = 0; %intial plot(rself,’-o’)
gm_Id = [10:0.05:25]; set(gca,’xtick’,0:length(rself))
X = 1; %x=gm_Id4/gm_Id1 set(gca,’xlim’,[0,length(rself)])
Vds_load = 0.2; %V (adjustable, no less than ˜100mV) title(’Self-loading Effect across Computation Iterations’,’
Vds_gain = Vdd/2-Vds_load; fontweight’,’bold’);
n_m45 = Vdd-Vds_load; xlabel(’Iteration #’);
n_m34 = Vdd/2; ylabel(’R_{self}’);
n_m23 = Vds_load;
beta_result = Cf./(Cf+Cs+Cin);
% Calculations directly from specifications wp_2_result = (gm_3 + gmb_3)./(Css_3 +Cdd_2 + Cdd_1 + Cgd_1)
beta_max = 1/(1+G); ; %nondominant pole frequency (Murmann)
beta = beta_frac.*beta_max; PM_result = atan(wp_2_result./wu_1)*180/pi;
p_noise = 0.5*vod_peakˆ2/(10ˆ(DR/10)); gm_Id_result = gm_Id(index)
wu_1 = log10(1/dynamic_error)/settling_time; %PM_result(index)
L0 = (1-settling_error)/(settling_error); %L13-14 Slide 8 k_result = k(index) %Murmann p32
alpha = 2*gamma_p*(1+gamma_p/gamma_p*X + 2*gamma_n/gamma_p*X
); figure;
subplot(3,1,1);
plot(gm_Id, rself_new);
% SIZING SECTION (finding capacitances, currents, gm1 and title(’Effect of gm/Id’,’fontweight’,’bold’);
gm3) xlabel(’gm/Id (S/A)’);
while ((length(rself) == 1) || (abs(rself(length(rself))- ylabel(’r_{self}’);
rself(length(rself)-1)) > 0.001)) subplot(3,1,2);
plot(gm_Id, PM_result);
10
subplot(3,1,2);
hold all;
plot(time,iod);
plot(time,iop);
plot(time,iom);
legend(’Ioc’,’Iop’,’Iom’);
xlim([0 40E-9]);
xlabel(’Time (s)’);
ylabel(’Iout (A)’);
title(’Transient Response Output Current’);
hold off;
subplot(3,1,3);
hold all;
plot(time,vid);
legend(’Vid’);
xlim([0 40E-9]);
ylim([-2 12]);%sets the y axis to look nice
xlabel(’Time (s)’);
ylabel(’Vin (mV)’);
title(’Transient Response Input Voltage’);
hold off;
%% Vod_peak Analysis
m = loadsig(’part3_peak.sw0’);
lssig(m);
vod = evalsig(m, ’v_vod’);
vsd = evalsig(m, ’v_vsd’);
gain = vod./vsd;
figure;
plot(vod, gain);
xlabel(’Vod (V)’);
ylabel(’Vod/Vsd’);
title(’Differential Output Swing’);
grid;
%% Noise Simulation
m = loadsig(’part3_ac.ac0’);
lssig(m);
f = evalsig(m, ’HERTZ’);
no = evalsig(m, ’outnoise’);
ni = evalsig(m, ’innoise’);
integ = cumtrapz(f, no);
integ_sqrt = sqrt(integ);
total_integrated_noise = integ_sqrt(end);
subplot(2,1,2)
loglog(f, ni);
xlabel(’f [Hz]’);
ylabel(’PSD [Vˆ2/Hz]’);
axis([min(f) max(f) min(ni)/10 10*max(ni)]);
title(’Input Noise’);
grid;