I would like to draw the logic circuit but I have some problems. This is my sample code.
\begin{figure}[!htb]
\centering
\begin{circuitikz}[/tikz/circuitikz/bipoles/length=1cm]
\draw
(0,2) node (myand1) [and port]{}
(myand1.out) node (Y1)[anchor=south west] {$A \cdot B$}
(myand1.in 1) node (A1) [anchor=east,xshift=-1cm]{A}
(myand1.in 2) node (B1) [anchor=east,xshift=-1cm]{B}
(0,1) node (mynot1) [not port] {}
(mynot1.out) node (Ybar) [anchor=south west] {}
(2,0) node (myand2) [and port]{}
(myand2.out) node (Y2)[anchor=south west,xshift=0.5cm,yshift=-0.5cm] {$\overline{B} \cdot A$}
(myand2.in 1) node (B2) [anchor=south east] {$\overline{B}$}
(4,1) node (myor3) [or port]{}
(myor3.out) node (Y3)[anchor=south west] {$A \cdot B + \overline{B} \cdot A$};
%draw line
\draw (myand1.in 1) -- (A1);
\draw (myand1.in 2) -- (B1);
\draw (myand1.in 2) |- (mynot1.in);
\draw (mynot1.out) |- (myand2.in 1) ;
\draw (myand2.out) -| (myor3.in 2);
\draw (myand1.out) -| (myor3.in 1);
\node (Ah1)[xshift=1cm] at (A1) {$\bullet$};
\node at (myand1.in 2) {$\bullet$};
\draw (Ah1) |- (myand2.in 2);
\foreach \Point in {(A1),(B1)}{
\node [xshift=.2cm] at \Point {$\bullet$};
}
\end{circuitikz}
\caption{วงจรลองจิกตามสมการ $X = A \cdot B + B \cdot A$}
\label{fig:exampleLogic}
\end{figure}
This is my result.
The input line of the second AND gate does not connect to input A.
I tried to create node name Ah1 with code \node (Ah1)[xshift=1cm] at (A1) {$\bullet$};
to make a node point.
I draw a line with \draw (Ah1) |- (myand2.in 2);
. However, a line does not connect to the Ah1
node.
Thank you for your suggestion in advance.