---
title: "Convolutional coder with example"
subject: "Communication Systems"
chapter: 8
key: "semester_6/communication_systems:convolutional-coder-example"
source: https://www.bctengineer.com/q/semester_6/communication_systems/convolutional-coder-example
site: BCT Engineering
---

# Convolutional coder with example

Communication Systems · Chapter 8: Error Detection and Correction Coding

- Asked in: 2072 Kartik (CS II), 6 marks
- Video: [Convolutional Codes (Basics, Designing & Parameters) Explained in Digital Communication](https://www.youtube.com/watch?v=hPNfiFmx5Dk) — 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/convolutional-coder-example
- Whole chapter: https://www.bctengineer.com/md/semester_6/communication_systems/chapter-8

## Question

Explain Convolutional Coder with suitable example.

## Short answer

A convolutional encoder passes bits through a shift register and forms outputs via modulo-2 sums of selected taps, providing memory. Example: rate-1/2, K=3 with generators (1,1,1) and (1,0,1). Encoding message 10011 (plus flush) yields output 11 10 11 11 01 01 11.

## Answer

A **convolutional coder** is a forward error-correcting encoder with memory. It passes the message bits through a shift register and forms output bits as modulo-2 sums of selected stages, so each output depends on the present bit and the previous $K-1$ bits. With $k$ inputs and $n$ outputs per step, the code rate is $r=k/n$; $K$ is the constraint length.

#### Example: rate 1/2, K = 3

Generators $g^{(1)}=(1,1,1)$, $g^{(2)}=(1,0,1)$:

$$
c_i^{(1)}=m_i\oplus m_{i-1}\oplus m_{i-2},\qquad c_i^{(2)}=m_i\oplus m_{i-2}
$$

```text
 Encoder: g1 = 111, g2 = 101 (K = 3, rate 1/2)

 m -->[ m_i ]-->[ m_i-1 ]-->[ m_i-2 ]
        |          |           |
        +---(+)----+-----------+---> c1 = mi+mi-1+mi-2
        |                      |
        +---(+)----------------+---> c2 = mi+mi-2
            output per bit: c1 c2
```

Encoding message $10011$ (plus 00 to flush):

| $m_i$ | $(m_{i-1}m_{i-2})$ before | $c^{(1)}c^{(2)}$ |
|---|---|---|
| 1 | 00 | 11 |
| 0 | 10 | 10 |
| 0 | 01 | 11 |
| 1 | 00 | 11 |
| 1 | 10 | 01 |
| 0 | 11 | 01 |
| 0 | 01 | 11 |

Output: **11 10 11 11 01 01 11**.

#### Representations

- **Code tree:** each input bit splits a branch (up = 0, down = 1), labelled with output bits.
- **State diagram:** 4 states (a = 00, b = 10, c = 01, d = 11), e.g. a goes to b with output 11 on input 1.
- **Trellis:** the state diagram drawn over time; used by the decoder.

#### Decoding

The **Viterbi algorithm** compares the received sequence with every trellis path, keeps the best (minimum distance) path into each state, and outputs the survivor; it is a maximum-likelihood decoder. The free distance of this code is $d_{free}=5$, so it can correct 2 errors within a short span.

## Check yourself

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

1. What characterises a convolutional coder?
   A. Output depends only on the present k-bit block
   B. Each output depends on the present bit and the previous K-1 bits through a shift register
   C. It uses no modulo-2 adders
   D. It works only on blocks of fixed length n
   Answer: B. A convolutional coder has memory: outputs are mod-2 sums of selected shift-register stages. (Key point: Convolutional encoder definition)

2. For g1 = 111 and g2 = 101, what are the output equations?
   A. c1 = mi + mi-1 + mi-2 and c2 = mi + mi-2
   B. c1 = mi + mi-2 and c2 = mi + mi-1
   C. c1 = mi and c2 = mi-1 + mi-2
   D. c1 = mi-1 + mi-2 and c2 = mi
   Answer: A. The generator taps 111 sum all three stages, while 101 sums the first and last. (Key point: Example encoder outputs)

3. What is the output for message 10011 followed by two flush zeros?
   A. 11 01 11 11 10 10 11
   B. 10 11 11 01 01 11 11
   C. 11 10 11 11 01 11 01
   D. 11 10 11 11 01 01 11
   Answer: D. Stepping the register gives 11,10,11,11,01,01,11 as in the table. (Key point: Encoding result)

4. Which statement about Viterbi decoding is correct?
   A. It uses syndrome tables
   B. It decodes block by block using G
   C. It keeps the minimum-distance survivor path into each trellis state, a maximum-likelihood decoder
   D. It chooses the path with maximum distance
   Answer: C. Viterbi compares received data with trellis paths and keeps the best survivor per state. (Key point: Decoding)

## Related in Communication Systems

- [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×
- [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×
