[Math] Finding a standard generator matrix given a binary code

binarycoding-theorylinear algebramatrices

My question is how do I find the standard generator matrix of a binary [7,6,2] code?
From what I understand a generator matrix for $C$ is any $ k \times n$ matrix $ G$ with entries in $ \mathbb{F}_q$ such that the rows of $ G$ form a basis for $ C$. I understand that but where does the 2 (d) come into play? Can someone please explain this to me? Thanks!

Best Answer

A "standard" generator matrix of a $[n,k]$ code usually means that we seek a $k\times n$ matrix $G$ of the form $$G = \left[I_{k\times k}\ P_{k\times (n-k)}\right]$$ where $I_{k\times k}$ denotes a $k\times k$ identity matrix. For a $[7,6,2]$ code, $P_{6\times 1}$ is just a column of $6$ bits, and I leave it to you to figure what the six bits must be in order for the code to have minimum distance $2$. Do it; write out an arbitrary 6-bit column on the right of a $6\times 6$ identity matrix. Then, step back and admire the $6\times 7$ matrix that you have written down, and ponder the fact that each row of $G$ is a codeword.