\begin{tikzpicture}[scale=1, transform shape,circuit logic IEC] \tikzstyle{branch}=[fill,shape=circle,minimum size=1pt,inner sep=pt] \node[not gate] at (1,1)(nota){}; \node[not gate] at (1,3)(notb){}; \node[nand gate] at (3,2)(n2){}; \node (a) at (0,1) {$a$}; \node (b) at (0,3) {$b$}; \node (out1) at (2.,2) {}; \node (y) at (4.25,2) {$out$}; \draw(nota.input) -- (a); \draw(notb.input) -- (b); \draw(nota.output) --++ (0.5,0) --++ (0,0.825)-| ($(n2.input 2)$); \draw(notb.output) --++ (0.5,0) --++ (0,-0.825)-| ($(n2.input 1)$); %\draw(n2.input 2) -| ($(out1)$); \draw(n2.output) -- (y); \end{tikzpicture}