Can anyone explain how the complex matrix representation of a quaternions is constructed? I am reading some properties of quaternionic matrices and I am unable to understand how can we got such matrix representation. please help in this regards.

The ring of quaternions $\mathbb{H}$ is isomorphic to the 
ring of matrices with complex entries of the form $A =\begin{pmatrix} 
x & y 
\\
- \bar{y} & \bar{x} 
\end{pmatrix} $ 
For a quaternion $z=a+b\mathbf{i}+c\mathbf{j}+d\mathbf{k}$ the isomorphism is given by:
$$
z=a+b\mathbf{i}+c\mathbf{j}+d\mathbf{k} \quad  \mapsto \quad \mathbf{Z}= a\mathbf{U}+b\mathbf{I}+c\mathbf{J}+d\mathbf{K} \quad a,b,c,d \in \mathbb{R}
$$
with:
$$
\mathbf{U}=
\left( 
 \begin{array}{ccccc}
1&0  \\
 0 &1
\end{array}
\right)
\qquad
\mathbf{I}=
\left( 
 \begin{array}{ccccc}
i&0  \\
 0 &-i
\end{array}
\right)
\qquad
\mathbf{J}=
\left( 
 \begin{array}{ccccc}
0&1  \\
 -1 &0
\end{array}
\right)
\qquad
\mathbf{K}=
\left( 
 \begin{array}{ccccc}
0&i  \\
 i &0
\end{array}
\right)
$$
We can easy see that:
$$
\mathbf{I}^2=\mathbf{J}^2=\mathbf{K}^2=\mathbf{I}\mathbf{J}\mathbf{K}=-\mathbf{U}
$$
and
$$
z=a+b\mathbf{i}+c\mathbf{j}+d\mathbf{k} \quad  \mapsto \quad \mathbf{Z}=
\left( 
 \begin{array}{ccccc}
 a+ib&c+id  \\
 -c+id &a-ib
\end{array}
\right)
$$
with
$$
\mbox{det}(\mathbf{Z})=
\left |
\left( 
 \begin{array}{ccccc}
 a+ib&c+id  \\
 -c+id &a-ib
\end{array}
\right)
\right |=
a^2+b^2+c^2+d^2=|z|^2
$$
