---
title: "Design a C(8,4) linear block code"
subject: "Data Communication"
chapter: 8
key: "semester_5/data_communication:linear-block-code-84"
source: https://www.bctengineer.com/q/semester_5/data_communication/linear-block-code-84
site: BCT Engineering
---

# Design a C(8,4) linear block code

Data Communication · Chapter 8: Information Theory and Coding

- Asked in: 2078 Bhadra, 8 marks
- Video: [LINEAR BLOCK CODES in simple way - Find codeword for message and decode the received sequence| hindi](https://www.youtube.com/watch?v=x0eu7gP4r10) — Electronics Subjectified
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/data_communication/linear-block-code-84
- Whole chapter: https://www.bctengineer.com/md/semester_5/data_communication/chapter-8

## Question

What are linear block codes? Design a code word of a C(8,4) block code with any suitable generation matrix.

## Short answer

Linear block codes: any sum of codewords is a codeword. For C(8,4) with systematic G=[I4|P] using parity p1=m2⊕m3⊕m4, etc., message 1011 gives codeword 10110100. Minimum distance d_min = 4.

## Answer

A **linear block code** is a block code in which the modulo-2 sum of any two codewords is also a codeword. A C(n, k) code encodes k message bits into n bits by c = m·G, where G is a k × n generator matrix. It has 2ᵏ codewords, and d_min equals the minimum non-zero codeword weight.

#### Design of C(8,4)
Here n = 8, k = 4, so 4 parity bits are added (rate 1/2). Use the systematic form G = [I₄ | P]:

```text
      | 1 0 0 0 : 0 1 1 1 |
 G =  | 0 1 0 0 : 1 0 1 1 |
      | 0 0 1 0 : 1 1 0 1 |
      | 0 0 0 1 : 1 1 1 0 |
```
Parity equations for c = [m1 m2 m3 m4 | p1 p2 p3 p4]:
- p1 = m2 ⊕ m3 ⊕ m4
- p2 = m1 ⊕ m3 ⊕ m4
- p3 = m1 ⊕ m2 ⊕ m4
- p4 = m1 ⊕ m2 ⊕ m3

#### Example codeword
Message 1011: c = row 1 ⊕ row 3 ⊕ row 4 = 10000111 ⊕ 00101101 ⊕ 00011110 = **10110100**.

#### All 16 codewords
| m | c | m | c |
|---|---|---|---|
| 0000 | 00000000 | 1000 | 10000111 |
| 0001 | 00011110 | 1001 | 10011001 |
| 0010 | 00101101 | 1010 | 10101010 |
| 0011 | 00110011 | 1011 | 10110100 |
| 0100 | 01001011 | 1100 | 11001100 |
| 0101 | 01010101 | 1101 | 11010010 |
| 0110 | 01100110 | 1110 | 11100001 |
| 0111 | 01111000 | 1111 | 11111111 |

Minimum weight of non-zero codewords = 4, so **d_min = 4**: the code detects 3 errors and corrects 1 (single-error correcting, double-error detecting). Parity-check matrix H = [Pᵀ | I₄].

## Check yourself

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

1. For a C(8,4) code, how many parity bits and codewords are there?
   A. 4 parity bits, 16 codewords
   B. 8 parity bits, 4 codewords
   C. 4 parity bits, 8 codewords
   D. 3 parity bits, 16 codewords
   Answer: A. n - k = 4 parity bits and 2^k = 16 codewords; the rate is 1/2. (Key point: Code parameters)

2. What form does the systematic G take?
   A. G = [P | P]
   B. G = [I4 | P], a 4 x 8 matrix
   C. G = [P | I8]
   D. An 8 x 8 identity
   Answer: B. G = [I4 | P] has k = 4 rows and n = 8 columns, so the first 4 bits of the codeword are the message. (Key point: Systematic generator matrix)

3. For message 1011, which rows of G are added and what is the codeword?
   A. Rows 1,2,3 giving 11100001
   B. Rows 1,3,4 giving 10110100
   C. Rows 2,3,4 giving 01111000
   D. Rows 1,4 giving 10011001
   Answer: B. The 1s select rows 1, 3, 4; 10000111 xor 00101101 xor 00011110 = 10110100. (Key point: Encoding example)

4. The minimum non-zero weight is 4. What follows?
   A. d_min = 4: detects 3 errors, corrects 1
   B. d_min = 4: detects 4 and corrects 2
   C. d_min = 8
   D. d_min = 1
   Answer: A. Detects d_min - 1 = 3 errors and corrects floor(3/2) = 1. (Key point: Minimum distance)

## Related in Data Communication

- [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×
- [(6,3) block code words, weights, dmin](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ablock-code-63-matrix-weights) — Data Communication, chapter 8
- [Linear block coding with example](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Alinear-block-code-explain) — Data Communication, chapter 8, asked 3×
- [Cyclic codes](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Acyclic-codes) — Data Communication, chapter 8, asked 3×
- [All code words of the (6,3) code with given G](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ablock-code-63-all-codewords) — Data Communication, chapter 8

## Related in other subjects

- [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×
- [Short note: Syndrome calculation in linear systematic block code](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ashort-note-syndrome-calculation) — Communication Systems, chapter 8
- [(6, 3) code from parity check matrix](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Alinear-block-code-6-3-h-matrix) — Communication Systems, chapter 8
- [(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
