NivaarExam PrepOfficial exam papers ↗

25-Comp-B5 Computer Communications · December 2018

Question 5 of 9: Cyclic Redundancy Check (CRC)

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

Reference texts: Stallings, Data and Computer Communications, 10th ed. — sampling and aliasing (Ch.5, Q1), cascaded gains/losses and decibels (Ch.3, Q2), Shannon–Hartley channel capacity (Ch.3, Q3), AM/FM analog modulation (Ch.5, Q4), LAN/network topologies (Ch.16, Q6), QPSK digital modulation (Ch.5, Q7), IP addressing and subnetting (Ch.18, Q8), and physical/link/network-layer terminology (Ch.3, 9, 11, 17, Q9); Kurose & Ross, Computer Networking: A Top-Down Approach, 8th ed. — error detection via CRC (Ch.5, Q5), IP addressing (Ch.4, Q8), and TCP/IP terminology (Ch.1, Q9).

This is a choose-any-5-of-9 exam; all nine questions are answered below.

Question 5: Cyclic Redundancy Check (CRC) (20 marks)

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.

Given. Generator (divisor) bit pattern $P = 110011$ (6 bits, degree 5); message $M = 11100011$ (8 bits).

QuantityValue
Generator $P$110011
Message $M$11100011

Find. The CRC — the $r$-bit remainder appended to $M$ to form the transmitted frame.

Approach. Determine the redundancy length $r = \deg(P)$; append $r$ zero bits to $M$; perform binary mod-2 (XOR-only, no-borrow) polynomial division of the augmented message by $P$; the final $r$-bit remainder is the CRC.

  1. Redundancy length. $$r = \text{len}(P) - 1 = 6 - 1 = 5\ \text{bits}.$$
  2. Augmented dividend. Append $r=5$ zero bits to $M$ (equivalent to $M \cdot 2^{r}$): $$M \cdot 2^{r} = 11100011\underbrace{00000}_{5\ \text{zeros}} = 1110001100000\ (13\ \text{bits}).$$
  3. Mod-2 division by $P=110011$. Working left to right across the 8 possible alignments ($13-6+1=8$), XOR with $P$ whenever the current leading bit is 1, otherwise bring the next bit down unchanged:
    PositionLeading bitActionWorking register after this step
    01XOR with $P$0010111100000
    10bring down0010111100000
    21XOR with $P$0001110000000
    31XOR with $P$0000010110000
    40bring down0000010110000
    51XOR with $P$0000001111100
    61XOR with $P$0000000011010
    70bring down0000000011010
    Two independent implementations (a bitwise sliding-window XOR pass, and an integer shift-and-XOR pass) agree on every intermediate row.
  4. Remainder = CRC. The final 5 bits of the working register are the remainder: $$\text{CRC} = \boxed{11010}.$$
  5. Self-check. The transmitted frame is $T = M \Vert \text{CRC} = 1110001111010$. Dividing $T$ by $P$ (mod-2) gives a remainder of $00000$, confirming $T$ is exactly divisible by $P$ as required for a valid CRC codeword.
QuantityResult
Redundancy length $r$5 bits
Augmented message $M\cdot2^{r}$1110001100000
CRC (remainder)11010
Transmitted frame $T = M\Vert\text{CRC}$1110001111010