diff --git a/PS1/doc.tex b/PS1/doc.tex index c1587f9..2552432 100644 --- a/PS1/doc.tex +++ b/PS1/doc.tex @@ -4,29 +4,41 @@ \usepackage{setspace} \usepackage{listings} \usepackage{color} -\usepackage{circuitikz} +\usepackage{amsmath} \usepackage{float} +\usepackage{caption} +\usepackage{subcaption} +\usepackage[margin=0.75in]{geometry} + +\renewcommand{\thesubsection}{\indent(\alph{subsection})} \definecolor{dkgreen}{rgb}{0,0.6,0} \definecolor{gray}{rgb}{0.5,0.5,0.5} \definecolor{mauve}{rgb}{0.58,0,0.82} -\lstset{language=Matlab,% - %basicstyle=\color{red}, - breaklines=true,% - morekeywords={matlab2tikz}, - 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}, -} +%\lstset{language=Matlab,% +% %basicstyle=\color{red}, +% breaklines=true,% +% morekeywords={matlab2tikz}, +% 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}, +%} +\lstset{basicstyle=\small, + keywordstyle=\color{mauve}, + identifierstyle=\color{dkgreen}, + stringstyle=\color{gray}, + numbers=left, + xleftmargin=5em + } \title{ECE 456 - Problem Set 1} \date{2021-02-06} @@ -45,27 +57,70 @@ \singlespacing \pagenumbering{arabic} - \section{Question 1} - \subsection{(a)} - + \section*{Question 1} + \subsection*{(a)} + Beginning with the following two equations: \begin{equation} - N = $\int_{-\infty}^{\infty}$ + \label{eq:N_old} + N = \int_{-\infty}^{\infty}\frac{\gamma_1 f_1(E) + \gamma_2 f_2(E)}{\gamma_1 + \gamma_2} D(E-U) dE, \end{equation} - + \begin{equation} + \label{eq:I_old} + I = \frac{q}{\hbar}\frac{\gamma_1 \gamma_2}{\gamma_1 + \gamma_2} \int_{-\infty}^{\infty}[f_1(E) - f_2(E)] D(E-U) dE, + \end{equation} + + and changing the variable of integration to $E' = E - U$: + + \begin{equation*} + N = \int_{-\infty}^{\infty}\frac{\gamma_1 f_1(E' + U) + \gamma_2 f_2(E' + U)}{\gamma_1 + \gamma_2} D(E') dE', + \end{equation*} - \section{Design Section} + \begin{equation*} + I = \frac{q}{\hbar}\frac{\gamma_1 \gamma_2}{\gamma_1 + \gamma_2} \int_{-\infty}^{\infty}[f_1(E' + U) - f_2(E' + U)] D(E') dE'. + \end{equation*} + + Replacing $E' \rightarrow E$, we obtain equations \ref{eq:N_new} and \ref{eq:I_new}. - In order to design the desired systems, the Xilinx Vivado software was - used to write VHDL code that described the operation of each circuit. + \begin{equation} + \label{eq:N_new} + N = \int_{-\infty}^{\infty}\frac{\gamma_1 f_1(E + U) + \gamma_2 f_2(E + U)}{\gamma_1 + \gamma_2} DE dE, + \end{equation} - \newpage - \paragraph{MUX / DEMUX Circuit} - To implement the multiplexing/demultiplexing system, the following circuit had to be written in VHDL. + \begin{equation} + \label{eq:I_new} + I = \frac{q}{\hbar}\frac{\gamma_1 \gamma_2}{\gamma_1 + \gamma_2} \int_{-\infty}^{\infty}[f_1(E + U) - f_2(E + U)] DE dE, + \end{equation} - The VHDL architecture below was written to implement this circuit in hardware. + \subsection*{(b)} - \begin{lstlisting}[language=Matlab] + For the provided constants, the plots of the number of channel electrons and the channel current follow: + + + \begin{figure}[H] + \centering + \begin{subfigure}{0.5\textwidth} + % Mess around with widths later + \centering + \includegraphics[width=\textwidth]{q1b_electrons.png} + \caption{Plot of channel electrons vs. drain voltage.} + \label{fig:q1b_electrons} + % Note that the comment after \end{subfigure} is required for side by side figures + \end{subfigure}% + \begin{subfigure}{0.5\textwidth} + % Mess around with widths later + \centering + \includegraphics[width=\textwidth]{q1b_current.png} + \caption{Plot of channel current vs. drain voltage.} + \label{fig:q1b_current} + \end{subfigure} + + \caption{Number of electrons and current versus drain voltage.} + \end{figure} + + Below is our code. Note that some variable names are different from those in the example code. + \begin{lstlisting}[language=Matlab] + clear all; %% Constants @@ -144,7 +199,7 @@ for n = 1:length(voltages) % 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) + %U_P = U_P + 0.1 * (tmpU_P - U_P); end % Calculate current based on solved potential. @@ -171,6 +226,58 @@ set(h,'linewidth',[2.0]); set(gca,'Fontsize',[18]); xlabel('Drain voltage [V]'); ylabel('Current [A]'); - \end{lstlisting} + \end{lstlisting} + + \subsection*{(c)} + + \begin{figure}[H] + \centering + \begin{subfigure}{0.5\textwidth} + % Mess around with widths later + \centering + \includegraphics[width=\textwidth]{q1c_1.png} + \caption{Plot of channel electrons vs. drain voltage.} + \label{fig:q1c_1} + % Note that the comment after \end{subfigure} is required for side by side figures + \end{subfigure}% + \begin{subfigure}{0.5\textwidth} + % Mess around with widths later + \centering + \includegraphics[width=\textwidth]{q1c_2.png} + \caption{Plot of channel electrons vs. drain voltage.} + \label{fig:q1c_1} + % Note that the comment after \end{subfigure} is required for side by side figures + \end{subfigure} + \begin{subfigure}{0.5\textwidth} + % Mess around with widths later + \centering + \includegraphics[width=\textwidth]{q1c_3.png} + \caption{Plot of channel electrons vs. drain voltage.} + \label{fig:q1c_1} + % Note that the comment after \end{subfigure} is required for side by side figures + \end{subfigure}% + \begin{subfigure}{0.5\textwidth} + % Mess around with widths later + \centering + \includegraphics[width=\textwidth]{q1c_4.png} + \caption{Plot of channel electrons vs. drain voltage.} + \label{fig:q1c_1} + % Note that the comment after \end{subfigure} is required for side by side figures + \end{subfigure} + \begin{subfigure}{0.5\textwidth} + % Mess around with widths later + \centering + \includegraphics[width=\textwidth]{q1c_5.png} + \caption{Plot of channel electrons vs. drain voltage.} + \label{fig:q1c_1} + % Note that the comment after \end{subfigure} is required for side by side figures + \end{subfigure}% + + \caption{Visual representation of the fermi functions of the contacts and channel.} + \end{figure} + + + +% TODO appendix for Part C code \end{document} \ No newline at end of file diff --git a/PS1/q1b_current.png b/PS1/q1b_current.png new file mode 100644 index 0000000..447d4c3 Binary files /dev/null and b/PS1/q1b_current.png differ diff --git a/PS1/q1b_electrons.png b/PS1/q1b_electrons.png new file mode 100644 index 0000000..f3e1477 Binary files /dev/null and b/PS1/q1b_electrons.png differ diff --git a/PS1/q1c.m b/PS1/q1c.m index 73fa455..ef04c2c 100644 --- a/PS1/q1c.m +++ b/PS1/q1c.m @@ -41,6 +41,7 @@ D = D ./ (dE*sum(D)); N_0 = 0; voltages = linspace(0, 1, 101); +dV = voltages(2) - voltages(1); % Terminal Voltages V_G = 0; @@ -80,13 +81,65 @@ for n = 1:length(voltages) % 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) + 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); + if (abs(V_D-0.0) <= dV/2) + figure(3); title('VD = 0.0 V'); + subplot(2,3,1); plot(f_1,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)'); ylabel('ENERGY [eV]'); title('VD = 0.0 V'); + subplot(2,3,2); plot(D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 0.0 V'); + subplot(2,3,3); plot(f_2,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f2(E+U)'); ylabel('ENERGY [eV]'); title('VD = 0.0 V'); + subplot(2,3,5); plot(f_1-f_2,E,'--',D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)-f2(E+U), D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 0.0 V'); + elseif (abs(V_D-0.2) <= dV/2) + figure(4); title('VD = 0.2 V'); + subplot(2,3,1); plot(f_1,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)'); ylabel('ENERGY [eV]'); title('VD = 0.2 V'); + subplot(2,3,2); plot(D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 0.2 V'); + subplot(2,3,3); plot(f_2,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f2(E+U)'); ylabel('ENERGY [eV]'); title('VD = 0.2 V'); + subplot(2,3,5); plot(f_1-f_2,E,'--',D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)-f2(E+U), D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 0.2 V'); + elseif (abs(V_D-0.5) <= dV/2) + figure(5); title('VD = 0.5 V'); + subplot(2,3,1); plot(f_1,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)'); ylabel('ENERGY [eV]'); title('VD = 0.5 V'); + subplot(2,3,2); plot(D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 0.5 V'); + subplot(2,3,3); plot(f_2,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f2(E+U)'); ylabel('ENERGY [eV]'); title('VD = 0.5 V'); + subplot(2,3,5); plot(f_1-f_2,E,'--',D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)-f2(E+U), D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 0.5 V'); + elseif (abs(V_D-0.8) <= dV/2) + figure(6); title('VD = 0.8 V'); + subplot(2,3,1); plot(f_1,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)'); ylabel('ENERGY [eV]'); title('VD = 0.8 V'); + subplot(2,3,2); plot(D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 0.8 V'); + subplot(2,3,3); plot(f_2,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f2(E+U)'); ylabel('ENERGY [eV]'); title('VD = 0.8 V'); + subplot(2,3,5); plot(f_1-f_2,E,'--',D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)-f2(E+U), D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 0.8 V'); + elseif (abs(V_D-1.0) <= dV/2) + figure(7); title('VD = 1.0 V'); + subplot(2,3,1); plot(f_1,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)'); ylabel('ENERGY [eV]'); title('VD = 1.0 V'); + subplot(2,3,2); plot(D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 1.0 V'); + subplot(2,3,3); plot(f_2,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f2(E+U)'); ylabel('ENERGY [eV]'); title('VD = 1.0 V'); + subplot(2,3,5); plot(f_1-f_2,E,'--',D/100,E,'k-'); axis([-0.1 1.1 -1 1]); + xlabel('f1(E+U)-f2(E+U), D(E)/100'); ylabel('ENERGY [eV]'); title('VD = 1.0 V'); + end + end diff --git a/PS1/q1c_1.png b/PS1/q1c_1.png new file mode 100644 index 0000000..bdc05d4 Binary files /dev/null and b/PS1/q1c_1.png differ diff --git a/PS1/q1c_2.png b/PS1/q1c_2.png new file mode 100644 index 0000000..a6b299b Binary files /dev/null and b/PS1/q1c_2.png differ diff --git a/PS1/q1c_3.png b/PS1/q1c_3.png new file mode 100644 index 0000000..fff3ae8 Binary files /dev/null and b/PS1/q1c_3.png differ diff --git a/PS1/q1c_4.png b/PS1/q1c_4.png new file mode 100644 index 0000000..47ddebe Binary files /dev/null and b/PS1/q1c_4.png differ diff --git a/PS1/q1c_5.png b/PS1/q1c_5.png new file mode 100644 index 0000000..d988f08 Binary files /dev/null and b/PS1/q1c_5.png differ