CRC 6
CRC 6
header service data unit trailer header service data unit trailer
frame frame
1
Single Parity Checks Two Dimensional Parity
Parity
bits
• Technically used for 1 bit error detection. Can also 0101001 1
detect any odd number of bit errors.
1101001 0
• Involves adding an extra “parity” bit to the bit string
• Two varieties: 1011110 1
– Even Parity Data
0001110 1
– Odd Parity
• Basic Idea: 0110100 1
– For even parity, make the total number of 1’s in the bit string 1011111 0
an even number. This mechanism decides the value of the
parity bit. Odd parity makes the number of 1”s odd instead of Parity
even. 1111011 0
byte
• Single Parity cannot detect burst errors
– Burst errors cause errors in a sub-string of arbitrary length
• Each byte is protected by a parity bit
– A burst error is as likely to cause an even number of errors
as an odd number of errors • The entire frame is protected by a parity
byte
• Calculating CRC • Multiply M(x) by xk, i.e. add k zeroes to the end of
– Sender and transmitter choose a divisor polynomial of
the message. Call this T(x)
degree k. e.g x3 + x2 + 1. Call this C(x) • Divide T(x) by C(x).
– Add k bits to the (n+1) bit message such that the • Subtract the remainder from T(x)
n+1+k bit message is exactly divisible by the divisor
• Choice of divisor is very important. • The result is the message including the CRC
– It determines the kind of errors that the CRC can guard
against.
2
CRC Computation
Generator
11111001
Message
CRC Codes
1101 10011010000
1101
1001 • Note: The CRC is computed over the entire
1101
1000 message, not a byte or a row/column.
1101
• When a message+CRC arrives at the
1011
1101 destination, divide it by the generator
1100 polynomial. If the remainder is 0, the
1101
message is intact, else it has been corrupted.
1000
1101 – The bit pattern that can cause a CRC code to fail
101 Remainder is not a regular pattern such a random error or
burst errors. That’s why CRCs are strong.
• C(x) = x3 + x2 + 1 – Try out an example, where you try corrupting the
• M(x) = x7 + x4 + x3 + x CRC in the previous slide
• Subtraction: logical XOR operation