Professional Documents
Culture Documents
Group data
Goal:
Design of the 2stage OpAmp such that it passes the given specifications (insert your specs below):
𝐶𝐶𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 [𝑝𝑝𝑝𝑝] 4
DC gain [dB] 47
𝑓𝑓𝐺𝐺𝐺𝐺𝐺𝐺 [MHz] 20
1) Calculate the 𝑉𝑉𝑂𝑂𝑂𝑂 , 𝑔𝑔𝑚𝑚 , 𝐼𝐼𝐷𝐷𝐷𝐷 and L of each transistor (see exceptions under “Remark”) and the required 𝐶𝐶𝑀𝑀
𝑔𝑔 𝑔𝑔
and 𝑅𝑅𝑀𝑀 in the OpAmp circuit. For that, insert all your calculations as well as your 𝑔𝑔 𝑚𝑚 -, 𝐼𝐼𝑚𝑚 -plots you used
𝑑𝑑𝑑𝑑 𝐷𝐷
for your handcalculations below:
Hints:
𝑔𝑔𝑚𝑚 𝑔𝑔𝑚𝑚
• First, plot and across 𝑉𝑉𝑂𝑂𝑂𝑂 and gatelength L and do it again across 𝑉𝑉𝐺𝐺𝐺𝐺 , as presented in the
𝑔𝑔𝑑𝑑𝑑𝑑 𝐼𝐼𝐷𝐷
1 session. Think about whether to create the plots for a PMOS or for a NMOS device.
st
𝑔𝑔
Figure 1: 𝑔𝑔 𝑚𝑚 vs 𝑉𝑉𝑂𝑂𝑂𝑂 across gatelength 𝐿𝐿
𝑑𝑑𝑑𝑑
Graph For Input Transistor Mp2
𝑔𝑔
Figure 2: 𝑔𝑔 𝑚𝑚 vs 𝑉𝑉𝐺𝐺𝐺𝐺 across gatelength 𝐿𝐿
𝑑𝑑𝑑𝑑
𝑔𝑔
Figure 3: 𝑔𝑔 𝑚𝑚 vs 𝑉𝑉𝑂𝑂𝑂𝑂 across gatelength 𝐿𝐿
𝑑𝑑𝑑𝑑
Graph for Output Transistor Mn6
𝑔𝑔𝑚𝑚
Figure 4: vs 𝑉𝑉𝐺𝐺𝐺𝐺 across gatelength 𝐿𝐿
𝑔𝑔𝑑𝑑𝑑𝑑
𝑔𝑔𝑚𝑚
Figure 5: vs 𝑉𝑉𝑂𝑂𝑂𝑂 across gatelength 𝐿𝐿
𝐼𝐼𝐷𝐷
Graph For Input Transistor Mp2
𝑔𝑔𝑚𝑚
Figure 6: vs 𝑉𝑉𝐺𝐺𝐺𝐺 across gate length 𝐿𝐿
𝐼𝐼𝐷𝐷
Using the graph: Finding the gain efficiency of Mn3 and Mn4 to find gm:
Using the graph: Gm plot for the transistors Mn3 and Mn4:
815.95mV
199.62mV
0.2V
Design: Implementation of the OpAmp in MATLAB and LTspice (10 points):
3) Based on your handcalculations, create your OpAmp design in MATLAB. After completion, please insert
your final and entire MATLAB code after the appendix (i.e. at the end of this report-document).
Remark:
• Please make sure that all widths W are below 1mm
4) Fill out both tables depicted below. All values are to be determined in MATLAB.
CM pF 1
RM Ω 2486.8
IBIAS A 0.13e^-3
5) Based on the parameters filled in the table above, design your OpAmp in LTspice. After completion,
please insert your final and entire LTspice-netlist after the appendix (i.e. at the end of this report-
document).
Experiment (10 points):
Plots:
Using the frequency response plot of the MATLAB simulation: For 0 (dB) of magnitude, the phase margin
is 89.6 (deg)
LTSPICE Plot:
Simulator PM (deg)
MATLAB 89.6
LTspice 90.1
7) Explain, analyse and interpret the results in “6)”. Furthermore, if you observe significant differences
between MATLAB and LTspice, explain why.
The results of the MATLAB simulation: We placed the zero in the right half plane at the non-dominant pole
frequency to compensate for the non-dominant pole and achieve this phase margin. This resulted in two
poles and one negative zero remaining. We can see that the phase never reaches -180° in the MATLAB
bode diagram. This is so that the zero at the double of the pole frequency can offset the effects of the
second pole.
The results of the LTSPICE simulation: At high frequencies, the phase keeps decreasing. This is due to two
factors: First, in LTSPICE, the non-dominant pole is not perfectly compensated. This indicates that the
system is still only slightly influenced by the non-dominant pole. Second, the Miller compensation
capacitor's impedance decreases at high frequencies, resulting in the resistor being in parallel with the
output resistances of the first and second stage. So, the gain of the operational amplifier is reduced by the
additional conductance.
The phase margin has a different value between MATLAB (89.6 deg) and LTSPICE (90.1 deg), and this
difference appears since the frequency of the dominant pole in LTSPICE simulation is lower than the
frequency of the dominant pole in MATLAB, and this difference is frequency leads to increases the phase
margin in LTSPICE more than that one in MATLAB.
Plot:
Case PM [deg]
10) Simulate the output-referred noise voltage power density 𝑑𝑑𝑣𝑣 �����������
2
𝑜𝑜𝑜𝑜𝑜𝑜,𝑒𝑒𝑒𝑒 �∆𝑓𝑓 over an appropriate frequency
�����������
range in LTspice. Then, insert the 𝑑𝑑𝑣𝑣 2
�∆𝑓𝑓-plot below.
𝑜𝑜𝑜𝑜𝑜𝑜,𝑒𝑒𝑒𝑒
Plots:
At low frequencies we see an exponential decrease in the output noise power spectral density. This
characteristic to the flicker noise (1/f noise) which is dominant at low frequencies. When the flicker noise
becomes negligible, the noise contribution is dominated by the white noise.
12) Simulate the input-referred noise spectral density by using the .NOISE option in LTspice. Also, by using
LTspice, determine the total output integrated noise of the OpAmp. For that, take the integration
bandwidth from 10 kHz to 10 ⋅ 𝑓𝑓𝐺𝐺𝐺𝐺𝐺𝐺 . Furthermore, copy and paste the top 9 contributing elements
using "View->SPICE Error Log" option and insert that list below.
The Y left axis represents the magnitude in (dB)
The X-axis represents the frequency in (Hz)
The Y right axis represents the phase in (deg)
We first notice a region at low frequencies where the flicker noise predominates when we analyze the
input referred rms noise. Then a region of constant noise appears, which is known as white noise.
Additionally, noise increases at very high frequencies because of the additional contribution and the
decrease in gain.
The total output integrated rms noise of the OTA is 0.00469 Vrms. The biggest contributors to the total
output noise are Mp1, Mp2, Mp3, and Mp4 which is to be expected since the noise generated at the input
is then amplified by the gain of the OTA. Normally one would expect the input transistors Mp1 and Mp2 to
generate the most noise since in the output noise, the noise coming from these transistors is multiplied by
the gain, and the contribution of the output noise of the transistors Mn3 and Mn4 is smaller than the total
voltage gain and smaller than the contributions of Mn1 and Mn2, because the flicker noise is inversely
proportional to the area of the transistor, Mp1 and Mp2 generate less noise than Mn3 and Mn4, where the
width of transistors Mn1 and Mn2 is bigger than the width of transistors Mn3 and Mn4.
The noise generated by Mp5 and Mn6 only undergoes the amplification of the second stage, which makes
its contribution to the total output noise significantly smaller than the previous transistors. The noise
contribution of Mp7 is also small since it is split equally over the two branches of the OTA and generates
therefore a common mode disturbance which is rejected by the common mode rejection of the OTA.
Transistor Mp8 generates noise which has an impact on Mp7 and Mp5, but since both transistors have a
small noise contribution the same will hold true for Mp8.
C. Linearity in LTspice
14) Simulate the output voltage amplitude and voltage gain as a function of the input voltage amplitude in
LTspice. Then, insert the plots below and indicate the 1-dB compression point.
Plots:
The output voltage amplitude and voltage gain as a function of the input voltage amplitude:
Vout for input Vin 13: Vout=-19.52dBVrms
In the figure of "final_project_pss", for an input 13, the amplitude is 0.01V,so the output at 10Khz of input
frequency is calculated as follow:
Vin=0.01V
Vin = 20 × log10(0.01/√2) = -43dBVrms
Vout = -19.52dBVrms
Gain = -19.52-(-100) = 80.48dBV
The same calculations for the rest Vin.
We analyzed the linearity of the amplifier for input signals with varying amplitudes by measuring the
amplitude of the fundamental tone in the output signal. Prior to the compression point, a linear
relationship between the output and input voltage can be observed. This is because in this range, the first-
order linear coefficient K1 has the most significant impact on the output of the fundamental tone.
However, the overall contribution to the fundamental tone can be represented by:
3
𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 = 𝐾𝐾1 𝐴𝐴1 + 𝐾𝐾 𝐴𝐴3
4 3 1
As the input amplitude is increased, the output will surpass the maximum permissible output voltage range,
causing the transistors in the second stage to enter the triode region. Further increases in input will result
in the clipping of the output signal, preventing further amplitude increases and reaching saturation of the
output voltage. Additionally, as the compression point is approached, the gain begins to decrease.
Conclusion (10 points):
16) Conclude your experiment by filling the editable fields in the performance table depicted below
from
Metric Units Specification hand- MATLAB LTspice
calculations
���������
2
𝑣𝑣𝑜𝑜𝑜𝑜𝑜𝑜,𝑒𝑒𝑒𝑒 (output-referred noise) Vrms 0.00469
17) Comment about the deviations between hand calculation, MATLAB and LTspice values found above.
Conclude, what the causes of such deviations are.
There are deviations between the hand calculation and the MATLAB and LTSPICE simulation in the DC gain,
Gain Band Width frequency, and the dominant pole frequency.
For the DC gain, the values of the specifications and the hand calculation are almost the same (around
47dB) bigger than the values of the MATLAB and LTSPICE that are also around 41dB since the models are
not identical so some little difference in the parameters may occurs this issue especially the difference is
not very big.
For the frequency of the dominant pole 𝑓𝑓𝑑𝑑𝑑𝑑𝑑𝑑 , which is equal to GBW divided by the DC gain, the values of
the specifications and hand calculation are almost the same (around 423KHz), and the same for the values
of the MATLAB and LTSPICE simulation which are almost the same (around 160KHz), and this difference
between the 2 values is because the difference of the DC gain band width that is divided by a big GBW
frequency value that may occurs this gap.
Some possible causes of this deviation include also: The hand calculations or simulation may use incorrect
values for key system parameters, leading to large errors in the results. Or The MATLAB simulation may be
configured improperly, resulting in inaccurate results. Maybe also Some effects that should be considered
may be neglected in the hand calculations or simulation.
18) If you have results which are not passing the specifications: conclude for each of those result what the
cause is and what you need to do in order to make it pass, if you were repeating this experiment.
As a final result of all the calculation, we meet all the requirements and specifications in the hand
calculation where all the width are less than 1mm, and the values are logic.
Also, in the MATLAB simulation an LTSPICE, all the specifications are respected in the result and we get a
values near from the specifications in the most cases except the differences in the values that are discussed
in the previous question.
By repeating this experiment, we need to redo the calculation again and see if we change the inversion
level for some transistors what will happens to the gap if it can be eliminated.
Appendix:
clc;
%close all;
clear;
addpath(genpath('circuitDesign'));
addpath(genpath('functions'));
addpath(genpath('models'));
load('UMC65_RVT.mat');
%% Initializations
designkitName = 'umc65';
elementList.nmos = {'Mn3','Mn4','Mn6'};
elementList.pmos = {'Mp1','Mp2','Mp5','Mp7','Mp8'};
choice.maxFingerWidth = 10e-6;
choice.minFingerWidth = 200e-9;
simulator = 'spectre';
simulFile = 0;
simulSkelFile = 0;
spec = [];
analog = cirInit('analog',circuitTitle,'top',elementList,spec,choice,...
designkitName,NRVT,PRVT,simulator,simulFile,simulSkelFile);
%% Project: circuit
disp(' ');
disp(' | | | ');
disp(' | | | | | ');
disp(' | | | | | ');
disp(' | | | | | ');
%Our Specifications
spec.VDD = 1.1;
spec.fGBW= 20e6;
spec.GBW=spec.fGBW*(2*pi);
spec.Cl = 4e-12;
spec.Cm =spec.Cl/4;
spec.gain=47;
%% Mn6
Mn6.lg=200e-9;
Mn6.vds=0.55; %VDD/2
Mn6.vsb=0;
Mn6.w= mosWidth('gm',Mn6.gm,Mn6);
Mn6.ids=(Mn6.gm*Mn6.vov)/2; %formula
Mn6 = mosNfingers(Mn6);
Mn6 = mosOpValues(Mn6);
%% Mp2
Mp2.lg=200e-9; %approx
Mp2.vsb=0; %always
Mp2.vth= tableValueWref('vth',PRVT,Mp2.lg,0,Mp2.vds,Mp2.vsb);
Mp2.gm=2*pi*spec.fGBW*spec.Cm; %formula
Mp2.w=mosWidth('gm',Mp2.gm,Mp2);
Mp2.ids=(Mp2.gm*Mp2.vov)/2; %formula
Mp2 = mosNfingers(Mp2);
Mp2 = mosOpValues(Mp2);
%% Mp1
%gmp1=1.26*10^-4S
%% Mn4
Mn4.lg=200e-9; %approx
Mn4.vds=Mn6.vgs;
Mn4.vsb=0;
Mn4.vth= tableValueWref('vth',NRVT,Mn4.lg,0,Mn4.vds,Mn4.vsb);
Mn4.vgs=Mn4.vds; %it has the same vgs as Mn3, where Vgs=Vds because Mn3 is diode connected
Mn4.w=mosWidth('ids',Mn4.ids,Mn4);
Mn4 = mosNfingers(Mn4);
Mn4 = mosOpValues(Mn4);
%% Mn3
Vd= Mn4.vds-Mp2.vds; %%
%% Mp7
%%
Mp7.vds= -(spec.VDD-Vd);
Mp7.vsb=0;
Mp7.vth=tableValueWref('vth',PRVT,Mp7.lg,0,Mp7.vds,Mp7.vsb);
Mp7.vgs=Mp7.vov + Mp7.vth;
Mp7.ids=2*Mp2.ids;
Mp7.w= mosWidth('ids',Mp7.ids,Mp7);
Mp7 = mosNfingers(Mp7);
Mp7 = mosOpValues(Mp7);
%% Mp8
Mp8.vgs=Mp7.vgs;
Mp8.vds=Mp8.vgs;
Mp8.vth= tableValueWref('vth',PRVT,Mp8.lg,0,Mp8.vds,Mp8.vsb);
Mp8.w= mosWidth('ids',Mp8.ids,Mp8);
Mp8 = mosNfingers(Mp8);
Mp8 = mosOpValues(Mp8);
%% Mp5
Mp5.lg=500e-9;
Mp5.vov=-0.0; %w
Mp5.vds=-(spec.VDD-Mn6.vds);
Mp5.vsb=0;
Mp5.vth= tableValueWref('vth',PRVT,Mp5.lg,0,Mp5.vds,Mp5.vsb);
Mp5.w= mosWidth('ids',Mp5.ids,Mp5);
Mp5 = mosNfingers(Mp5);
Mp5 = mosOpValues(Mp5);
%% AI: Fill out the empty variables required to plot the transfer-function.
gainn=AvDC1*AvDC2;
%% AI: Set-up Rm, Cc and CL and calculate the zero required for the transfer-fct
%spec.Cm = spec.CL/4;
%spec.Cl = 4e-12;
%spec.Rm = 0;
z1 = 1/((1/Mn6.gm - spec.Rm)*(spec.Cm));
%% AI: Fill out the empty variables required for the performance summary
Vin_cm_min = Mn3.vov+Mn3.vth+Mp1.vth;
Vin_cm_max = spec.VDD-abs(Mp1.vgs)-abs(Mp7.vov);
Vout_cm_min = Mn6.vdsat;
Vout_cm_max = spec.VDD-abs(Mp5.vdsat);
p1 = G1/C1;
p2 = G2/C2;
p3 = G3/C3;
z2 = 2*p1;
if abs(p2)<abs(p3)
fGBW = gainn*p2/(2*pi);
else
fGBW = gainn*p3/(2*pi);
end
disp('======================================');
if mosCheckSaturation(Mp1)
fprintf('\nMp1:Success\n')
end
if mosCheckSaturation(Mp2)
fprintf('Mp2:Success\n')
end
if mosCheckSaturation(Mn3)
fprintf('Mn3:Success\n')
end
if mosCheckSaturation(Mn4)
fprintf('Mn4:Success\n')
end
if mosCheckSaturation(Mp5)
fprintf('Mp5:Success\n')
end
if mosCheckSaturation(Mn6)
fprintf('Mn6:Success\n')
end
if mosCheckSaturation(Mp7)
fprintf('Mp7:Success\n')
end
if mosCheckSaturation(Mp8)
fprintf('Mp8:Success\n\n')
end
%% Summary of sizes and biasing points (do not modify)
disp('======================================');
disp('======================================');
% transistor sizes
disp('======================================');
disp('======================================');
fprintf('\nmetrik \t result\n');
spec.fGBW/1e6,round(fGBW/1e6));
fprintf('Pdiss [mW] \t%.1f\n',Pdiss/1e-3);
spec.gain,20*log10(gainn));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
s = tf('s');
% transfer function
((1+s*C1/G1)*(1+s*C2/G2)*(1+s*C3/G3));
freq = logspace(1,12,1e3);
figure(1)
hax=axes;
xline(abs(G1/C1)./(2*pi),'--r','p1','LabelVerticalAlignment','bottom')
xline(abs(G2/C2)./(2*pi),'--b','pd','LabelVerticalAlignment','bottom')
xline(abs(G3/C3)./(2*pi),'--k','p3')
xline(abs(z2)./(2*pi),'--m','z2','LabelVerticalAlignment','bottom')
xline(abs(z1)./(2*pi),'--g','z1','LabelVerticalAlignment','bottom')
h = gcr;
setoptions(h,'FreqUnits','Hz');
title('Frequency response Opamp');
hold all
Cm N004 vinter 1p
Cload vout 0 4p
.lib C:\Users\lenovo\Documents\LTspiceXVII\lib\cmp\standard.mos
.include BSIM4_UMC65.lib
.op
.tran 10m
.param amp=1n
.backanno
.end