%!tikz editor 1.0
\documentclass{article}
\usepackage{tikz}
\usepackage[graphics, active, tightpage]{preview}
\usepackage{circuitikz}
\PreviewEnvironment{tikzpicture}

%!tikz preamble begin
%\usetikzlibrary{circuits.logic.US, positioning}
\usepackage{circuitikz}
\usepackage[utf8]{inputenc}
%!tikz preamble end


\begin{document}
%!tikz source begin
\begin{tikzpicture}[scale=6, transform shape]   
\tikzstyle{branch}=[fill,shape=circle,minimum size=1pt,inner sep=pt]


\ctikzset{
    logic ports=ieee,
    logic ports/scale=1,
%    logic ports/fill=lightgray
	% Koordinaten für Kreuzpunkte
 }

\node[not port] at (1.25,1)(nota){};
\node[not port] at (1.25,3)(notb){};
\node[nand port] at (4,2)(n2){};

\node (a) at (0,1) {$a$};
\node (b) at (0,3) {$b$};
\node (out1) at (2.5,2) {};
\node (y) at (6,2) {$out$};


\draw(nota.in) -- (a);
\draw(notb.in) -- (b);
\draw(nota.out) --++ (0.5,0) --++ (0,0.72)-| ($(n2.in 2)$);
\draw(notb.out) --++ (0.5,0) --++ (0,-0.72)-| ($(n2.in 1)$);
%\draw(n2.input 2) -| ($(out1)$);

\draw(n2.out) -- (y);


\end{tikzpicture}
%!tikz source end

\end{document}