\begin{tikzpicture}[scale=0.70,auto]

% lower S(4)
\draw[red box] (1,-.333) rectangle (5.35,3.333);
% upper S(4)
\draw[red box] (1,3.667) rectangle (5.35,7.333);

% Recursive comparators
\draw[green box] (5.85,-.333) rectangle (7.90,7.333);

% lower merge block
\draw[blue box] (8.40,-.333) rectangle (11.25,3.333);
% upper merge block
\draw[blue box] (8.40,3.667) rectangle (11.25,7.333);

% stage 0
\node[vertex] (v0) at (1.50,0) {};
\node[vertex] (v1) at (1.50,1) {};
\path[comp] (v0) -- (v1);

\node[vertex] (v2) at (1.50,2) {};
\node[vertex] (v3) at (1.50,3) {};
\path[comp] (v2) -- (v3);

\node[vertex] (v4) at (1.50,4) {};
\node[vertex] (v5) at (1.50,5) {};
\path[comp] (v4) -- (v5);

\node[vertex] (v6) at (1.50,6) {};
\node[vertex] (v7) at (1.50,7) {};
\path[comp] (v6) -- (v7);

% stage 1
\node[vertex] (v8) at (3.00,0) {};
\node[vertex] (v9) at (3.00,3) {};
\path[comp] (v8) -- (v9);

\node[vertex] (v10) at (3.35,1) {};
\node[vertex] (v11) at (3.35,2) {};
\path[comp] (v10) -- (v11);

\node[vertex] (v12) at (3.00,4) {};
\node[vertex] (v13) at (3.00,7) {};
\path[comp] (v12) -- (v13);

\node[vertex] (v14) at (3.35,5) {};
\node[vertex] (v15) at (3.35,6) {};
\path[comp] (v14) -- (v15);

% stage 2
\node[vertex] (v16) at (4.85,0) {};
\node[vertex] (v17) at (4.85,1) {};
\path[comp] (v16) -- (v17);

\node[vertex] (v18) at (4.85,2) {};
\node[vertex] (v19) at (4.85,3) {};
\path[comp] (v18) -- (v19);

\node[vertex] (v20) at (4.85,4) {};
\node[vertex] (v21) at (4.85,5) {};
\path[comp] (v20) -- (v21);

\node[vertex] (v22) at (4.85,6) {};
\node[vertex] (v23) at (4.85,7) {};
\path[comp] (v22) -- (v23);

% stage 3
\node[vertex] (v24) at (6.35,0) {};
\node[vertex] (v25) at (6.35,7) {};
\path[comp] (v24) -- (v25);

\node[vertex] (v26) at (6.70,1) {};
\node[vertex] (v27) at (6.70,6) {};
\path[comp] (v26) -- (v27);

\node[vertex] (v28) at (7.05,2) {};
\node[vertex] (v29) at (7.05,5) {};
\path[comp] (v28) -- (v29);

\node[vertex] (v30) at (7.40,3) {};
\node[vertex] (v31) at (7.40,4) {};
\path[comp] (v30) -- (v31);

% stage 4
\node[vertex] (v32) at (8.90,0) {};
\node[vertex] (v33) at (8.90,2) {};
\path[comp] (v32) -- (v33);

\node[vertex] (v34) at (9.25,1) {};
\node[vertex] (v35) at (9.25,3) {};
\path[comp] (v34) -- (v35);

\node[vertex] (v36) at (8.90,4) {};
\node[vertex] (v37) at (8.90,6) {};
\path[comp] (v36) -- (v37);

\node[vertex] (v38) at (9.25,5) {};
\node[vertex] (v39) at (9.25,7) {};
\path[comp] (v38) -- (v39);

\node[vertex] (v40) at (10.75,0) {};
\node[vertex] (v41) at (10.75,1) {};
\path[comp] (v40) -- (v41);

\node[vertex] (v42) at (10.75,2) {};
\node[vertex] (v43) at (10.75,3) {};
\path[comp] (v42) -- (v43);

\node[vertex] (v44) at (10.75,4) {};
\node[vertex] (v45) at (10.75,5) {};
\path[comp] (v44) -- (v45);

\node[vertex] (v46) at (10.75,6) {};
\node[vertex] (v47) at (10.75,7) {};
\path[comp] (v46) -- (v47);

\path[edge] (0,0) -- (12.25,0);
\path[edge] (0,1) -- (12.25,1);
\path[edge] (0,2) -- (12.25,2);
\path[edge] (0,3) -- (12.25,3);
\path[edge] (0,4) -- (12.25,4);
\path[edge] (0,5) -- (12.25,5);
\path[edge] (0,6) -- (12.25,6);
\path[edge] (0,7) -- (12.25,7);
\end{tikzpicture}
