save changes
This commit is contained in:
parent
0b1a5bc9e0
commit
de3b11676d
159
PS1/doc.tex
159
PS1/doc.tex
@ -11,12 +11,22 @@
|
|||||||
\definecolor{gray}{rgb}{0.5,0.5,0.5}
|
\definecolor{gray}{rgb}{0.5,0.5,0.5}
|
||||||
\definecolor{mauve}{rgb}{0.58,0,0.82}
|
\definecolor{mauve}{rgb}{0.58,0,0.82}
|
||||||
|
|
||||||
\lstset{basicstyle=\small,
|
\lstset{language=Matlab,%
|
||||||
keywordstyle=\color{mauve},
|
%basicstyle=\color{red},
|
||||||
identifierstyle=\color{dkgreen},
|
breaklines=true,%
|
||||||
stringstyle=\color{gray},
|
morekeywords={matlab2tikz},
|
||||||
numbers=left
|
keywordstyle=\color{blue},%
|
||||||
}
|
morekeywords=[2]{1}, keywordstyle=[2]{\color{black}},
|
||||||
|
identifierstyle=\color{black},%
|
||||||
|
stringstyle=\color{mylilas},
|
||||||
|
commentstyle=\color{mygreen},%
|
||||||
|
showstringspaces=false,%without this there will be a symbol in the places where there is a space
|
||||||
|
numbers=left,%
|
||||||
|
numberstyle={\tiny \color{black}},% size of the numbers
|
||||||
|
numbersep=9pt, % this defines how far the numbers are from the text
|
||||||
|
emph=[1]{for,end,break},emphstyle=[1]\color{red}, %some words to emphasise
|
||||||
|
%emph=[2]{word1,word2}, emphstyle=[2]{style},
|
||||||
|
}
|
||||||
|
|
||||||
\title{ECE 456 - Problem Set 1}
|
\title{ECE 456 - Problem Set 1}
|
||||||
\date{2021-02-06}
|
\date{2021-02-06}
|
||||||
@ -35,29 +45,14 @@
|
|||||||
\singlespacing
|
\singlespacing
|
||||||
\pagenumbering{arabic}
|
\pagenumbering{arabic}
|
||||||
|
|
||||||
\section{Introduction}
|
\section{Question 1}
|
||||||
|
\subsection{(a)}
|
||||||
|
|
||||||
The purpose of this lab was to design control circuits according to the provided
|
\begin{equation}
|
||||||
specifications, and then verify their operation using a simulation or an FPGA.
|
N = $\int_{-\infty}^{\infty}$
|
||||||
|
\end{equation}
|
||||||
|
|
||||||
In the first part of the lab, a series of boolean expressions
|
|
||||||
were designed to implement a Multiplexer/Demultiplexer circuit,
|
|
||||||
intended to route data from one of three radio recievers to one
|
|
||||||
of three engineers, and signal which engineer was currently
|
|
||||||
recieving data.
|
|
||||||
First, Xilinx Vivado Software was used to produce a circuit
|
|
||||||
to fulfill this objective. Then, using the same software,
|
|
||||||
the circuit was simulated against input combinations which
|
|
||||||
would be encountered during normal use, for verification.
|
|
||||||
|
|
||||||
For the second part of the lab, an Access Control circuit was to be designed,
|
|
||||||
allowing lab entry only if a valid ID was provided alongside a proper keypad
|
|
||||||
combination. Otherwise, an alarm signal was to be sent out.
|
|
||||||
The method of designing this circuit was very similar to the method in part one:
|
|
||||||
Again using Xilinx Vivado, the circuit was designed and simulated against inputs
|
|
||||||
to verify if the outputs matched those in the specification.
|
|
||||||
However, for this section, the design was also uploaded to a physical FPGA board
|
|
||||||
where various could be manually tested and validated.
|
|
||||||
|
|
||||||
\section{Design Section}
|
\section{Design Section}
|
||||||
|
|
||||||
@ -70,30 +65,112 @@
|
|||||||
|
|
||||||
The VHDL architecture below was written to implement this circuit in hardware.
|
The VHDL architecture below was written to implement this circuit in hardware.
|
||||||
|
|
||||||
\begin{lstlisting}[language=MATLAB]
|
\begin{lstlisting}[language=Matlab]
|
||||||
U0 = 0.25;
|
clear all;
|
||||||
|
|
||||||
|
%% Constants
|
||||||
|
|
||||||
|
% Physical constants
|
||||||
|
hbar = 1.052e-34;
|
||||||
|
|
||||||
|
% Single-charge coupling energy (eV)
|
||||||
|
U_0 = 0.25;
|
||||||
|
% (eV)
|
||||||
kBT = 0.025;
|
kBT = 0.025;
|
||||||
|
% Contact coupling coefficients (eV)
|
||||||
|
gamma_1 = 0.005;
|
||||||
|
gamma_2 = gamma_1;
|
||||||
|
gamma_sum = gamma_1 + gamma_2;
|
||||||
|
% Capacitive gate coefficient
|
||||||
|
a_G = 0.5;
|
||||||
|
% Capacitive drain coefficient
|
||||||
|
a_D = 0.5;
|
||||||
|
a_S = 1 - a_G - a_D;
|
||||||
|
|
||||||
|
% Central energy level
|
||||||
mu = 0;
|
mu = 0;
|
||||||
|
|
||||||
|
% Energy grid, from -1eV to 1eV
|
||||||
|
NE = 501;
|
||||||
|
E = linspace(-1, 1, NE);
|
||||||
|
dE = E(2) - E(1);
|
||||||
|
% TODO name this better
|
||||||
cal_E = 0.2;
|
cal_E = 0.2;
|
||||||
|
|
||||||
% Capacitance parameters
|
% Lorentzian density of states, normalized so the integral is 1
|
||||||
|
D = (gamma_sum / (2*pi)) ./ ( (E-cal_E).^2 + (gamma_sum/2).^2 );
|
||||||
|
D = D ./ (dE*sum(D));
|
||||||
|
|
||||||
alpha_G = 0.5;
|
% Reference no. of electrons in channel
|
||||||
alpha_D = 0.5;
|
N_0 = 0;
|
||||||
alpha_S = 1 - alpha_G - alpha_D;
|
|
||||||
|
|
||||||
% Energy grid in eV, from -1 eV to 1 eV
|
voltages = linspace(0, 1, 101);
|
||||||
|
|
||||||
NE = 501;
|
% Terminal Voltages
|
||||||
E = linspace(-1,1,NE);
|
V_G = 0;
|
||||||
dE = E(2) - E(1);
|
V_S = 0;
|
||||||
|
|
||||||
% Gamma parameters, in eV
|
for n = 1:length(voltages)
|
||||||
|
% Set varying drain voltage
|
||||||
|
V_D = voltages(n);
|
||||||
|
|
||||||
gamma_1 = 0.005;
|
% Shifted energy levels of the contacts
|
||||||
gamma_2 = 0.005;
|
mu_1 = mu - V_S;
|
||||||
gamma = gamma_1 + gamma_2;
|
mu_2 = mu - V_D;
|
||||||
|
|
||||||
|
% Laplace potential, does not change as solution is found (eV)
|
||||||
|
% q is factored out here, we are working in eV
|
||||||
|
U_L = - (a_G*V_G) - (a_D*V_D) - (a_S*V_S);
|
||||||
|
|
||||||
|
% Poisson potential must change, assume 0 initially (eV)
|
||||||
|
U_P = 0;
|
||||||
|
|
||||||
|
% Assume large rate of change
|
||||||
|
dU_P = 1;
|
||||||
|
|
||||||
|
% Run until we get close enough to the answer
|
||||||
|
while dU_P > 1e-6
|
||||||
|
% source Fermi function
|
||||||
|
f_1 = 1 ./ (1 + exp((E + U_L + U_P - mu_1) ./ kBT));
|
||||||
|
% drain Fermi function
|
||||||
|
f_2 = 1 ./ (1 + exp((E + U_L + U_P - mu_2) ./ kBT));
|
||||||
|
|
||||||
|
% Update channel electrons against potential
|
||||||
|
N(n) = dE * sum( ((gamma_1/gamma_sum) .* f_1 + (gamma_2/gamma_sum) .* f_2) .* D);
|
||||||
|
|
||||||
|
% Re-update Poisson portion of potential
|
||||||
|
tmpU_P = U_0 * ( N(n) - N_0);
|
||||||
|
dU_P = abs(U_P - tmpU_P);
|
||||||
|
|
||||||
|
% Unsure why U_P is updated incrementally, perhaps to avoid oscillations?
|
||||||
|
%U_P = tmpU_P;
|
||||||
|
U_P = U_P + 0.1 * (tmpU_P - U_P)
|
||||||
|
end
|
||||||
|
|
||||||
|
% Calculate current based on solved potential.
|
||||||
|
% Note: f1 is dependent on changes in U but has been updated prior in the loop
|
||||||
|
I(n) = q * (q/hbar) * (gamma_1 * gamma_1 / gamma_sum) * dE * sum((f_1-f_2).*D);
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
%%Plotting commands
|
||||||
|
|
||||||
|
figure(1);
|
||||||
|
h = plot(voltages, N,'k');
|
||||||
|
grid on;
|
||||||
|
set(h,'linewidth',[2.0]);
|
||||||
|
set(gca,'Fontsize',[18]);
|
||||||
|
xlabel('Drain voltage [V]');
|
||||||
|
ylabel('Number of electrons');
|
||||||
|
|
||||||
|
figure(2);
|
||||||
|
h = plot(voltages, I,'k');
|
||||||
|
grid on;
|
||||||
|
set(h,'linewidth',[2.0]);
|
||||||
|
set(gca,'Fontsize',[18]);
|
||||||
|
xlabel('Drain voltage [V]');
|
||||||
|
ylabel('Current [A]');
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\newpage
|
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
@ -4,10 +4,6 @@ clear all;
|
|||||||
|
|
||||||
% Physical constants
|
% Physical constants
|
||||||
hbar = 1.052e-34;
|
hbar = 1.052e-34;
|
||||||
q = 1.602e-19;
|
|
||||||
%epsilon_0 = 8.854e-12;
|
|
||||||
%epsilon_r = 4;
|
|
||||||
%mstar = 0.25 * 9.11e-31;
|
|
||||||
|
|
||||||
% Single-charge coupling energy (eV)
|
% Single-charge coupling energy (eV)
|
||||||
U_0 = 0.25;
|
U_0 = 0.25;
|
||||||
|
109
PS1/q1c.m
Normal file
109
PS1/q1c.m
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
clear all;
|
||||||
|
|
||||||
|
%% Constants
|
||||||
|
|
||||||
|
% Physical constants
|
||||||
|
hbar = 1.052e-34;
|
||||||
|
q = 1.602e-19;
|
||||||
|
%epsilon_0 = 8.854e-12;
|
||||||
|
%epsilon_r = 4;
|
||||||
|
%mstar = 0.25 * 9.11e-31;
|
||||||
|
|
||||||
|
% Single-charge coupling energy (eV)
|
||||||
|
U_0 = 0.25;
|
||||||
|
% (eV)
|
||||||
|
kBT = 0.025;
|
||||||
|
% Contact coupling coefficients (eV)
|
||||||
|
gamma_1 = 0.005;
|
||||||
|
gamma_2 = gamma_1;
|
||||||
|
gamma_sum = gamma_1 + gamma_2;
|
||||||
|
% Capacitive gate coefficient
|
||||||
|
a_G = 0.5;
|
||||||
|
% Capacitive drain coefficient
|
||||||
|
a_D = 0.5;
|
||||||
|
a_S = 1 - a_G - a_D;
|
||||||
|
|
||||||
|
% Central energy level
|
||||||
|
mu = 0;
|
||||||
|
|
||||||
|
% Energy grid, from -1eV to 1eV
|
||||||
|
NE = 501;
|
||||||
|
E = linspace(-1, 1, NE);
|
||||||
|
dE = E(2) - E(1);
|
||||||
|
% TODO name this better
|
||||||
|
cal_E = 0.2;
|
||||||
|
|
||||||
|
% Lorentzian density of states, normalized so the integral is 1
|
||||||
|
D = (gamma_sum / (2*pi)) ./ ( (E-cal_E).^2 + (gamma_sum/2).^2 );
|
||||||
|
D = D ./ (dE*sum(D));
|
||||||
|
|
||||||
|
% Reference no. of electrons in channel
|
||||||
|
N_0 = 0;
|
||||||
|
|
||||||
|
voltages = linspace(0, 1, 101);
|
||||||
|
|
||||||
|
% Terminal Voltages
|
||||||
|
V_G = 0;
|
||||||
|
V_S = 0;
|
||||||
|
|
||||||
|
for n = 1:length(voltages)
|
||||||
|
% Set varying drain voltage
|
||||||
|
V_D = voltages(n);
|
||||||
|
|
||||||
|
% Shifted energy levels of the contacts
|
||||||
|
mu_1 = mu - V_S;
|
||||||
|
mu_2 = mu - V_D;
|
||||||
|
|
||||||
|
% Laplace potential, does not change as solution is found (eV)
|
||||||
|
% q is factored out here, we are working in eV
|
||||||
|
U_L = - (a_G*V_G) - (a_D*V_D) - (a_S*V_S);
|
||||||
|
|
||||||
|
% Poisson potential must change, assume 0 initially (eV)
|
||||||
|
U_P = 0;
|
||||||
|
|
||||||
|
% Assume large rate of change
|
||||||
|
dU_P = 1;
|
||||||
|
|
||||||
|
% Run until we get close enough to the answer
|
||||||
|
while dU_P > 1e-6
|
||||||
|
% source Fermi function
|
||||||
|
f_1 = 1 ./ (1 + exp((E + U_L + U_P - mu_1) ./ kBT));
|
||||||
|
% drain Fermi function
|
||||||
|
f_2 = 1 ./ (1 + exp((E + U_L + U_P - mu_2) ./ kBT));
|
||||||
|
|
||||||
|
% Update channel electrons against potential
|
||||||
|
N(n) = dE * sum( ((gamma_1/gamma_sum) .* f_1 + (gamma_2/gamma_sum) .* f_2) .* D);
|
||||||
|
|
||||||
|
% Re-update Poisson portion of potential
|
||||||
|
tmpU_P = U_0 * ( N(n) - N_0);
|
||||||
|
dU_P = abs(U_P - tmpU_P);
|
||||||
|
|
||||||
|
% Unsure why U_P is updated incrementally, perhaps to avoid oscillations?
|
||||||
|
%U_P = tmpU_P;
|
||||||
|
U_P = U_P + 0.1 * (tmpU_P - U_P)
|
||||||
|
end
|
||||||
|
|
||||||
|
% Calculate current based on solved potential.
|
||||||
|
% Note: f1 is dependent on changes in U but has been updated prior in the loop
|
||||||
|
I(n) = q * (q/hbar) * (gamma_1 * gamma_1 / gamma_sum) * dE * sum((f_1-f_2).*D);
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
%%Plotting commands
|
||||||
|
|
||||||
|
figure(1);
|
||||||
|
h = plot(voltages, N,'k');
|
||||||
|
grid on;
|
||||||
|
set(h,'linewidth',[2.0]);
|
||||||
|
set(gca,'Fontsize',[18]);
|
||||||
|
xlabel('Drain voltage [V]');
|
||||||
|
ylabel('Number of electrons');
|
||||||
|
|
||||||
|
figure(2);
|
||||||
|
h = plot(voltages, I,'k');
|
||||||
|
grid on;
|
||||||
|
set(h,'linewidth',[2.0]);
|
||||||
|
set(gca,'Fontsize',[18]);
|
||||||
|
xlabel('Drain voltage [V]');
|
||||||
|
ylabel('Current [A]');
|
Loading…
Reference in New Issue
Block a user