22-Elec-B3 Digital Communications Systems · December 2014
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Paper format: Professional Engineers of Ontario, Annual Examinations — December 2014, 07-Elec-B3 Digital Communication Systems. Three hours, closed book, a PEO-approved non-programmable calculator permitted. Five questions are printed at 25 marks each; any four constitute a complete paper worth 100 marks, and only the first four appearing in the answer book are marked. Marks are shown in the left margin. All five questions are solved below, because the set as a whole is the study resource.
Reference texts.
Check — the parity-check matrix of Question 5(c) did not print on the paper. Page 3 reads “Consider a binary Hamming code with the following parity check matrix:” followed by a blank gap of roughly two lines, and then “Give the corresponding generator matrix.” The gap is genuinely empty: the matrix is missing from the printed paper itself. Parts (c) and (d) are therefore solved for the standard systematic binary (7,4) Hamming code, which is the only binary Hamming code that fits a matrix of the size the gap allows and is the canonical textbook example. The assumption is stated explicitly in the answer, exactly as Note 1 on the cover page instructs (“the candidate is urged to submit with the answer paper a clear statement of any assumptions made”). The method of parts (c) and (d) is independent of which particular Hamming matrix is intended.
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
Source note (parts c and d). On the printed paper the parity-check matrix is absent: page 3 runs straight from “with the following parity check matrix:” through a blank two-line gap to “Give the corresponding generator matrix.” the equation object failed to print when the paper was produced, while every surrounding character is crisp. Following Note 1 on the cover page, an assumption is stated and used: parts (c) and (d) are answered for the standard systematic binary (7,4) Hamming code, $H = [\,A \mid I_3\,]$, which is the canonical binary Hamming code of the size the gap allows. The method shown — converting between $H$ and $G$ in systematic form, then locating an error by matching its syndrome to a column of $H$ — applies unchanged to whichever particular Hamming matrix the examiner intended.
Both families add controlled redundancy so that a receiver can detect or correct channel errors, but they differ fundamentally in whether the encoder has memory. A block code partitions the information stream into independent blocks of $k$ bits and maps each block, on its own, to an $n$-bit codeword through a fixed linear transformation $\mathbf{c} = \mathbf{m}G$. The encoder is memoryless: the codeword depends only on the current block, blocks may be encoded and decoded in any order, and the code is fully described by its generator and parity-check matrices. Decoding exploits algebraic structure — syndrome lookup for a Hamming code, or the finite-field algebra of Berlekamp–Massey for a Reed–Solomon or BCH code — and typically works on hard decisions. Familiar examples are the Hamming, cyclic redundancy check, BCH, Reed–Solomon and low-density parity-check codes.
A convolutional code, by contrast, processes the information as a continuous stream through a shift register of some constraint length $K$, so that each output bit is a modulo-2 combination of the current input bit and the previous $K-1$ inputs. The encoder is a finite-state machine with memory, the codeword is unbounded in length rather than blocked, and there is no fixed generator matrix in the block-code sense — only a set of generator polynomials and a rate $k/n$ (commonly 1/2 or 1/3). Decoding is not algebraic but a maximum-likelihood search over the encoder’s trellis, performed by the Viterbi algorithm, whose complexity grows as $2^{K-1}$ rather than with the length of the message. Two consequences matter in practice. First, convolutional decoders accept soft channel information naturally, and typically buy 2 to 3 dB over hard-decision decoding, which is why they dominated satellite and mobile links. Second, because errors propagate through the register span they occur in bursts at the decoder output, which is why convolutional codes are usually concatenated with an interleaver and an outer block code — the classic Reed–Solomon plus convolutional arrangement of deep-space and digital-broadcast standards. Block codes, being independent block to block, contain the damage of a burst to the block that suffered it but need the burst to be spread by interleaving in the first place.
The Hamming distance $d(\mathbf{x}, \mathbf{y})$ between two equal-length binary words is the number of bit positions in which they differ — equivalently the Hamming weight of their modulo-2 sum. The minimum Hamming distance $d_{\min}$ of a code is the smallest such distance taken over all distinct pairs of codewords:
$$d_{\min} = \min_{\mathbf{c}_i \neq \mathbf{c}_j} d(\mathbf{c}_i, \mathbf{c}_j).$$For a linear code the definition simplifies usefully: since the sum of two codewords is itself a codeword, $d_{\min}$ equals the smallest Hamming weight among the non-zero codewords, so it can be found by examining $2^k - 1$ words rather than all pairs. It can also be read off the parity-check matrix directly, as the smallest number of columns of $H$ that sum to zero.
The connection to error correction is geometric. Think of the $2^n$ possible received words as points in a cube, with the codewords a sparse subset separated by at least $d_{\min}$ steps. A pattern of $t$ bit errors moves the received word $t$ steps away from the transmitted codeword. Nearest-codeword decoding will still return the right answer provided the corrupted word remains strictly closer to the transmitted codeword than to any other, and non-overlapping spheres of radius $t$ around every codeword require $d_{\min} \ge 2t + 1$. Hence a code can correct
$$t = \left\lfloor \frac{d_{\min} - 1}{2} \right\rfloor \text{ errors, and detect } d_{\min} - 1 \text{ errors,}$$or, if both capabilities are wanted simultaneously, correct $t$ and detect $d$ errors whenever $d_{\min} \ge t + d + 1$. For the (7,4) Hamming code used below, $d_{\min} = 3$, giving $t = \lfloor 2/2 \rfloor = 1$ correctable error and up to 2 detectable errors — which is exactly why it is described as a single-error-correcting, double-error-detecting code when an overall parity bit is appended to make $d_{\min} = 4$.
Given (stated assumption). The standard systematic parity-check matrix of the binary (7,4) Hamming code, with the three parity columns collected on the right:
$$H = \begin{bmatrix} 1 & 1 & 0 & 1 & 1 & 0 & 0 \\ 1 & 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 1 & 0 & 0 & 1 \end{bmatrix} = \begin{bmatrix} A \mid I_3 \end{bmatrix}, \qquad A = \begin{bmatrix} 1 & 1 & 0 & 1 \\ 1 & 0 & 1 & 1 \\ 0 & 1 & 1 & 1 \end{bmatrix}.$$Find. The $4 \times 7$ generator matrix $G$ whose rows span the null space of $H$, i.e. the matrix satisfying $GH^{T} = \mathbf{0}$ over GF(2).
Approach. Read the parity submatrix off $H$, transpose it, and place it alongside a $4 \times 4$ identity so that the code is systematic and every codeword automatically satisfies the parity checks.
Approach. Encode a chosen message, deliberately flip one bit, compute the syndrome of the received word, match the syndrome against the columns of $H$ to locate the flipped position, invert that bit and recover the message.
| Check | Row of $H$ | Modulo-2 sum with $\mathbf{r}$ | Syndrome bit |
|---|---|---|---|
| 1 | (1 1 0 1 1 0 0) | $1 \oplus 1 \oplus 1 \oplus 0 = 1$ | 1 |
| 2 | (1 0 1 1 0 1 0) | $1 \oplus 1 \oplus 1 \oplus 1 = 0$ | 0 |
| 3 | (0 1 1 1 0 0 1) | $1 \oplus 1 \oplus 1 \oplus 0 = 1$ | 1 |
| Quantity | Result |
|---|---|
| (a) Block vs convolutional | Memoryless fixed-length blocks with algebraic decoding vs a shift-register state machine on a continuous stream with Viterbi trellis decoding |
| (b) Minimum Hamming distance | $d_{\min} = \min$ weight of a non-zero codeword; corrects $t = \lfloor (d_{\min}-1)/2 \rfloor$, detects $d_{\min}-1$ |
| (b) For this (7,4) Hamming code | $d_{\min} = 3$ → corrects 1 error, detects 2 |
| (c) Generator matrix | $G = [I_4 \mid A^T]$ — rows 1000110, 0100101, 0010011, 0001111 |
| (d) Message and codeword | $\mathbf{m} = 1011 \rightarrow \mathbf{c} = 1011\,010$ |
| (d) Received word after one error | $\mathbf{r} = 1111\,010$ (bit 2 flipped) |
| (d) Syndrome and correction | $\mathbf{s} = (1,0,1)^T$ = column 2 of $H$ → flip bit 2 → recover $\mathbf{m} = 1011$ |