Generation Matrix and codeword for a linear Block Code
Suppose we have to send a message a vector of size of k bits, and we decided to add the parity bits q = n-k. the the received code word will be of size n.

To add the parity bits we need generation matrix Gk×n . For linear block code the formation of generation matrix is as follows:

There are different way to find this generation matrix. One of the popular ways are: linear code generation matrix and another one is cyclic code using a polynomial function. Suppose at any way have found this.

Now, to create transmission codeword just simply multiply message vector and generation matrix using XOR operation.
Suppose m is the message vector of size k and Gk×n is the generation matrix then codeword will be

The first three bits are message and the last 3 bits are parity bits or check bits.
Statlearner
Statlearner