# Drawing NOT-OR gate in LaTeX

I want to modify this circuit by aligning the inputs x_3, x_1 and x_2 on the same vertical line and placing the left black disc on the intersection of x_1 and the and gate.

    \begin{circuitikz}
\node[and port] (A) at (0, 0) {};
\node at (A) [ocirc,fill=black] {};
\node[left] at (A.in 1) {$$x_1$$};
\node[left] at (A.in 2) {$$x_2$$};

\node at (A.bin 1) [ocirc,fill=black] {};
\node[or port] (B) at (2.7,-0.28) {};
\node (in3) at ($(B.in 2) - (3, 0)$) {};
\draw (in3) -- (B.in 2);
\node at (in3)  {$$x_3$$};
\node[right] at (B.out) {$$(x_1'x_2)'+x_3$$};

\draw (A.out)  --  (B.in 1);
\end{circuitikz}


This produces this But I want this How do I also make the inverter symbol a black disc instead of a circle?

• For the inverter, just use \node at (A) [ocirc,fill=black] {};. For the rest of the question, I didn't understand exactly what you want. Maybe if you drew a sketch of it? Apr 29, 2021 at 21:47
• If you don't mind deforming the gate slightly you could try \node[and port, yscale=0.75] (A) at (0, 0) {};. This scales the y dimensions of the gate by 0.75 times which is enough that there is no overlap and the circuit is still mostly the same. Apr 30, 2021 at 21:54
• yes. It slightly deforms the x_3 input Apr 30, 2021 at 22:03

Maybe this? But you may be more specific about what you need. \documentclass{article}
\usepackage{circuitikz}
\begin{document}

\begin{circuitikz}
\node[and port, number inputs=1] (A) at (0, 0) {};
\node at (A) [ocirc,fill=black] {};
\node[left] at (A.in 1) {$$x_1$$};
\node[left] at (A.in 2) {$$x_2$$};

\node[or port] (B) at (4,0.28) {};
\node[left] at (B.in 1) {$$x_3$$};
\node[right] at (B.out) {$$(x_1'x_2)'+x_3$$};

\draw (A.out)  --  (B.in 2);
\end{circuitikz}

\end{document}


## EDIT

So maybe this one? \documentclass{article}
\usepackage{circuitikz}
\begin{document}

\begin{circuitikz}
\node[and port, number inputs=1] (A) at (0, 0) {};
\node at (A) [ocirc,fill=black] {};
\node[left] at (A.in 1) {$$x_1$$};
\node at (A.left) [yshift=8pt,ocirc,fill=black] {};
\node[left] at (A.in 2) {$$x_2$$};

\node[or port] (B) at (3,-.65) {};
\node[left] at (B.in 2-| A.in 1) (x3) {$$x_3$$};
\node[right] at (B.out) {$$(x_1'x_2)'+x_3$$};

\draw (A.out)  --++ (1,0) |-  (B.in 1);
\draw (x3)  --  (B.in 2);
\end{circuitikz}

\end{document}


## SECOND EDIT

Following OP's demand, I propose another evolution of the solution, but it's now mandatory to scale the OR gate a bit. \documentclass{article}
\usepackage{circuitikz}
\begin{document}

\begin{circuitikz}
\node[and port, number inputs=1] (A) at (0, 0) {};
\node at (A) [ocirc,fill=black] {};
\node[left] at (A.in 1) {$$x_1$$};
\node at (A.in 1) [xshift=6.5pt,ocirc,fill=black] {};
\node at (A.left) [yshift=8pt,ocirc,fill=black] {};
\node[left] at (A.in 2) {$$x_2$$};

\node[or port,scale=1.2] (B) at (3,-.35) {};
\node[left] at (B.in 2-| A.in 1) (x3) {$$x_3$$};
\node[right] at (B.out) {$$(x_1'x_2)'+x_3$$};

\draw (A.out)  -- (B.in 1);
\draw (x3)  --  (B.in 2);
\end{circuitikz}

\end{document}

• I want x_1,x_2 and x_3 to be on the same vertical line Apr 30, 2021 at 9:52
• I edited my answer to add this feature. But you can't align x1 x2 and x3 vertically without using a fork link between the two gates (it would end in having x2 and x3 crashed). Apr 30, 2021 at 15:23
• after searching for so long, I found an image that could describe my need. I have updated my requirements. Sorry for this trouble. Apr 30, 2021 at 20:37
• And so I edited my answer once again. Hope it will nicely fit your needs, even if I don't really understand why the fork link seems to bother you like this ;) Apr 30, 2021 at 22:26
• There's no problem with the fork line. Actually I'm learning in this way how to manipulate lines and gaps like this. Apr 30, 2021 at 22:48