11.07.2015 Views

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

186 error correctionSalvendy, Gavriel. H<strong>and</strong>book <strong>of</strong> Human Factors <strong>and</strong> Ergonomics. 3rded. New York: Wiley, 2006.U.S. Department <strong>of</strong> Labor. Occupational Safety & Health Administration.“<strong>Computer</strong> Workstations.” Available online. URL:http://www.osha.gov/SLTC/etools/computerworkstations/index.html. Accessed July 30, 2007.Vredenberg, Karel, Scott Isensee, <strong>and</strong> Carol Righi. User-CenteredDesign: an Integrated Approach. Upper Saddle River, N.J.:Prentice Hall, 2001.For even parity, if the number <strong>of</strong> ones in the byte is odd, the paritybit is set to one to make the total number <strong>of</strong> ones even. Odd paritywould work the same way, except the parity bit would be set whennecessary to ensure an odd number <strong>of</strong> ones.error correctionTransmitting data involves the sending <strong>of</strong> bits (ones <strong>and</strong>zeros) as signaled by some alternation in physical characteristics(such as voltage or frequency). There are a number<strong>of</strong> ways in which errors can be introduced into the datastream. For example, electrical “noise” in the line might beinterpreted as spurious bits, or a bit might be “flipped” fromone to zero or vice versa. Generally speaking, the faster therates at which bits are being sent, the more sensitive thetransmission is to effects that can cause errors.While a few wrong characters might be tolerated insome text messages or graphics files, binary files representingexecutable programs must generally be received perfectly,since r<strong>and</strong>om changes can make programs fail orproduce incorrect results. Data communications engineershave devised a number <strong>of</strong> methods for checking the accuracy<strong>of</strong> data transmissions.The simplest scheme is called parity. A single bit isadded to each eight-bit byte <strong>of</strong> data. In even parity, theextra (parity) bit is set to one when the number <strong>of</strong> ones inthe byte is odd. In odd parity, a one is added if the data bytehas an even number <strong>of</strong> ones. This means that the receiver <strong>of</strong>the data can expect it to be even or odd respectively. Whenthe byte arrives at its destination, the receiving programchecks the parity bit <strong>and</strong> then counts the number <strong>of</strong> onesin the rest <strong>of</strong> the byte. If, for example, the parity is evenbut the data as received has an odd number <strong>of</strong> ones, thenat least one <strong>of</strong> the bits must have been changed in error.Parity is a fast, easy way to check for errors, but it has someunreliability. For example, if there were two errors in transmissionsuch that a one became a zero <strong>and</strong> a different zerobecame a one, the parity would be unchanged <strong>and</strong> the errorwould not be detected.The checksum method <strong>of</strong>fers greater reliability. Thebinary value <strong>of</strong> each block <strong>of</strong> data is added <strong>and</strong> the sumis sent along with the block. At the destination, the bits inthe block are again added to see if they still match the sum.A variation, the cyclical redundancy check or CRC, breaksthe data into blocks <strong>and</strong> divides them by a fixed number.The remainder for the division for each block is appendedto the block <strong>and</strong> the calculation is repeated <strong>and</strong> checked atthe destination. Today most modem control s<strong>of</strong>tware implementsparity or CRC checking.A more sophisticated method called the Hamming Code<strong>of</strong>fers not only high reliability but also the ability to automaticallycorrect errors. In this scheme the data <strong>and</strong> checkbits are encrypted together to create a code word. If theword received is not a valid code word, the receiver can usea series <strong>of</strong> parity checks to find the original error. Increasingthe ratio <strong>of</strong> redundant check bits to message bits improvesthe reliability <strong>of</strong> the code, but at the expense <strong>of</strong> having todo more processing to encrypt that data <strong>and</strong> requiring moretime to transmit it.Further Reading“Error-Correcting Code.” Wolfram MathWorld. Available online.URL: http://mathworld.wolfram.com/Error-CorrectingCode.html. Accessed July 31, 2007.Fung, Francis Yein Chei. “A Survey <strong>of</strong> the Theory <strong>of</strong> Error-CorrectingCodes.” Available online. URL: http://cadigweb.ew.usna.edu/~wdj/teach/ecc/codes.html. Accessed July 31, 2007.Wicker, S. B. Error Control Systems for Digital Communication <strong>and</strong>Storage. Upper Saddle River, N.J.: Prentice Hall, 1995.error h<strong>and</strong>lingAn important characteristic <strong>of</strong> quality s<strong>of</strong>tware is its abilityto h<strong>and</strong>le errors that arise in processing (also calledrun-time errors or “exceptions”). Before it is released forgeneral use, a program should be thoroughly tested witha variety <strong>of</strong> input (see quality assurance, s<strong>of</strong>tware).When errors are found, the soundness <strong>of</strong> the algorithm <strong>and</strong>its implementation must be checked, as well as the programlogic (see algorithm). Interaction between the program<strong>and</strong> other programs (including the operating system) aswell as with hardware must also be considered. (See bugs<strong>and</strong> debugging.)However, even well-tested s<strong>of</strong>tware is likely to encountererrors. Therefore a program intended for widespread usemust include instructions for dealing with errors, anticipatedor otherwise. The process <strong>of</strong> error h<strong>and</strong>ling can bedivided into four stages: validation, detection, communication,<strong>and</strong> amelioration.Data validation is the first line <strong>of</strong> defense. At the “frontend” <strong>of</strong> the program, data being entered by a user (or readfrom a disk file or communications link) is checked to seewhether it falls within the prescribed parameters. (In thecase <strong>of</strong> a program such as a data management system, theuser interface plays an important role. Data input fieldscan be designed so that they accept only valid characters.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!