transformation of a difference equation How can I translate the difference equation
$$x_{k+3}+4x_{k+2}+3x_{k+1}+x_k=2u_{k+2}$$
into a state-space representation of the following form (A and B are matrices)
$$x_{k+1}=Ax_k+Bu_k$$

As always in such cases. Let 
$$ X_k := \begin{pmatrix} x_k \\ x_{k+1}\\ x_{k+2} \end{pmatrix} $$
and 
$$ U_k := \begin{pmatrix} u_k \\ u_{k+1} \\ u_{k+2}\end{pmatrix} $$
Then the above can be written as 
\begin{align*}
  X_{k+1} &= \begin{pmatrix} x_{k+1} \\ x_{k+2}\\ x_{k+3} \end{pmatrix} \\
   &= \begin{pmatrix} 0 & 1 & 0\\ 0 & 0 & 1\\ -1 & -3 & -4\end{pmatrix}
   \begin{pmatrix} x_k \\ x_{k+1}\\ x_{k+2} \end{pmatrix}
  + \begin{pmatrix} 0 & 0 & 0\\ 0 & 0 & 0\\ 0 & 0 & 2\end{pmatrix}
    \begin{pmatrix} u_k \\ u_{k+1}\\ u_{k+2} \end{pmatrix}\\
  &=: AX_k + BU_k
\end{align*}
