Computer Architecture and Assembly Language

Slides:



Advertisements
Similar presentations
Applied Algorithmics - week7
Advertisements

10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction to Information Technologies
PART III DATA LINK LAYER. Position of the Data-Link Layer.
Practical Session 11 Codes. Hamming Distance General case: The distance between two code words is the amount of 1-bit changes required to reach from one.
Error detection and correction
Data Communications Chapter 7 Error Detection. Despite the best prevention techniques, errors may still happen. To detect an error, something extra has.
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
Unit 1 Protocols Learning Objectives: Understand the need to detect and correct errors in data transmission.
Chapter 10 Error Detection and Correction
Rutvi Shah1 ERROR CORRECTION & ERROR DETECTION Rutvi Shah2 Data can be corrupted during transmission. For reliable communication, errors must be detected.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
British Computer Society
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
جلسه هشتم شبکه های کامپیوتری به نــــــــــــام خدا.
Data and Computer Communications by William Stallings Eighth Edition Digital Data Communications Techniques Digital Data Communications Techniques Click.
Practical Session 10 Error Detecting and Correcting Codes.
Computer Science Division
1 © Unitec New Zealand CRC calculation and Hammings code.
Error Detection.
Error Detection. Data can be corrupted during transmission. Some applications require that errors be detected and corrected. An error-detecting code can.
Error Detection and Correction
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
Transmission Errors Error Detection and Correction.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Network Layer4-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
Practical Session 10 Computer Architecture and Assembly Language.
parity bit is 1: data should have an odd number of 1's
Dr. Clincy Professor of CS
Error Detection and Correction
Modulo-2 Digital coding uses modulo-2 arithmetic where addition becomes the following operations: 0+0= =0 0+1= =1 It performs the.
2.8 Error Detection and Correction
Computer Architecture and Assembly Language
Introduction to Information Technologies
ERROR DETECTION AND CORRECTION
Data Link Layer.
Error Detection and Correction
Cyclic Redundancy Check (CRC)
Communication Networks: Technology & Protocols
DATA COMMUNICATION AND NETWORKINGS
Dr. Clincy Professor of CS
Advanced Computer Networks
CIS 321 Data Communications & Networking
Error Detection and Correction
Part III Datalink Layer 10.
EEC4113 Data Communication & Multimedia System Chapter 5: Error Control by Muhazam Mustapha, August 2010.
Packetizing Error Detection
Packetizing Error Detection
Basic concepts Networks must be able to transfer data from one device to another with complete accuracy. Data can be corrupted during transmission. For.
Chapter 7 Error Detection and Correction
EEC-484/584 Computer Networks
Introduction to Information Technologies
Transmission Errors Error Detection and Correction
Error Detection Neil Tang 9/26/2008
Packetizing Error Detection
EEC-484/584 Computer Networks
COMPUTER NETWORKS CS610 Lecture-5 Hammad Khalid Khan.
Chapter 9 Error Detection and Correction
Error Detection and Correction
Error Detection and Correction
Reliability and Channel Coding
Error Detection and Correction
Transmission Errors Error Detection and Correction
parity bit is 1: data should have an odd number of 1's
Types of Errors Data transmission suffers unpredictable changes because of interference The interference can change the shape of the signal Single-bit.
Error Detection and Correction
2.8 Error Detection and Correction
Data Link Layer. Position of the data-link layer.
Presentation transcript:

Computer Architecture and Assembly Language Practical Session 10

Error detection and correction data transmission via communication channels channel noise  errors may happen we need techniques that enable reliable delivery of digital data over unreliable communication channels general idea: add some redundancy (extra data) to a message this extra data is used to check consistency of the delivered message to recover data determined to be corrupted 

Hamming Distance Hamming distance (d) between two code words of equal length is an amount of 1-bit changes required to reach from one word to the other (number of 1’s in the XOR between the words) 000 011 d(000, 011) = 2 10101 11110 d(10101, 11110) = 3 Minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words. Example: Given the following coding scheme, let’s find the minimum Hamming distance. 00000 01011 10101 11110 d(00000,01011)=3 d(00000,10101)=3 d(00000,11110)=4 d(01011,10101)=4 d(01011,11110)=3 d(10101,11110)=3 d=3

Minimum Hamming Distance d can detect d-1 errors Example: 00000 01011 10101 11110 3 errors can take us from one legal code word to another can detect at least 3-1=2 errors d=3 01011 00000 01000 01010 01011 Minimum Hamming Distance d can fix d-1 erasures 3 erasures can take us from one legal code word to another can detect at least 3-1=2 erasures 01011 00000 0_000 0_0_0 0_0__ Minimum Hamming Distance d can fix errors 2 errors can take us from two different legal code words to the same illegal word 00000 01000 01010 can fix at least floor((3-1)/2)=1 error 11110 01110

Answer: yes. We need a hamming distance d=3 to fix 1 error. Given four data words, can we use 5-bit code words for fixing 1 error? Answer: yes. We need a hamming distance d=3 to fix 1 error. 00000 11100 10111 01011 d(00000,11100)=3 d(11100, 10111)=3 d(00000,10111)=4 d(11100, 01011)=4 d(00000,01011)=3 d(10111, 01011)=3 We can create code words with independent graphs of a single error code words. 00000 00001 00010 00100 01000 10000 11100 11000 10100 01100 11110 11101 10111 10110 10101 10011 11111 00111 01011 01010 01001 01111 00011 11011

Parity Check Given a data word, a code word is created by adding a parity bit to the end of the data word d=2 (why?) Can detect 1 error and fix 1 erasure Code word Data word 00000 0000 00011 0001 00101 0010 00110 0011 0001 1 send: 0011 1 00_1 1 receive: 1 error occurs erased bit is a parity of other bits: parity (0011) = 1

Hamming Code (4,3) We assume that there may be at most one error. if p0 is wrong, we get p2 p1 p0 =√√x = 001b = 1 p0 should be at index 1 if p1 is wrong, we get p1 p1 p0 =√x√ = 010b = 2 p1 should be at index 2 if p2 is wrong, we get p2 p1 p0 =x√√ = 100b = 4 p2 should be at index 4 if x0 is wrong, we get p2 p1 p0 =√xx = 011b = 3 x0 should be at index 3 … if x3 is wrong, we get p2 p1 p0 =xxx = 111b = 7 x3 should be at index 7 We assume that there may be at most one error. indexes: 7 6 5 4 3 2 1 code word: 4 data bits: x0 x1 x2 x3 3 parity bits: p0 p1 p2 We calculate: why we interleave bits of data and parity in this way ? Example: We got 0100111 Sender sent 0000111 p0 = 1 = x3 ⊕x1 ⊕x0 = 0 ⊕ 0 ⊕ 1 = 1  √ p1 = 1 = x3 ⊕x2 ⊕x0 = 0 ⊕ 1 ⊕ 1 = 0  x p2 = 0 = x3 ⊕x2 ⊕x1 = 0 ⊕ 1 ⊕ 0 = 1  x p2 p1 p0 =xx√ = 110b = 6  The error bit is at index 6 (from right to left) in the code word  error bit is x2

Cyclic Redundancy Check CRC is an error-detecting code Given a data, its non trivial (cryptographic) challenge to find another data with the same CRC code.  CRC can protect data (even from deliberate damage) Explanation is needed

Binary Pattern as Polynomial

CRC Polynomials (common) CRC-8-ATM x8 + x2 + x + 1 CRC-16-IBM x16 + x15 + x2 + 1 CRC-16-CCITT x16 + x12 + x5 + 1 CRC-32-IEEE 802.3 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 which one is used when?

Sending – Calculation Steps Generator is chosen sequence of bits, of which the first and last are 1 CRC check sequence is computed by long-division of message by generator check sequence has 1 fewer bits than generator Check sequence is appended to the original message

Sending – Calculation Steps Compute 8-bit CRC a message ‘W’ (0x57). Select Generator: CRC-8-ATM x8 + x2 + x + 1 = 100000111 ‘W’ is 01010111= x6 + x4 + x2 + x + 1 Extend ‘W’ with 8 bits: 0101011100000000 Perform XOR of the word get in step (3) by generator CRC code is the remainder Append CRC code to ‘W’

Generating CRC Code long-division of message by generator 0101011100000000 100000111 Each time apply XOR on the extended message, when place a generator from the left-most ‘1’ bit of the extended message xor 100000111 001011011000000 xor 100000111 0011010110000 xor 100000111 01010101100 xor 100000111 0010100010 Stop when CRC code has 1 fewer bits than generator CRC Code: 10100010

Receiving – Calculation Steps Append CRC code to the message: 0101011110100010 Perform long division by the generator If the reminder is not 0: an error occurred 0101011110100010 100000111 xor only a single error occurred? why? 100000111 There is no errors in received message. result: 00000000