%!tikz editor 1.0
\documentclass{article}
\usepackage{pgf,tikz,pgfplots}

\usepackage{tkz-euclide}

\usetikzlibrary{angles, arrows.meta, quotes, calc, babel, fadings,quotes}

\usetikzlibrary{intersections,through,backgrounds}


\usepackage[graphics, active, tightpage]{preview}
\PreviewEnvironment{tikzpicture}

%!tikz preamble begin

%!tikz preamble begin
\pgfplotsset{compat=1.18}
%!tikz preamble begin

%!tikz preamble begin
\usepackage{circuitikz}
%!tikz preamble begin

%!tikz preamble end


\begin{document}
\begin{circuitikz} \draw
(0,0) node (nota) [not port] {}

(nota.in) node (A1)   [anchor=east,xshift=-1cm]  {a}
(A1) -- (nota.in)

(0,-2.6) node (notb) [not port] {}
(notb.in) node (B1)   [anchor=east,xshift=-1cm] {b}
(B1) -- (notb.in)

(2.5,-0.7) node (nand1) [nand port]  {}

(nota.out) -| (nand1.in 1)

(2.5,-2) node (nand2) [nand port]  {}

(notb.out) -| (nand2.in 2)

%node [circ, xshift=0.7cm](B1-dot1) at (B1) {}
%(B1-dot1) |- (nand1.in 2)

(B1) ++(0.7cm,0) node[circ] {} |- (nand1.in 2)
(A1) ++(1cm,0) node[circ] {} |- (nand2.in 1)

(4.5,-1.4) node (nand3) [nand port]  {}
(nand3.out) node (C1)   [anchor=west,xshift= 5mm] {out}
(nand3.out) -- (C1)

(nand1.out) -| (nand3.in 1)
(nand2.out) -| (nand3.in 2)

(nota.out) node [xshift=10,yshift=7,font=\footnotesize] {nota}
(notb.out) node [xshift=10,yshift=-7,font=\footnotesize] {notb}

(nand1.out)  node [xshift=15,yshift=7,font=\footnotesize]        {nandout1}
(nand2.out)  node [xshift=15,yshift=-7,font=\footnotesize]        {nandout2}
 %   (nand1.in 1) node (A1)   [anchor=east,xshift=-1cm]  {A}

;\end{circuitikz}
\end{document}