6.Data link layer_2
6.Data link layer_2
NETWORKS
Lec. Onim
EECE, MIST
Outline:
• The parity bit is chosen so that the number of 1 bits in the codeword is even or
odd.
• Doing this is equivalent to computing the (even or odd) parity bit as the modulo
2 sum or XOR of the data bits.
• For example, when 1011010 is sent in even parity, a bit is added to the end to
make it 10110100.
• With odd parity 1011010 becomes 10110101.
• Since any single-bit error produces a codeword with the wrong parity, This
means that it can detect single-bit errors
Table for 4 bit parity code:
Working Block Diagram:
Syndrome ‘0’ will indicate no detectable error and ‘1’ will indicate error and the decision logic will discard the data
Detecting Burst Error with Parity:
• Compute a parity bit for each of the n columns and send all the
data bits as k rows, sending the rows from top to bottom and the
• In cyclic codes a codeword is cyclically shifted (rotated), the result is another codeword.
• For example, if 1011000 is a codeword and we cyclically left-shift, then 0110001 is also a codeword.
• Used in networks such as LANs and WANs.
• In the encoder, the dataword has k bits; the codeword has n bits and is written as C(n, k) code.
• The generator uses a divisor of size n − k + 1, predefined and agreed upon.
• The remainder produced by the checker is a syndrome of n − k bits, which is fed to the decision logic analyzer.
• If the syndrome bits are all 0s, intercepted as no error.
Example:
CRC Polynomials:
Degree of a Polynomial
o The degree of a polynomial is the highest power in the polynomial
o For example, the degree of the polynomial 𝑥 6 + 𝑥 + 1 is 6.
Adding and Subtracting Polynomials
o Adding or subtracting the coefficients of terms with the same power
o For example, adding 𝑥 5 + 𝑥 4 + 𝑥 2 and 𝑥 6 + 𝑥 4 + 𝑥 2 gives just 𝑥 6 + 𝑥 5
Multiplying or Dividing Terms
o Multiplying a term by another term is very simple; we just add the Powers; For example, 𝑥 3 × 𝑥 4 is x7.
o For dividing, we just subtract the power of the second term from the power of the first. For example,
𝑥 5 ÷ 𝑥 2 is 𝑥 3
Shifting
o Shifting to the left means adding extra 0s as rightmost bits; shifting to the right means deleting some
rightmost bits
o Shifting to the left is accomplished by multiplying each term of the polynomial by 𝑥 𝑚 , where m is the
number of shifted bits; shifting to the right is accomplished by dividing each term of the polynomial by
𝑥 𝑚.
Example: