16.36: Communication Systems Engineering Lectures 14: Cyclic Codes and error detection Eytan Modiano
16.36: Communication Systems Engineering Lectures 14: Cyclic Codes and error detection Eytan Modiano
Cyclic Codes a cyclic code is a linear block code where if c is a codeword, so are all cyclic shifts of c E.g., 1000, 110, 101,011 is a cyclic code Cyclic codes can be dealt with in the very same way as all other lbc s Generator and parity check matrix can be found a cyclic code can be completely described by a generator string G All codewords are multiples of the generator string In practice, cyclic codes are often used for error detection(CRc) Used for packet networks When an error is detected by the received, it requests retransmission
Cyclic Codes • A cyclic code is a linear block code where if c is a codeword, so are all cyclic shifts of c – E.g., {000,110,101,011} is a cyclic code • Cyclic codes can be dealt with in the very same way as all other LBC’s – Generator and parity check matrix can be found • A cyclic code can be completely described by a generator string G – All codewords are multiples of the generator string • In practice, cyclic codes are often used for error detection (CRC) – Used for packet networks – When an error is detected by the received, it requests retransmission
Error detection techniques Used by the receiver to determine if a packet contains errors If a packet is found to contain errors the receiver requests the transmitter to re-send the packet Error detection techniques Parity check E.g, single bit Cyclic redundancy check(CRC)
Error detection techniques • Used by the receiver to determine if a packet contains errors • If a packet is found to contain errors the receiver requests the transmitter to re-send the packet • Error detection techniques – Parity check E.g., single bit – Cyclic redundancy check (CRC)
Parity check codes k Data bits r Check bits Each parity check is a modulo 2 sum of some of the data bits Example: X1 +++ t x t x
Parity check codes k Data bits r Check bits • Each parity check is a modulo 2 sum of some of the data bits Example: c1 = x1 + x 2 + x3 c 2 = x 2 + x 3 + x4 c 3 = x1 + x 2 + x4
Single Parity Check Code The check bit is 1 if frame contains odd number of 1s otherwise it is o 1011011->10110111 1100110->11001100 Thus, encoded frame contains even number of 1's Receiver counts number of ones in frame An even number of 1s is interpreted as no errors An odd number of 1's means that an error must have occured a single error ( or an odd number of errors)can be detected An even number of errors cannot be detected Nothing can be corrected Probability of undetected error(independent errors) N acket size i even p=error prob
Single Parity Check Code • The check bit is 1 if frame contains odd number of 1's; otherwise it is 0 1011011 -> 1011011 1 1100110 -> 1100110 0 • Thus, encoded frame contains even number of 1's • Receiver counts number of ones in frame – An even number of 1’s is interpreted as no errors – An odd number of 1’s means that an error must have occured A single error (or an odd number of errors) can be detected An even number of errors cannot be detected Nothing can be corrected • Probability of undetected error (independent errors) P u ndet ected) = ∑ N pi (1 − p ) N −i N = packet size ( i even i p = error prob