我是新手,刚开始用 Latex 画电路。有一个电路我画不出来,如果有人能帮我就太好了。电路如下图所示:
上半部分对我来说比较难。
到目前为止我所做工作的代码:
\documentclass{article}
\usepackage{tikz}
\usepackage{rotating}
\usepackage{circuitikz}
\ctikzset{tripoles/mos style/arrows}
\ctikzset{bipoles/length=0.8cm}
\begin{document}
\begin{figure}[h!]
\begin{circuitikz}
\draw (0,0)
node[nmos, xscale=-1, anchor = D](nmos4){}
(nmos4.G) node[nmos, anchor = G](nmos5){}
(nmos4.S) node[nmos, anchor = D](nmos1){}
(nmos5.S) node[nmos, xscale=-1,anchor = D](nmos2){}
(nmos4.D) -- (nmos5.D)
(nmos1.S) -- (nmos2.S)
(nmos1.S) node[nmos, xshift = 1cm, anchor = D](nmos3){}
(nmos3.S) node[ground]{V\textsc{ss}}
(nmos3.G) node[anchor=east]{Vb}
(nmos2.G) node[anchor=west]{Vin2}
(nmos1.G) node[anchor=east]{Vin1}
(nmos4.D) node[anchor=south,xshift=1cm]{V\textsc{dd}};
\end{circuitikz}
\end{figure}
\end{document}
答案1
这是你想要的吗?
\documentclass{article}
\usepackage{tikz}
\usepackage{circuitikz}
\ctikzset{tripoles/mos style/arrows}
\ctikzset{bipoles/length=0.8cm}
\begin{document}
\begin{figure}[h!]
\begin{circuitikz}
\draw (0,0)
node[pmos, xscale=-1, anchor = S](pmos4){}
(pmos4.G) node[pmos, anchor = G, xshift=1.2cm](pmos5){}
(pmos4.D) to[short] ++(0,-1) node[nmos, anchor = D](nmos1){}
(pmos5.D) to[short] ++(0,-1) node[nmos, xscale=-1,anchor = D](nmos2){}
(pmos4.S) to[short] (pmos5.S)
(nmos1.S) to[short] (nmos2.S)
(pmos4.D) to[short,*-] ++(1,0) to[short] (pmos5.G)
(pmos5.D) to[short,*-] ++(-1,0) to[short] (pmos4.G)
(nmos1.D) to[short,*-o] ++(1,0)
(nmos2.D) to[short,*-o] ++(-1,0)
($(nmos1.D)!0.5!(nmos2.D)$) node {$V_{\mathrm{out}}$}
($(nmos1.S)!0.5!(nmos2.S)$) to[short,*-] ++(0,0) node[nmos, anchor = D](nmos3){}
(nmos3.S) node[ground] {}
(nmos3.G) to[short,-*] ++(0,0) node[anchor=east]{$V_{\mathrm{b}}$}
(nmos2.G) to[short,*-o] ++(0,0) node[anchor=west]{$V_{\mathrm{in2}}$}
(nmos1.G) to[short,*-o] ++(0,0) node[anchor=east]{$V_{\mathrm{in1}}$}
($(pmos4.S)!0.5!(pmos5.S)$) node[anchor=south]{$V_{\mathrm{DD}}$}
(pmos4) node[left] {$M_3$}
(pmos5) node[right] {$M_4$}
(nmos1) node[right] {$M_1$}
(nmos2) node[left] {$M_2$}
(nmos3) node[right] {$M_5$};
\end{circuitikz}
\end{figure}
\end{document}
一些评论:
- 我在 M3 和 M4 之间添加了水平移位,以避免门重叠
- 我采用了
short
circuitikz 的风格来添加连接(使用*
或o
,分别是闭合或断开符号) - 该符号
($ coordinate !0.5! other coordinate$)
可用于计算中点 - 我使用数学模式来作为节点中的下标。
然后从电路的角度来说,原图中M3,M4是p型MOS,所以我改变了节点类型。