我想用circuitikz
包重现这些基本图表。
但是,我仍然在努力解决组件的路径样式、锚点等问题...下一个 MME 将提供更多详细信息。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{pgf,tikz}
\usetikzlibrary{babel}
\usepackage{circuitikz}
%node[european and port]{}
%node[european or port]{}
%node[european nand port]{}
%node[european nor port]{}
%node[european xor port]{}
%node[european xnor port]{}
%node[european buffer port]{}
%node[european not port]{}
\begin{document}
\begin{circuitikz}[]
\draw (0,0) node[above]{$v_i$} to[short, o-] ++(1,0) node[european and port](AND1){};
\end{circuitikz}
\end{document}
非常感谢任何建议。另外,我在哪里可以找到这些信息(坐标、路径、参考资料等),帮助我轻松绘制任何电路图?
答案1
\documentclass[border=10]{standalone}
\usepackage{circuitikz}
\ctikzset{
logic ports=ieee,
logic ports/scale=0.9,
logic ports/thickness=3,
}
\begin{document}
\begin{circuitikz}
\draw (0,1) node[ieeestd nand port](AND1){$G_1$}
(0,-1) node[ieeestd nand port](AND2){$G_2$}
(2.5,0) node[ieeestd nand port](AND3){$G_3$}
(AND1.out) node[above]{$\bar{A}$} -- ++(0.5,0) |- (AND3.in 1)
(AND2.out) node[below]{$\bar{B}$} -- ++(0.5,0) |- (AND3.in 2)
(AND3.out) node[right]{$\overline{\bar{A}\bar{B}} = A + B$}
(AND1.in 1) -- (AND1.in 2) coordinate[pos=0.5] (a)
(a) to[short, *-] ++(-0.5,0) node[left]{$A$}
(AND2.in 1) -- (AND2.in 2) coordinate[pos=0.5] (b)
(b) to[short, *-] ++(-0.5,0) node[left]{$B$};
\draw (0,-3) node[ieeestd nand port](AND4){}
(AND4.in 2) to[short, -*] (AND4.in 1) -- ++(-0.5,0) node[above]{$a$}
(AND4.out) node[above]{$S_0$};
\end{circuitikz}
\end{document}