9

I'm using circuitikz to create some logic gate diagrams. In my course we use "inversion bubbles" as a convenient shortcut instead of drawing inverters everywhere. As in inputs A and B in this image:

enter image description here

Is it possible to create these bubbles using circuitikz? It's not in the documentation.

2 Answers 2

8

The logic gates that ship with plain TikZ (not circuitikz) have that feature. You set the state of the inputs using inputs=<string of n and i>, where n stands for normal input and i stands for inverted. Here's an example using inputs=ni:

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{circuits.logic.US} 

\begin{document}
\begin{tikzpicture}[circuit logic US]
\node (a) [and gate, inputs=ni] {};
\draw (a.input 1) -- (a.input 1 -| -1,0)
 (a.input 2) -- (a.input 2 -| -1,0)
 (a.output) -- ++(0.5,0);
\end{tikzpicture}%
\end{document}

0

For people, who really need a circuittikz solution, here's a hacky one that just draws the circle in the right place:

\draw (cfdandTMoB.in 2) [xshift=0.12cm,thick,fill=white]circle (0.1cm);

Full example:

Example circuit

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows.meta}

\makeatletter%
%
%

\begin{document}

\ctikzset{/tikz/circuitikz/bipoles/buffer/width = 0.75}
\ctikzset{/tikz/circuitikz/bipoles/buffer/height = 0.75}
\begin{circuitikz}

\draw
(0,-1) node[buffer] (cfdT) {}
(0,-2) node[buffer] (cfdM) {}
(0,-3) node[buffer] (cfdB) {}
(2.5,-1) node[and port] (cfdandTM) {}
(2.5,-3) node[and port] (cfdandMB) {}
(4.5,-1.5) node[and port] (cfdandTMoB) {}
(4.5,-2.5) node[and port] (cfdandMBoT) {}
(cfdT.out) |- (cfdandTM.in 1)
(cfdM.out) -- (cfdandTM.in 2)
(cfdM.out) -- (cfdandMB.in 1)
(cfdB.out) |- (cfdandMB.in 2)
(cfdandTM.out) -- (cfdandTMoB.in 1)
(cfdB.out) -- (1.5,-1.8) -- (cfdandTMoB.in 2)  {}
(cfdT.out) -- (1.5,-2.2) -- (cfdandMBoT.in 1)
(cfdandMB.out) -- (cfdandMBoT.in 2)
;

\newcommand{\inlabel}[1]{node[label={[label distance=0.0cm]90:#1}] {}}
\draw (cfdT.in) to [short,-o](-1.5,-1) \inlabel{T}
(cfdM.in) to [short,-o](-1.5,-2) \inlabel{M}
(cfdB.in) to [short,-o](-1.5,-3) \inlabel{B};

\draw (cfdandTMoB.in 2) [xshift=0.12cm,thick,fill=white]circle (0.1cm);
\draw (cfdandMBoT.in 1) [xshift=0.12cm,thick,fill=white]circle (0.1cm);

\end{circuitikz}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .