Transistor

A MOS transistor is a circuit element that automatically controls the flow of current by comparing the difference of the gate voltage (G) and the supply voltage (S) to a reference voltage in order to conduct it through the drain (D).
The following are two Metal-Oxide-Semiconductor Field-Effect Transistors (MOSFETs):

NMOS Transistor

The NMOS (N-Channel MOS) works by utilizing an n-channel semiconductor so that electrons directly conduct electricity through the supply-drain channel.

\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) node[nmos] (nmos) {}; 
\draw (nmos.gate) node[anchor=east] {G}; 
\draw (nmos.drain) node[anchor=south] {D}; 
\draw (nmos.source) node[anchor=north] {S};
 
\draw [->] (1, 0)--(2, 0);
\draw (3.5, 1) [C, l_=$C$] to (3.5, -1.5) |- (4.5, -1.5) |- (4.5, -1.75)
to [R, l_=$R_n$] (4.5, 0.15)
(4.5, 1) |- (4.5,0.75) [closing switch, l^=$V_{GS} \geq V_{tn}$] to (4.5, 0.15)
(4.5, 0) |- (4.5, -0.1);
\node at (4.5, -2) {S};
\node at (4.5, 1.25) {D};
\node at (3.5, 1.25) {G};
\end{circuitikz}
\end{document}

PMOS Transistor

The PMOS (P-Channel MOS) works by utilizing a p-channel semiconductor so that electrons leave positive “holes” that could be considered positive charge carriers.

\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) node[pmos] (pmos) {}; 
\draw (pmos.gate) node[anchor=east] {G}; 
\draw (pmos.drain) node[anchor=north] {D}; 
\draw (pmos.source) node[anchor=south] {S};
 
\draw [->] (1, 0)--(2, 0);
 
\draw (3.5, -1.5) [C, C=$C$] to (3.5, 1) |- (4.5, 1) |- (4.5, 1.25)
to [R, R=$R_p$] (4.5, -0.75)
(4.5,-1.5) |- (4.5, -1.25) to [closing switch, l_=$V_{GS} \leq -|V_{tp}|$] (4.5, -0.75);
\node at (4.5, -1.75) {D};
\node at (4.5, 1.5) {S};
\node at (3.5, -1.75) {G};
\end{circuitikz}
\end{document}

CMOS Inverter & Ring Oscillator Paradox

Using an NMOS and PMOS transistors we can make what is called a CMOS inverter. Essentially, the CMOS inverter outputs a logical ‘high’ (1) when the input is low, and a logical ‘low’ (0) when the input is high. We can see a circuit diagram of the CMOS inverter below:

\usepackage{circuitikz}[american]
\begin{document}
  \begin{circuitikz}
  	\draw (0,1) node[pmos] (pmos) {}; 
  	\draw (0, -1) node[nmos] (nmos) {};
  	\draw (pmos.source) node[anchor=south] {$V_{DD}$}; 
  	\draw (nmos.drain) to (0, -1.5) node[ground]{}; 
  	\draw (-2, 0) node[anchor=east]{$V_{in}$} |- (-1.5, 0) |- (-1.5, 1) to (pmos.gate);
  	\draw (-1.5, 0) |- (-1.5, -1) to (nmos.gate);
  	\draw (pmos.drain) to (0, 0) |- (0.5, 0) node[anchor=west]{$V_{out}$};
  	\draw (nmos.drain) to (0 ,0);
  \end{circuitikz}
\end{document}

Using an odd number of CMOS inverters connected in a feedback loop, we can make a circuit known as a ring oscillator. A ring oscillator of 3 inverters is shown below:

\usepackage{circuitikz}[american]
\begin{document}
  \begin{circuitikz}
  	\draw (0,1) node[pmos] (pmos1) {}; 
  	\draw (0, -1) node[nmos] (nmos1) {};
  	\draw (2,1) node[pmos] (pmos2) {}; 
  	\draw (2, -1) node[nmos] (nmos2) {};
  	\draw (4,1) node[pmos] (pmos3) {}; 
  	\draw (4, -1) node[nmos] (nmos3) {};
  	
  	\draw (pmos1.source) node[anchor=south] {$V_{DD}$}; 
  	\draw (nmos1.drain) to (0, -1.5) node[ground]{}; 
  	\draw (pmos2.source) node[anchor=south] {$V_{DD}$}; 
  	\draw (nmos2.drain) to (2, -1.5) node[ground]{}; 
  	\draw (pmos3.source) node[anchor=south] {$V_{DD}$}; 
  	\draw (nmos3.drain) to (4, -1.5) node[ground]{}; 
  	
  	\draw (-2, 0) node[anchor=east]{$V_{in}$} |- (-1.5, 0) |- (-1.5, 1) to (pmos1.gate);
  	\draw (-1.5, 0) |- (-1.5, -1) to (nmos1.gate);
  	
  	\draw (pmos1.drain) to (0, 0);
  	\draw (nmos1.drain) to (0 ,0);
  	\draw (0, 0) node[anchor=east]{} |- (0.5, 0) |- (0.5, 1) to (pmos2.gate);
  	\draw (0.5, 0) |- (0.5, -1) to (nmos2.gate);
  
  	\draw (pmos2.drain) to (2, 0);
  	\draw (nmos2.drain) to (2, 0);
  	\draw (2, 0) node[anchor=east]{} |- (2.5, 0) |- (2.5, 1) to (pmos3.gate);
  	\draw (2.5, 0) |- (2.5, -1) to (nmos3.gate);
  	
  	\draw (pmos3.drain) to (4, 0);
  	\draw (nmos3.drain) to (4, 0);
  	\draw (4, 0) |- (4.5, 0) node[anchor=west]{$V_{out}$} |- (4.5, -3) |- (-2, -3) |- (-2, 0);
  \end{circuitikz}
\end{document}

Let’s plot time against current and see