  Surface codes are one of the most important topological stabilizer codes in
the theory of quantum error correction. In this paper, we provide an efficient
way to obtain surface codes through Measurement-based quantum computation
(MBQC) using cluster state as the resource state. Simple twodimensional surface
codes are studied and analyzed using stabilizer formalism. We also present an
algorithm to computationally obtain the stabilizer of the surface codes,
through which we later determine the distance of the codes. We note the
difference in the stabilizers of the surface codes obtained by Fowler et al.
wherein they used CNOT entangling operation to create the resource state as
opposed to the cluster state which is formed using CZ entangling operation. We
provide a theoretical calculation to understand this difference. The obtained
surface codes can be used practically as an encoder circuit to encode one
logical qubit.
