我目前知道的是:
\begin{circuitikz}
\node[flipflop D] (D) at (2,0) {};
\node[flipflop T] (T) at (6,0) {};
\node[flipflop JK] (JK) at (10,0) {};
\draw[SkyBlue] (D.pin 4) -| (3.8,0) |- (T.pin 1);
\draw[SkyBlue] (T.pin 6) -- (JK.pin 1);
\draw[OliveGreen] (D.pin 6) -| (3.5,-1.5) -| (JK.pin 3);
\draw (JK.pin 6) -- ++(1, 0)node[right] {$Q_4$};
\draw (D.pin 1) -- ++(-1, 0)node[left] {D};
\draw (0,-2) node[left] {$clock$} -- (0.5,-2) node[circ] (clk1) {};
\draw (clk1) -- (4,-2) node[circ] (clk2) {};
\draw (clk2) -- (8,-2) |- (JK.pin 2);
\draw (clk1) |- (D.pin 3);
\draw (clk2) |- (T.pin 3);
\end{circuitikz}
如何添加预设并清除?
预计到达时间:已经弄清楚了:
\draw (0,-3) node[left] {$clear$} -| (D.bdown)node[ocirc,below]{};
\draw (0,2) node[left] {$preset$} -| (D.bup)node[ocirc,above]{};
答案1
您可以定义具有预设和清除功能的自定义触发器。
\documentclass{article}
\usepackage{circuitikz}
%---------------------------------------------------
\tikzset{flipflop DMod/.style={flipflop,
flipflop def={t1=D, t6=Q, t4={\ctikztextnot{Q}},
tu=pre, nu=1, td=clr, nd=1, c3=1},
}}
%---------------------------------------------------
\begin{document}
\begin{circuitikz}
\node[flipflop DMod] (D) at (2,0) {};
\node[flipflop T] (T) at (6,0) {};
\node[flipflop JK] (JK) at (10,0) {};
\draw (D.pin 4) -| (3.8,0) |- (T.pin 1);
\draw (T.pin 6) -- (JK.pin 1);
\draw (D.pin 6) -| (3.5,-1.5) -| (JK.pin 3);
\draw (JK.pin 6) -- ++(1, 0)node[right] {$Q_4$};
\draw (D.pin 1) -- ++(-1, 0)node[left] {D};
\draw (0,-2) node[left] {$clock$} -- (0.5,-2) node[circ] (clk1) {};
\draw (clk1) -- (4,-2) node[circ] (clk2) {};
\draw (clk2) -- (8,-2) |- (JK.pin 2);
\draw (clk1) |- (D.pin 3);
\draw (clk2) |- (T.pin 3);
\draw (D.up) |- ++(-2, 0)node[left] {preset}; %--> added
\draw (D.down) |- ++(-2, 0)node[left] {clear}; %--> added
\end{circuitikz}
\end{document}