---
title: "All code words of the (6,3) code with given G"
subject: "Data Communication"
chapter: 8
key: "semester_5/data_communication:block-code-63-all-codewords"
source: https://www.bctengineer.com/q/semester_5/data_communication/block-code-63-all-codewords
site: BCT Engineering
---

# All code words of the (6,3) code with given G

Data Communication · Chapter 8: Information Theory and Coding

- Asked in: 2072 Chaitra, 2+8 marks
- Video: [Generator Matrix to generate code words in Linear Block Code with example in Digital Communication](https://www.youtube.com/watch?v=Y2wpSJUHEfw) — Engineering Funda
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/data_communication/block-code-63-all-codewords
- Whole chapter: https://www.bctengineer.com/md/semester_5/data_communication/chapter-8

## Question

What are block codes? The generator matrix for a (6,3) block code is shown below. Obtain all code words.
G = [1 0 0 : 1 1 1; 0 1 0 : 1 1 0; 0 0 1 : 1 0 1]

## Short answer

A (6,3) linear block code maps 3-bit messages to 6-bit codewords via c=mG. The eight codewords are 000000, 001101, 010110, 011011, 100111, 101010, 110001, 111100.

## Answer

#### Block codes
A **block code** (n, k) splits the data stream into blocks of k bits and maps each block to an n-bit codeword by adding n − k parity bits. There are 2ᵏ valid codewords out of 2ⁿ possible words; the code rate is k/n. For a linear block code, c = m·G (mod 2).

#### Codewords of the (6,3) code
G = [I₃ | P] with rows 100111, 010110, 001101. For m = (m1 m2 m3):
c = [m1 m2 m3 | m1⊕m2⊕m3, m1⊕m2, m1⊕m3]

| Message m | Operation | Codeword | Weight |
|---|---|---|---|
| 000 | – | 000000 | 0 |
| 001 | row 3 | 001101 | 3 |
| 010 | row 2 | 010110 | 3 |
| 011 | row 2 ⊕ row 3 | 011011 | 4 |
| 100 | row 1 | 100111 | 4 |
| 101 | row 1 ⊕ row 3 | 101010 | 3 |
| 110 | row 1 ⊕ row 2 | 110001 | 3 |
| 111 | all rows | 111100 | 4 |

Example: 011 → 010110 ⊕ 001101 = 011011.

The minimum non-zero weight is 3, so d_min = 3 (detects 2 errors, corrects 1).

## Check yourself

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

1. In an (n,k) block code, what happens to each block of data?
   A. k bits are mapped to an n-bit codeword by adding n-k parity bits
   B. n bits are compressed to k bits
   C. k bits are repeated n times
   D. n bits are encrypted into k bits
   Answer: A. A block code takes k message bits and adds n - k parity bits to form an n-bit codeword, with code rate k/n. (Key point: Block code (n,k))

2. How is a codeword computed for a linear block code?
   A. c = m + G
   B. c = m·G (mod 2)
   C. c = G / m
   D. c = m·m (mod 2)
   Answer: B. The codeword is the message vector multiplied by the generator matrix, using modulo-2 arithmetic. (Key point: Encoding rule)

3. For this G, what is the codeword for message 101?
   A. 101101
   B. 101010
   C. 100111
   D. 001101
   Answer: B. Add row 1 (100111) and row 3 (001101) mod 2 to get 101010. (Key point: Codeword for message 101)

4. How many codewords exist and what is d_min?
   A. 6 codewords, d_min = 2
   B. 8 codewords, d_min = 3
   C. 8 codewords, d_min = 4
   D. 64 codewords, d_min = 1
   Answer: B. There are 2^3 = 8 codewords. The smallest non-zero weight is 3, so d_min = 3 (detects 2 errors, corrects 1). (Key point: Minimum distance)

## Related in Data Communication

- [(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
- [Design a C(8,4) linear block code](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Alinear-block-code-84) — 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×
- [Hamming codes and their properties](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahamming-code-properties) — 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×
- [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×
- [(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
- [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
