我想使用 circuit-tikz 包来绘制这个宏。
答案1
您可以使用TikZ 库and gate
中的circuits.logic.IEC
:
\documentclass{article}
\usepackage{circuitikz,siunitx}
\usetikzlibrary{circuits.logic.IEC}
\begin{document}
\begin{circuitikz}[circuit logic IEC]
\draw (4,0) node[european and port] (euand) {};
\node[
and gate,
inputs={nnnnnnnn},
and gate IEC symbol={},
text height=3cm,
text width=2cm,
] (A) {};
\foreach \Valor in {1,...,8}
{
\draw ([xshift=-20pt]A.input \Valor) -- (A.input \Valor) node[right] {$I_{\number\numexpr\Valor-1\relax}$};
}
\foreach \Valor [count=\xi] in {12,0,-12}
{
\draw ([xshift=\Valor]A.south) node[above] {$S_{\number\numexpr\xi-1\relax}$} -- ++(0,-10pt);
}
\node[left] at (A.output) {$Z$};
\draw (A.output) -| (euand.in 1);
\draw (A.output) -| (euand.in 2);
\end{circuitikz}
\end{document}