# Finding a standard generator matrix given a binary code

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!

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.
• Yes!!! As long as you understand why the rightmost column has to be all $1$s. – Dilip Sarwate Sep 18 '14 at 1:50