Compute the two-dimensional DFT
No you are not doing the separation correctly :

The horizontal 1D-DFT of the rows of input will be:

$ H_1 = \begin{matrix}
  2 &amp; 0 &amp; 0 &amp; 0 \\
  2 &amp; 0 &amp; 0 &amp; 0 \\
  2 &amp; 0 &amp; 0 &amp; 0 \\
  2 &amp; 0 &amp; 0 &amp; 0 \\
 \end{matrix}
 $

and the vertical 1D-DFT of the columns of $H_1$ will be:

$ 
 H_2 = \begin{matrix}
  8 &amp; 0 &amp; 0 &amp; 0 \\
  0 &amp; 0 &amp; 0 &amp; 0\\
  0 &amp; 0 &amp; 0 &amp; 0\\
   0 &amp; 0 &amp; 0 &amp; 0\\
 \end{matrix}
 $

which is equivalent to the 2D-DFT of the original input.