[Tex/LaTex] How to draw curved arrows in tikz

tikz-pgf

I am getting something like this:
enter image description here

This certainly doesn't look good. Curved arrows cross the blocks. Is there any better way of drawing curved arrows or any other solution?

I am putting my code:

\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usepackage{verbatim}
\usepackage[margin=15mm]{geometry}
\usetikzlibrary{shapes,arrows,fit,calc,positioning}


\begin{document}

\begin{tikzpicture}[thick]
\tikzset{input/.style={}}
\tikzset{block/.style={rectangle,draw}}
\tikzstyle{pinstyle} = [pin edge={to-,thick,black}]

\node [input, name=input] {};
\node [block, right=0.5 cm of input,minimum width=1.5cm, minimum height=2.5cm] (a) {};
\node [block, right of=a,minimum width=1.5cm, minimum height=5cm,node distance=3cm] (b) {};
\node [block, right of=b, minimum width=2cm, minimum height=5cm,node distance=3cm] (c) {};
\node [block, right of=c,minimum width=1.5cm, minimum height=5cm,node distance=3cm] (d) {};
\node [block, right of=d, minimum width=2cm, minimum height=5cm,node distance=3cm] (e) {};
\node [right =0.5 cm of e] (output) {};

\begin{scope}[->,>=latex]

\draw[->] (input) -- (a);

\node at (b.center) {\footnotesize{z}};

\draw[->] ([yshift=1.5 cm]c.north west) node[left]{\footnotesize{$Ack_1$}} -| ([xshift=0.25 cm]e.north);
\draw[->] ([yshift=1.5 cm]c.north west) -| ([xshift=0.25 cm]c.north);
\draw[->] ([yshift=1 cm]c.north west) node[left]{\footnotesize{$Ack_0$}} -| ([xshift=-0.25 cm]e.north);
\draw[->] ([yshift=1 cm]c.north west) -| ([xshift=-0.25 cm]c.north);
\draw[->] (e) -- (output);

\foreach \i in {2,...,-2}{% 
\draw[->] ([yshift=\i * 0.4 cm]a.east) -- ([yshift=\i * 0.8 cm]b.west) ;}

\foreach \i in {-2,...,2}{% 
\draw[->] ([yshift=\i * 0.8 cm]b.east) -- ([yshift=\i * 0.8 cm]c.west) ;}

\foreach \i in {-2,...,2}{% 
\draw[->] ([yshift=\i * 0.4 cm]a.east) to [out=-60,in=-120] ([yshift=\i * 0.8 cm]d.west) ;}

\foreach \i in {-2,...,2}{% 
\draw[->] ([yshift=\i * 0.8 cm]d.east) -- ([yshift=\i * 0.8 cm]e.west) ;}

\end{scope}
\end{tikzpicture}

\end{document}

Best Answer

you can add two points in the path of the arc

\documentclass[a4paper,10pt]{article}
\usepackage{tikz}
\usepackage{verbatim}
\usepackage[margin=15mm]{geometry}
\usetikzlibrary{shapes,arrows,fit,calc,positioning}


\begin{document}

\begin{tikzpicture}[thick]
\tikzset{input/.style={}}
\tikzset{block/.style={rectangle,draw}}
\tikzstyle{pinstyle} = [pin edge={to-,thick,black}]

\node [input, name=input] {};
\node [block, right=0.5 cm of input,minimum width=1.5cm, minimum height=2.5cm,red] (a) {};
\node [block, right of=a,minimum width=1.5cm, minimum height=5cm,node distance=3cm,blue] (b) {};
\node [block, right of=b, minimum width=2cm, minimum height=5cm,node distance=3cm,purple] (c) {};
\node [block, right of=c,minimum width=1.5cm, minimum height=5cm,node distance=3cm,green] (d) {};
\node [block, right of=d, minimum width=2cm, minimum height=5cm,node distance=3cm] (e) {};
\node [right =0.5 cm of e] (output) {};

\begin{scope}[->,>=latex]

\draw[->] (input) -- (a);

\node at (b.center) {\footnotesize{z}};

\draw[->] ([yshift=1.5 cm]c.north west) node[left]{\footnotesize{$Ack_1$}} -| ([xshift=0.25 cm]e.north);
\draw[->] ([yshift=1.5 cm]c.north west) -| ([xshift=0.25 cm]c.north);
\draw[->] ([yshift=1 cm]c.north west) node[left]{\footnotesize{$Ack_0$}} -| ([xshift=-0.25 cm]e.north);
\draw[->] ([yshift=1 cm]c.north west) -| ([xshift=-0.25 cm]c.north);
\draw[->] (e) -- (output);

\foreach \i in {2,...,-2}{% 
\draw[->] ([yshift=\i * 0.4 cm]a.east) -- ([yshift=\i * 0.8 cm]b.west) ;}

\foreach \i in {-2,...,2}{% 
\draw[->] ([yshift=\i * 0.8 cm]b.east) -- ([yshift=\i * 0.8 cm]c.west) ;}

\foreach \i in {-2,...,2}{% 
\draw[->] ([yshift=\i * 0.4 cm]a.east) to [out=-0,in=90]  ([xshift={\i * 0.15 cm-0.75cm}]b.south west) to [out=-90,in=-90]  ([xshift={-\i * 0.15 cm+0.75cm}]c.south east)  to [out=90,in=-180]  ([yshift=\i * 0.8 cm]d.west) ;}

\foreach \i in {-2,...,2}{% 
\draw[->] ([yshift=\i * 0.8 cm]d.east) -- ([yshift=\i * 0.8 cm]e.west) ;}

\end{scope}
\end{tikzpicture}

\end{document}

enter image description here