找不到关于我想用 circuitTikZ 包做什么的示例。我想在这个电路的左侧放置一个字母和一个黑色端口,并且我希望 nand4 充当逆变器。
\begin{circuitikz} \draw
(0,2) node[nand port] (nand4) {}
(2,3) node[nand port] (nand3) {}
(4,2) node[nand port] (nand2) {}
(0,0) node[nand port] (nand1) {}
(nand1.out) |- (nand2.in 2)
(nand4.out) |- (nand3.in 2)
(nand3.out) |- (nand2.in 1)
;\end{circuitikz}
答案1
一种可能性是:
\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw
(0,2) node[nand port] (nand4) {}
(2,3) node[nand port] (nand3) {}
(4,2) node[nand port] (nand2) {}
(0,0) node[nand port] (nand1) {}
(nand1.out) |- (nand2.in 2)
(nand4.out) |- (nand3.in 2)
(nand3.out) |- (nand2.in 1)
;
\draw
([xshift=-1cm]nand1.in 1)
coordinate (aux) node[left] {$c$} to[short,*-]
(nand1.in 1);
\draw
([xshift=-1cm]nand1.in 2)
node[left] {$d$} to[short,*-]
(nand1.in 2);
\draw
(aux|-nand3.in 1)
node[left] {$a$} to[short,*-]
(nand3.in 1);
\draw
(nand4.in 1) -- coordinate (middle) (nand4.in 2);
\draw
(aux|-middle)
node[left] {$b$} to[short,*-]
(middle);
\end{circuitikz}
\end{document}