5

I'm working in this circuit:

enter image description here

Here what I have done:

\documentclass[11pt]{article}

\usepackage[english]{babel}
\usepackage{circuitikz}
\usepackage{tikz}
\begin{document}

\begin{center}
\begin{circuitikz}[american voltages, european resistors]
\ctikzset { label/align = straight }
\draw (0,0) 
node[nmos](nmosA){}node[left=10mm] {$\overline{A}$} (2,0)
node[nmos](nmosB){}node[left=10mm] {B}
(nmosA.D) to (nmosB.D)
to [short,*-o] ++(1,0) {} node[right=2mm] {Y}
(1,-1.54) node[nmos](nmosC){}node[left=10mm] {C}
(nmosA.S) to (nmosC.D) to (nmosB.S);
%(nmosC.S) to node[ground]{};
\end{circuitikz}
\end{center}
\end{document}

enter image description here

I'd like to know how to connect the ground (the way I tried is wrong), how to put circles in the opened terminals of the transistors and maybe how to improve the draw since I put some weird coordinates (1,-1.54) node[nmos](nmosC){}node[left=10mm]. If someone has a similar example would be of great value. Regards.

1 Answer 1

7

Here's how I would do it. Instead of manually adjusting the position of the labels, use the anchors of the transistors and position the label nodes left or right of these. to paths leading nowhere (++(0,0)) can be used to add filled or open marks at the transistor anchors.

I also avoided manually positioning the transistor "C" by using the calc library to compute the midpoint and anchoring the final transistor by its drain.

\documentclass[tikz]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{calc}
\ctikzset { label/align = straight }

\begin{document}
\begin{circuitikz}[american voltages, european resistors]
\draw (0,0) 
  node[nmos] (nmosA) {}
  (nmosA.G) to[short,-o] ++(0,0) node[left] {$\overline{A}$} (2,0)
  node[nmos] (nmosB) {}
  (nmosB.G) to[short,-o] ++(0,0) node[left] {B}
  (nmosA.D) to (nmosB.D)
  to [short,*-o] ++(1,0) {} node[right] {Y}
  (nmosA.S) to[short] (nmosB.S)
  ($(nmosA.S)!0.5!(nmosB.S)$) to[short,-*] ++(0,0) node[nmos,anchor=D] (nmosC) {}
  (nmosC.G) to[short,-o] ++(0,0) node[left] {C}
  (nmosC.S) node[ground] {};
\end{circuitikz}
\end{document}

enter image description here

1
  • 1
    Instead of using the calc library, it should be possible to do (nmosA.S) to[short] coordinate[midway] (tmp) (nmosB.S) and use the coordinate tmp as the anchor for transistor "C", but for some reason this did not place the tmp coordinate at the spot I expected it to. I'll look into it more when I have some moments. Apr 17, 2015 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.