Error Control‎ > ‎

Error Detection

Many methods have been created to detect errors. The one chosen to be used depends on the data being sent (or stored) and the nature of the channel, and its error proneness, being used. Listed below are some well-known methods. Refer to the appropriate Wikipedia page for further information.

Repetition codes 

This where the data bits being sent are split into groups and these groups are sent repeatedly. Errors can generally be detected For example, sending the letter A, ASCII binary pattern 1000001, three times would result in a transmission of 1000001 1000001 1000001. A corruption in one of these patterns to say 1100001 could be detected by comparing this to the other two. This method is simple, but takes more bandwidth (because there is three times the data) and can not discover all types of errors e.g. the same error occurring in the same place in all three groups.

Parity Bits


A parity bit is a 1 or 0 added to the end of a sequence of bits when it is sent (see the graphic above). The whole bit pattern can be examined at the receiving end to see if an error has occurred. There are two parity schemes: even and odd parity. Even parity counts up the number of ones present and adds a 1 to the (right-hand) end if the number is odd. This makes the total number of ones even. Odd parity counts up the number of ones present and adds a 1 to the end if the number is even. This makes the total number of ones odd. 

For example, using even parity and the capital A, bit pattern 1000001:
Total ones = 2, add a 0 because 2 + 0 = 2 = an even number.
Therefore transmit 10000010

At the receiving end the total number of ones (including the parity bit) can be added to get 2 and as this even, and the 0 value for the parity bit says there should be an even number, the data should be correct.

Using odd parity and the capital A, bit pattern 1000001:
Total ones = 2, add a 1 because 2 + 1 = 3 = an odd number.
Therefore transmit 10000011

At the receiving end the total number of ones (including the parity bit) can be added to get 3 and as this odd, and the 1 value for the parity bit says there should be an odd number, the data should be correct.

The even parity bit scheme can detect odd numbers of errors i.e. 1, 3, 5, but not even numbers. For example, say the letter A was transmitted using even parity as the sequence 10000010 and received as 11000011. There are two errors, one being the parity bit. Using the parity method we add up the number of ones and get 4. This is even and as we are using even parity we conclude that no error has occurred.

Parity bit error control systems are used on multi-disk file servers in the form of a RAID (Redundant Array of Inexpensive Disks) system. There are several versions of RAID, but the overall idea is to spread data (or the bit values that make up the data), including parity bits, across multiple disks so that if one disk fails it can be replaced and the failed disk's data can be rebuilt from the remaining data and the parity bit values. For more information click on this link: Fujitsu RAID systems

This link points to an activity that shows how parity bits work - Error detection

Note: Modern RAM chips generally do not have parity checking built in. However some use another sort of error detection and correction called ECC. This is short for Error Correction Code. Read this page for more information: Tech Term -  ECC.


Check digits

From the Wikipedia page on check digits A check digit "consists of a single digit computed from the other digits in the message. With a check digit, one can detect simple errors in the input of a series of digits, such as a single mistyped digit or some permutations of two successive digits."
Also,
"The two most common errors in handling an ISBN (e.g., typing or writing it) are an altered digit or the transposition (swapping) of adjacent digits. The ISBN check digit method ensures that these two errors will always be detected. However, if the error occurs in the publishing house and goes undetected, the book will be issued with an invalid ISBN."

Check digits are combined to catch human errors made when entering numbers. For example swapping numbers: 123 -> 213. Well known check digit systems are UPC (Universal Product Code) and ISBN (International Standard Book Number, versions 10 and 13). ISBN-10 uses 10 digits (including the check digit). ISBN-13 use 13 digits. It superseded ISBN-10 in 2007. Below is how to calculate the check digit using the ISBN-13 system:

  1. Add up the digits in the even-numbered positions (second, fourth, etc.) and multiply the total by three.
  2. Add the digits in the odd-numbered positions (first, third etc.) to the result.
  3. Take the remainder of the result divided by 10 (modulo operation) and subtract this from 10 to derive the check digit.
  4. If the remainder is 10 then use 0 as the check digit.

Note: steps 1 and 2 can be done in one go by multiplying by 1 and then 3 repeatedly, like below.


The ISBN-13 check digit of 978-0-306-40615-? is calculated as follows:
s = 9×1 + 7×3 + 8×1 + 0×3 + 3×1 + 0×3 + 6×1 + 4×3 + 0×1 + 6×3 + 1×1 + 5×3
= 9 + 21 + 8 + 0 + 3 + 0 + 6 + 12 + 0 + 18 + 1 + 15
= 93
93 / 10 = 9 remainder 3
10 – 3 = 7

Thus, the check digit is 7, and the complete sequence is ISBN 978-0-306-40615-7.
From the Wikipedia page on ISBN-13.


Note: The CS Unplugged activity on Error correction contains information on ISBN-10.

 

Checksums

A checksum is a "fixed size" piece of data computed from an "arbitrary block of digital data" (e.g. a file) using a special method or function. At any time a new checksum can be computed using the data and compared to the original one. If the two checksums differ then the two data sources are not a match. Below is a screenshot of download page that has a zip file checksum created using the SHA1 function. This is what is known as a one way function, meaning that there is no other function that can take information encrypted by it and reverse the encryption to produce the original data. SHA1 always produces a 40 character long alphanumeric character string, no matter what the length of the data input is.

The down loader could use the function on the downloaded file to see if the computed checksum and the one on the web page match. The coloured squares graphic is a new type of 2D barcode called QR. Click on this link to go to a QR code generator: Kaywa QR-Code

  
Link to Wikipedia information on SHA1: http://en.wikipedia.org/wiki/SHA-1#Official_validation

 













Comments