Homework 4

advertisement
Homework 4
Q1) Suppose we want to transmit the message 11001001 and protect it from errors
using the CRC polynomial x3 + 1.
(a) Use polynomial long division to determine the message that should be
transmitted.
Following the book's steps (P.94):
1) Get T(x):
Since M(x) = 11001001 and k = 3, we derive : T(x) = 11001001 000
2) Divide T(x) / C(x):
1101001
------------------------1001 | 11001001 000
---------------1001
----------1011
1001
----------1000
1001
----------1100
1001
----------1010
1001
------------11
<- --- remainder = 011 (CRC code)
:: The message to be sent is : 1101001 011
(b) Suppose the leftmost bit of the message is inverted due to noise on the
transmission link. What is the result of the receiver’s CRC calculation? How
does the receiver know that an error has occurred?
1000001
------------------------1001 | 1001001 011
---------------1001
----------001011
1001
-----------10 <-- remainder is not zero, hence ERROR
Q2) Suppose we want to transmit the message 1011 0010 0100 1011 and protect it
from errors using the CRC-8 polynomial x8 + x2 + x1 + 1.
(a) Use polynomial long division to determine the message that should be
transmitted.
100 100010101001
--------------------------------100000111 | 101100100100101100000000
------------------- 100000111
---------------------110001110
100000111
-------------------100010010
100000111
---------------------101011011
100000111
--------------------101110000
100000111
----------------------111011100
100000111
------------------------110110110
100000111
-------------------------101100010
100000111
----------------------110010100
100000111
------------------------10010011
(b) Suppose the leftmost bit of the message is inverted due to noise on the
transmission link. What is the result of the receiver’s CRC calculation? How does
the receiver know that an error has occurred?
Inverting the first bit gives 0011 0010 0100 1011 1001 0011. Dividing by
1 0000 0111 gives a remainder of 1011 0110.
Q3) The CRC algorithm as presented in this chapter requires lots of bit
manipulations. It is, however, possible to do polynomial long division taking multiple
bits at a time, via a table-driven method, that enables efficient software
implementations of CRC. We outline the strategy here for long division 3 bits at a
time (see Table 2.6); in practice we would divide 8 bits at a time, and the table would
have 256 entries. Let the divisor polynomial C = C(x) be x3 + x2 + 1, or 1101. To build
the table for C, we take each 3-bit sequence, p, append three trailing 0s, and then
find the quotient q = p⌢000÷C, ignoring the remainder. The third column is the
product C × q, the first 3 bits of which should equal p.
(a) Verify, for p = 110, that the quotients p⌢000 ÷ C and p⌢111 ÷ C are the
same; that is, it doesn’t matter what the trailing bits are.
100
-------------------1001 | 110000
---------------1101
-------------100
(b) Fill in the missing entries in the table.
p
010
011
110
111
q=p000/C
011
010
100
101
Cxq
010 111
011 010
110 100
111 001
100
------------------1001 | 110111
---------- 1101
-------------11
(c) Use the table to divide 101 001 011 001 100 by C. Hint: The first 3 bits of the
dividend are p = 101, so from the table the corresponding first 3 bits of the quotient
are q = 110.Write the 110 above the second 3 bits of the dividend, and subtract C×q
= 101 110, again from the table, from the first 6 bits of the dividend. Keep going in
groups of 3 bits. There should be no remainder.
110 101 011 100 000
--------------------------------1101 | 101 001 011 001 100 000
------------- 101 110
-----------------------111 011
111 001
-----------------------010 001
010 111
--------------------110 100
110 100
---------------000 000
000 000
--------------0
Download