Ec441 Error
Ec441 Error
Spring 2025
goal: decrease residual bit error rate “BER”, without reducing throughput too much.
idea: add redundancy to allow for detection of errors.
tradeoff : increasing redundant bits improves BER but decreases throughput
Introduction
Error-control coding
take k data bits (call it Data), transmit a n-bit long codeword (call it W ord)
there are 2k valid codewords and 2n − 2k other possible words
this is called a block code, often designated as an (n, k) block code.
calculate
W ord = g(Data)
and send W ord
at receiver, calculate
Data = g −1 (Received W ord)
often, W ord = Data f (Data), i.e, we send original data plus “check bits”:
Data |f (Data)
k
the efficiency or rate of the code is Rc = n
Examples I
ed
dmin
ec
Maximum error-correction
................................
................ .........
......... .......
......
...... ......
.....
..... .....
..... .....
....
.... ....
.... ....
......
.
....
....
.
. ... ...
r...... r ..
...
..
. r .....
..
. ...
... ..
..
....
. ...
. ...
.. ..
..
. r ..
..
.
. t ..
..
..
. ..
...
... r r .....
... ...
... ..
... ..
.. ... r
.. ..
..
. ..
.
. .
.........................r
..................... ... .
......... .........
....... ..... ...
....... r ...
..... ..... ... ....
..... ..... .... ....
..... ..... ... ....
.....
....
..........
.... ..... r ....
.... ..............
........................................
........
.... .... .... ............. .......
.....
.
.... ......
.. .
. . . ..
...............
. .....
.....
... ....... . .
... ......... ............ .....
r......
... ... ............. ..............
...
...
.. .................................... ....... ....
.. .
.. r .. .... r
.
r ..........
..
... ....
.. r ... .... ...
... ..
... ... ...
... . ... ..
.. . ..
.. ... ... ..
... . r .
... ...
... ... . ..
.. t r ... ..
.. ... ..
. ...
.. . . ..
... ... ..
... ... .
.
.. r ..
..
...
... ...
.
. ..
...
t .
.
.
.
.. .. .. .
..
... . .. ..
.. ... ... ..
.. .... . ....
.
.. .. .
..
... ... ... ..
... ... ...
....
.... .... r ..
... r .
.
.
.... r .... .. r ..
.... .
. ..... .. . . .. . ..
.....
......
. .................
... .
.
..
.... .... ..
..... ..... ............ ......... . ..
..... ............. ...... ..... ...
...... ........... ...... .... ...
....
....... ........... ..... ....
.......... ........... ..... .... ....
.............................................................. ......... ....
. .......... .....
.... .... ..... .....
.... r .... ..... .....
.... .... ........ ......
... ......... .......
... ... ................ .........
..
.
..
. .................................
.. ..
..
... ..
.. ...
r
... ..
..
.. r r ..
...
.. ..
..
r ..
. ..
..
.
.
.
.
t ...
.
.
.. ...
..
... ...
..
.
...
...
r ...
. r
.. r ...
..
... ...
..
... ..
... ..
... ..
... ...
.... ...
...
.... ....
....
.... .
......
..... ...
..... .....
...... .....
....... ......
........ .......
............ ........
.. .............
Maximum error-detection
Code Power
Define:
Receiver algorithm
Let e be the number of apparent errors, and R be the received word. Then
e = min dist(R, Ci )
i
To Detect or Correct? I
Theorem.
For a code with minimum distance dmin , the receiving data link agent uses an (ec , ed ) pair that
must satisfy
ec + ed ≤ dmin − 1 (1)
ec ≤ ed (2)
Proof: One can get the intuition by looking at Figure 1 (a) and the receiver error-control
algorithm.
If in a given situation we can correct an error, we must necessarily detect its presence. Hence
ec ≤ ed .
Suppose ec + ed = dmin . This means for the two closest codewords Ci and Cj , there is a
codeword that is ec away from Ci and ed away from Cj . What do we do with this codeword? If
T = Ci , then we are required to correct R to Ci . If T = Cj , we are required to throw this R
Carruthers (ECE @ BU) ECC Spring 2025 13 / 37
Link: Error Control
To Detect or Correct? II
away. The algorithm is written such that we must correct R to Ci . Hence , we cannot guarantee
both conditions for all codewords (refer to the definitions of ec and ed ). So we must have
ec + ed < dmin .
Define:
(ed )max to be the largest possible choice for ed , and
(ec )max to be the largest possible choice for ec .
For example, if dmin = 7, then we can choose the following options:
ec ed
0 6 ⇐ (ed )max = 6
1 5
2 4
3 3 ⇐ (ec )max = 3
Receiver code design
dmin Summary I
(1) Equation (1) says we must tradeoff ec for ed . So we should make ec = 0 in which case
ed = dmin − 1.
(2) We maximize ec by making ec = ed , and so 2ec ≤ dmin − 1 or ec ≤ (dmin − 1)/2. Since ec is
an integer, ec = ⌊(dmin − 1)/2⌋ is the best we can do.
Parity/Repetition Performance
Parity bit codes have a rate k/(k + 1) and dmin = 2. Hence, they allow single-bit error detection
and no error correction.
Repetition by n gives a code with rate 1/n and dmin = n. Hence, it allows n − 1 errors to be
detected OR ⌊(n − 1)/2⌋ errors to be corrected.
Theorem
Single-bit error correction requires the codeword length n to satisfy
(n + 1) ≤ 2n−k . (4)
If n is less than the minimum value satisfying (4), the code is not single-bit error correcting.
Proof: Each codeword requires n + 1 words to itself: the codeword and the n adjacent words.
Hence we must have
2k (n + 1)
codewords, whereas we actually have 2n .
Discussion: 1-bit EC
the above puts a limit on the maximum length of frame we can accommodate for single-bit
error correction
if we increase n, we can eventually satisfy the equation
the condition is necessary but not sufficient
Results:
The results we will derive are summarized in the following table:
Method U Pe
single-bit error detection 0.998 10−9
single-bit error correction 0.990 10−9
rate 1/3 repetition coding 0.333 10−12
Discussion
the rate 1/3 code is inefficient
error detection is 5 times more efficient than error correction in this case, which is a typical
number.
We assume the errors in each bit are independent, and so the number of errors in a block is
binomial with N = 1000, p = 10−6 .
The probability of w errors is
N!
f (w) = pw (1 − p)N −w
w!(N − w)!
which works out to f (0) = 0.999, f (1) = 0.001, f (2) = 10−6.3 ,and f (3) = 10−9.8 .
Single-bit error correction.
Solve (1000 + 1) < 2n−k and get n − k = 10. This assumes we can find such an optimal error
correction code. No retransmissions are used, so U = 990/1000. The residual bit error rate is
which is
N
X
Pe = qf (q)/1000 (5)
q=2
Repetition coding.
Let us approximate to n = 999 and so k = 333. Then U = RC = 1/3. The residual Pe is the
probability that for any of the three copies of any bit transmitted, either 2 of 3 or 3 of 3 are
changed. So Pe = 3 × 10−12 + 10−18 = 3 × 10−12 .
Design Example 1
Design a code from 3-bit codewords with 2 codewords. What is the rate of the code? Which
codewords should you send? What options can be used for error detecting or correcting?
Design Example 2
Design a code using 3-bit codewords with 4 codewords. What is the rate of the code? Which
codewords should you send? What options can be used for error detecting or correcting?
The rate of the code is 2/3. Pick 000 011 101 110 as the codewords.
We have only one sensible option:
1) Decode 000 as 00
Decode 011 as 01
Decode 101 as 10
Decode 110 as 11
retransmit others
CRC Summary
CRC Performance
The common choices for G(x), (such as CRC-16 which is x16 + x15 + x2 + 1) detect
1, 2, or 3 bit errors
any odd number of errors
any burst error if burst length l satisfies l ≤ n − k
most longer burst errors
as long as the message sequence is shorter than 215 bits.
A burst error of length l is any consecutive sequence of bits which are in error.
BCH Codes
A BCH code is a block code with a generator polynomial with a specific design.
BCH code design
choose a minimum distance 2t + 1
choose a block code size n = 2b − 1 for some integer b
then k = n − bt
the generator g(x) is the lowest degree polynomial which has roots α, α2 , . . . , α2t
BCH Notes
Design Example 3
An error control code uses the following set of codewords: 00000, 11100, 11011, and 00111.
(a) What is the rate of the code?
(b) What is the minimum distance of the code?
(c) If the code is used for error detection only, how many bit errors are guaranteed to be
detected?
(d) If the code is used for error correction only, how many bit errors are guaranteed to be
corrected?
(e) Discuss what to do if you receive the word 01010 and you are using the code for error
correction.
DE3 Answers
(a) Two data bits are used to encode these five-bit sequences, so the rate of the code is 2/5.
(b) The minimum distance of the code is 3. Notice that d(00000, 00111) = 3,
d(00000, 11011) = 4, d(00000, 11100) = 3, d(11011, 11100) = 3, d(11011, 00111) = 3, and
d(11100, 00111) = 4.
(c) The code can detect dmin − 1 = 2 bit errors.
(d) The code can correct ⌊(dmin − 1)/2⌋ = 1 bit error. Note that “n + 1 ≤ 2n−k ” is a necessary
but not sufficient condition for single-bit error correction.
(e) 01010 is a Hamming distance 2 away from 00000 and also 2 away from 11011. (it is 3 away
from the other codes). If retransmission is possible one might ask for a retransmission. The
other option is to “correct” to either 00000 or 11011; this gives you a 50% chance of success.