\documentclass[border=4pt]{standalone}
\usepackage{ga}
\input{../fm.tikz}
\begin{document}
\begin{circuitikz}[font=\small]
\draw (0,0) to[american voltage source, l=$V_\mathrm{in}$, invert] (0,2.6) to[battery1, l=$V_\mathrm{B}$] (2.0,2.6) node[circ]{} to[short, -o] (3.2,2.6);
\draw (2.0,2.6) to[R, l_=$R_1$] (2.0,1.3); \draw (2.0,0) to[empty diode, l_=$D_1$] (2.0,1.3);
\node[font=\footnotesize, right] at (2.05,1.3) {$-0.7$ V}; \node[font=\footnotesize, right] at (2.05,0.2) {0};
\draw (0,0) -- (2.0,0) to[short, -o] (3.2,0); \draw (1.0,0) node[ground]{};
\node at (3.2,2.15) {$+$}; \node at (3.5,1.0) {$V_\mathrm{out}$}; \node at (3.2,0.45) {$-$};
\begin{scope}[xshift=6.6cm, yshift=1.4cm]
\axes{-1.4}{3.0}{-1.6}{1.8}{$V_\mathrm{in}$}{$V_\mathrm{out}$}
\draw[cv] (-0.7,-1.8) -- (2.5,1.4); \xt{1.1}{} \node[below right, font=\footnotesize] at (1.0,0) {2 V};
\fill (0,-1.1) circle (1.2pt); \node[right, font=\footnotesize] at (0,-1.15) {$-2$};
\draw (1.9,0.8) -- (2.2,0.8) -- (2.2,1.1); \node[right, font=\footnotesize] at (2.2,0.9) {1};
\end{scope}
\begin{scope}[yshift=-3.6cm]
\node[right, align=left] at (-1.6,2.0) {$V_\mathrm{in}>2$ V:\\ Diode off\\[2pt] $V_\mathrm{in}<2$ V};
\draw (0.8,0) to[american voltage source, l=$V_\mathrm{in}$, invert] (0.8,2.4) to[battery1] (2.6,2.4) node[circ]{} to[short, -o] (3.6,2.4);
\draw (2.6,2.4) to[R] (2.6,0);
\draw (0.8,0) -- (2.6,0) to[short, -o] (3.6,0);
\node at (3.6,2.0) {$+$}; \node at (3.8,1.2) {$V_\mathrm{out}$}; \node at (3.6,0.4) {$-$};
\end{scope}
\end{circuitikz}
\end{document}
