# Block coding, Hamming distance and CRC

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/practice/tee-formulas/coding

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/practice/tee-formulas--coding/

TEE · Complete six-unit quick reference · current syllabus 702AI0C023



$$
r=n-k,\quad R_c=k/n
$$



k data bits, n codeword bits, r redundant bits; coding rate is dimensionless.



$$
d(a,b)=\operatorname{weight}(a\oplus b)
$$



Count differing bit positions in equal-length words.



$$
s=d_{\min}-1,\quad t=\lfloor(d_{\min}-1)/2\rfloor
$$



Separate maximum guaranteed detection and correction counts; all distinct pairs define dmin.



$$
2^r\ge m+r+1
$$



Smallest r for m data bits in single-error Hamming construction; parity positions 1,2,4,….



$$
R(x)=x^rM(x)\bmod G(x),\quad T=x^rM\oplus R
$$



Generator degree r; append r zeros and use modulo-2 XOR division. Receiver divides T directly.

[CRC and receiver-check working](https://deep-learning-study-room.vercel.app/read/cn/tee/read/error-control--crc-1/)
