---
title: "(6, 3) code from parity check matrix"
subject: "Communication Systems"
chapter: 8
key: "semester_6/communication_systems:linear-block-code-6-3-h-matrix"
source: https://www.bctengineer.com/q/semester_6/communication_systems/linear-block-code-6-3-h-matrix
site: BCT Engineering
---

# (6, 3) code from parity check matrix

Communication Systems · Chapter 8: Error Detection and Correction Coding

- Asked in: 2081 Chaitra, 2+4+4 marks
- Video: [Parity Check Matrix in Linear Block Code with Example in Digital Communication by Engineering Funda](https://www.youtube.com/watch?v=vSIjVc0ZAT4) — Engineering Funda
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/communication_systems/linear-block-code-6-3-h-matrix
- Whole chapter: https://www.bctengineer.com/md/semester_6/communication_systems/chapter-8

## Question

A (6, 3) error control code has the following parity check matrix.
H = [1 0 1 1 0 0; 1 1 0 0 1 0; 0 1 1 0 0 1]
a) Determine the generator matrix G
b) Generate a codeword for message 110
c) Check whether the received code word 110111 has error or not.

## Short answer

G = [I3 | P] with P = [1 1 0; 0 1 1; 1 0 1]. Codeword for 110 is 110101. Received 110111 yields syndrome 010, so it contains an error; corrected codeword is 110101.

## Answer

For a systematic $(n,k)$ linear block code, $G=[I_k\mid P]$ and $H=[P^T\mid I_{n-k}]$, with $GH^T=0$. A codeword is $\mathbf{c}=\mathbf{m}G$, and for a received vector $\mathbf{r}$ the syndrome is $\mathbf{s}=\mathbf{r}H^T$. All arithmetic is modulo 2.

#### a) Generator matrix

$$
H=\begin{bmatrix}1&0&1&1&0&0\\1&1&0&0&1&0\\0&1&1&0&0&1\end{bmatrix}=[P^T\mid I_3],\qquad P^T=\begin{bmatrix}1&0&1\\1&1&0\\0&1&1\end{bmatrix}
$$

Transposing:

$$
P=\begin{bmatrix}1&1&0\\0&1&1\\1&0&1\end{bmatrix},\qquad G=[I_3\mid P]=\begin{bmatrix}1&0&0&1&1&0\\0&1&0&0&1&1\\0&0&1&1&0&1\end{bmatrix}
$$

#### b) Codeword for message 110

$$
\mathbf{c}=\mathbf{m}G=1\cdot(100110)\oplus1\cdot(010011)\oplus0\cdot(001101)=110101
$$

Parity bits directly: $p_1=m_1\oplus m_3=1\oplus0=1$, $p_2=m_1\oplus m_2=1\oplus1=0$, $p_3=m_2\oplus m_3=1\oplus0=1$.

**Codeword = 110 101**

Check: $\mathbf{c}H^T$: row 1: $1+0+0+1=0$, row 2: $1+1+0+0=0$, row 3: $1+0+0+1=0$. Syndrome $000$, so it is valid.

All codewords (for reference; $d_{min}=3$, corrects 1 error):

| $\mathbf{m}$ | $\mathbf{c}$ | $\mathbf{m}$ | $\mathbf{c}$ |
|---|---|---|---|
| 000 | 000000 | 100 | 100110 |
| 001 | 001101 | 101 | 101011 |
| 010 | 010011 | 110 | 110101 |
| 011 | 011110 | 111 | 111000 |

#### c) Check received word 110111

$$
\mathbf{s}=\mathbf{r}H^T,\quad \mathbf{r}=(1\,1\,0\,1\,1\,1)
$$

Each syndrome bit is one row of $H$ dotted with $\mathbf{r}$:

| Row of $H$ | Product terms | $s$ |
|---|---|---|
| 1 0 1 1 0 0 | $1+0+0+1+0+0$ | 0 |
| 1 1 0 0 1 0 | $1+1+0+0+1+0$ | 1 |
| 0 1 1 0 0 1 | $0+1+0+0+0+1$ | 0 |

$$
\mathbf{s}=(0\ 1\ 0)\neq\mathbf{0}
$$

The syndrome is non-zero, so **the received word has an error**.

Locating it: $\mathbf{s}=010$ equals the **5th column** of $H$ $(0,1,0)^T$, so assuming a single error, bit 5 is wrong: $\mathbf{e}=000010$.

$$
\hat{\mathbf{c}}=\mathbf{r}\oplus\mathbf{e}=110111\oplus000010=110101
$$

**Answer:** $G$ as above; codeword for 110 is **110101**; received 110111 is in error (syndrome 010), corrected codeword **110101**, message **110**.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Given H = [P^T | I3] for a systematic (6,3) code, how is G obtained?
   A. G = [P | I3]
   B. G = [I3 | P]
   C. G = [P^T | I3]
   D. G = [I3 | P^T]
   Answer: B. Transpose P^T to get P and form G = [I_k | P]; then G H^T = 0. (Key point: G from H)

2. What is the codeword for message 110 using the parity bits p1 = m1+m3, p2 = m1+m2, p3 = m2+m3?
   A. 110011
   B. 110101
   C. 110110
   D. 110000
   Answer: B. p1 = 1, p2 = 0, p3 = 1, so the codeword is 110 101. (Key point: Codeword for 110)

3. What is the syndrome of the received word r = 110111 with the given H?
   A. 000
   B. 010
   C. 101
   D. 100
   Answer: B. Row 2 (110010) dots with r to 1+1+0+0+1+0 = 1, rows 1 and 3 give 0, so s = 010, non-zero, hence an error. (Key point: Syndrome of 110111)

4. The syndrome 010 equals the 5th column of H. What is the corrected codeword?
   A. 110111 (no change)
   B. 110101, by flipping bit 5
   C. 010111, by flipping bit 1
   D. 110110, by flipping bit 6
   Answer: B. For a single error the syndrome equals the column of the erroneous bit; flipping bit 5 gives 110101, a valid codeword. (Key point: Error location and correction)

## Related in Communication Systems

- [(4,3) even parity code is linear, odd parity is not](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aeven-odd-parity-linear-block) — Communication Systems, chapter 8
- [Hamming distance and weight; (6,3) code check for 100101](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ahamming-6-3-h-100101) — Communication Systems, chapter 8
- [Convolutional vs block codes; (7,4) cyclic code for 1011](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aconv-vs-block-cyclic-7-4-1011) — Communication Systems, chapter 8, asked 2×
- [Convolutional vs block coder; (7,4) cyclic code for 1010](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aconv-vs-block-cyclic-7-4-1010) — Communication Systems, chapter 8, asked 2×
- [Significance of dmin; (7,4) cyclic code for 1101 with g(x) = 1 + x + x²](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Admin-cyclic-7-4-1101) — Communication Systems, chapter 8
- [(7,4) cyclic code G(p) = p³ + p + 1 for 0101](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Acyclic-7-4-p3p1-0101) — Communication Systems, chapter 8, asked 2×

## Related in other subjects

- [Dataword vs codeword; error coding techniques](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Adataword-codeword-error-coding) — Data Communication, chapter 8
- [Design a (6,3) block code word](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ablock-code-63-design) — Data Communication, chapter 8, asked 3×
- [Generate stiffness matrix of frame](https://www.bctengineer.com/question.md?key=semester_5%2Ftheory_of_structures_ii%3Astiffness-matrix-frame-coordinates-123) — Theory of Structures II, chapter 3
- [Generate stiffness matrix for portal frame](https://www.bctengineer.com/question.md?key=semester_5%2Ftheory_of_structures_ii%3Astiffness-matrix-frame-3i-i-5m) — Theory of Structures II, chapter 3
