Cosc 2150: Computer Organization

Slides:



Advertisements
Similar presentations
Noise, Information Theory, and Entropy (cont.) CS414 – Spring 2007 By Karrie Karahalios, Roger Cheng, Brian Bailey.
Advertisements

Cyclic Code.
Review of HTML Ch. 1.
Ch 2.7 Error Detection & Correction CS-147 Tu Hoang.
Data Representation in Computer Systems
Chapter 10 Error Detection and Correction
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Using Binary Coding Information Remember  Bit = 0 or 1, Binary Digit  Byte = the number of bits used to represent letters, numbers and special characters.
Data Representation in Computer Systems
PART III DATA LINK LAYER. Position of the Data-Link Layer.
Using Binary Coding Information Remember  Bit = 0 or 1, Binary Digit  Byte = the number of bits used to represent letters, numbers and special characters.
Error detection and correction
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.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Error Detection and Correction
Data Representation in Computer Systems Chapter 2.
9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU1 Codes.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Data Representation in Computer Systems
Lecture 6 Topics Character codes Error Detection and Correction
Binary Numbers and ASCII and EDCDIC Mrs. Cueni. Data Representation  Human speech is analog because it uses continuous signals (waves) that vary in strength.
Data Representation in Computer Systems Chapter 2.
It is physically impossible for any data recording or transmission medium to be 100% perfect 100% of the time over its entire expected useful life. As.
Digital Logic Lecture 4 Binary Codes The Hashemite University Computer Engineering Department.
Chapter 2 Data Representation in Computer Systems.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
1 INFORMATION IN DIGITAL DEVICES. 2 Digital Devices Most computers today are composed of digital devices. –Process electrical signals. –Can only have.
CS151 Introduction to Digital Design
PART III DATA LINK LAYER. Position of the Data-Link Layer.
British Computer Society
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data Link Layer: Error Detection and Correction
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.
Unit 5 Lecture 2 Error Control Error Detection & Error Correction.
Error Detection and Correction
PREPARED BY: ENGR. JO-ANN C. VIÑAS
Data Representation, Number Systems and Base Conversions
David Wetherall Professor of Computer Science & Engineering Introduction to Computer Networks Error Detection (§3.2.2)
Error Detection and Correction
1 © Unitec New Zealand CRC calculation and Hammings code.
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.
Error Detection and Correction – Hamming Code
Error Detection and Correction
Data Representation in Computer Systems Chapter 2.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Hamming Distance & Hamming Code
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.
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
ERROR DETECTION AND CORRECTION Chapter 8 Data Communications & Networking ERROR DETECTION AND CORRECTION Chapter 8 First Semester 2007/2008.
Chapter Nine: Data Transmission. Introduction Binary data is transmitted by either by serial or parallel methods Data transmission over long distances.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Lecture Coding Schemes. Representing Data English language uses 26 symbols to represent an idea Different sets of bit patterns have been designed to represent.
2.8 Error Detection and Correction
Error Detection & Correction
CIS 321 Data Communications & Networking
Error Detection and Correction
Part III Datalink Layer 10.
Data Representation in Computer Systems
Data Representation in Computer Systems
Dr. Clincy Professor of CS
Fundamentals of Data Representation
Dr. Clincy Professor of CS
Chapter Nine: Data Transmission
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Error Detection and Correction
Error Detection and Correction
2.8 Error Detection and Correction
Presentation transcript:

Cosc 2150: Computer Organization Chapter 2, Part 4 Character representation and Error Detection and Correction

Character Codes Calculations aren’t useful until their results can be displayed in a manner that is meaningful to people. We also need to store the results of calculations, and provide a means for data input. Thus, human-understandable characters must be converted to computer-understandable bit patterns using some sort of character encoding scheme.

Character Codes As computers have evolved, character codes have evolved. Larger computer memories and storage devices permit richer character codes. The earliest computer coding systems used six bits. Binary-coded decimal (BCD) was one of these early codes. It was used by IBM mainframes in the 1950s and 1960s.

Character Codes In 1964, BCD was extended to an 8-bit code, Extended Binary-Coded Decimal Interchange Code (EBCDIC). EBCDIC was one of the first widely-used computer codes that supported upper and lowercase alphabetic characters, in addition to special characters, such as punctuation and control characters. EBCDIC and BCD are still in use by IBM mainframes today.

Character Codes Other computer manufacturers chose the 7-bit ASCII (American Standard Code for Information Interchange) as a replacement for 6-bit codes. While BCD and EBCDIC were based upon punched card codes, ASCII was based upon telecommunications (Telex) codes. Until recently, ASCII was the dominant character code outside the IBM mainframe world.

Character Codes Many of today’s systems embrace Unicode, a 16-bit system that can encode the characters of every language in the world. The Java programming language, and some operating systems now use Unicode as their default character code. The Unicode codespace is divided into six parts. The first part is for Western alphabet codes, including English, Greek, and Russian.

Character Codes The Unicode codes- pace allocation is shown at the right. The lowest-numbered Unicode characters comprise the ASCII code. The highest provide for user-defined codes.

Error Detection and Correction It is physically impossible for any data recording or transmission medium to be 100% perfect 100% of the time over its entire expected useful life. As more bits are packed onto a square centimeter of disk storage, as communications transmission speeds increase, the likelihood of error increases-- sometimes geometrically. Error detection and correction is critical to accurate data transmission, storage and retrieval.

Error Detection and Correction Check digits, appended to the end of a long number, can provide some protection against data input errors. The last characters of UPC barcodes and ISBNs are check digits. Longer data streams require more economical and sophisticated error detection mechanisms. Cyclic redundancy checking (CRC) codes provide error detection for large blocks of data.

Detection and Correction Checksums and CRCs are examples of systematic error detection. In systematic error detection a group of error control bits is appended to the end of the block of transmitted data. This group of bits is called a syndrome. CRCs are polynomials over the modulo 2 arithmetic field. The mathematical theory behind modulo 2 polynomials is beyond our scope. However, we can easily work with it without knowing its theoretical underpinnings.

Error Detection and Correction Data transmission errors are easy to fix once an error is detected. Just ask the sender to transmit the data again. In computer memory and data storage, however, this cannot be done. Too often the only copy of something important is in memory or on disk. Thus, to provide data integrity over the long term, error correcting codes are required.

Error Detection and Correction Hamming codes and Reed-Solomon codes are two important error correcting codes. Reed-Solomon codes are particularly useful in correcting burst errors that occur when a series of adjacent bits are damaged. Because CD-ROMs are easily scratched, they employ a type of Reed-Solomon error correction. Because the mathematics of Hamming codes is much simpler than Reed-Solomon, we discuss Hamming codes in detail.

Error Detection and Correction Hamming codes are code words formed by adding redundant check bits, or parity bits, to a data word. The Hamming distance between two code words is the number of bits in which two code words differ. The minimum Hamming distance for a code is the smallest Hamming distance between all pairs of words in the code. This pair of bytes has a Hamming distance of 3:

Error Detection and Correction Skipping over all the math, which is shown in the text book. To detect and correct an error in 1 bit (with 8 bits), We need 12 bits So build a code with 8-bit data words that will correct a single-bit error, we must add 4 check bits, creating code words of length 12. So how do we assign values to these check bits? Finding the number of check bits is the hard part (which is also was skipped). The rest is easy.

Error Detection and Correction With code words of length 12, we observe that each of the bits, numbered 1 though 12, can be expressed in powers of 2. Thus: 1 = 2 0 5 = 2 2 + 2 0 9 = 2 3 + 2 0 2 = 2 1 6 = 2 2 + 2 1 10 = 2 3 + 2 1 3 = 2 1 + 2 0 7 = 2 2 + 2 1 + 2 0 11 = 2 3 + 2 1 + 2 0 4 = 2 2 8 = 2 3 12 = 2 3 + 2 2 1 (= 20) contributes to all of the odd-numbered digits. 2 (= 21) contributes to the digits, 2, 3, 6, 7, 10, and 11. . . . And so forth . . . We can use this idea in the creation of our check bits.

Error Detection and Correction Using our code words of length 12, number each bit position starting with 1 in the low-order bit. Each bit position corresponding to a power of 2 will be occupied by a check bit. These check bits contain the parity of each bit position for which it participates in the sum.

Error Detection and Correction Since 1 (=20) contributes to position 3 , 5, 7, 9, and 11, bit 1 will check parity over bits in these positions. Since 2 (= 21) contributes to position 3, 6, 7, 10, and 11, bit 2 will check parity over these bits. For the word 11010110 (base10=214), assuming even parity (values: even 0 and odd 1), we have a value of 1 for check bit 1, and a value of 0 for check bit 2. What are the values for the other parity bits?

Error Detection and Correction The completed code word is shown above. Bit 1 checks the bits 3, 5, 7, 9, and 11, so its value is 1 to ensure even parity within this group. Bit 2 checks the bits 3, 6, 7, 10, and 11, so its value is 0 Bit 4 checks the bits 5, 6, 7, and 12, so its value is 1. Bit 8 checks the bits 9, 10, 11, and 12, so its value is also 1. Using the Hamming algorithm, we can not only detect single bit errors in this code word, but also correct them!

Error Detection and Correction Suppose an error occurs in bit 5, as shown above. Our parity bit values are: Bit 1 checks 3, 5, 7, 9, and 11. This is incorrect as we have a total of 2 ones (even would be 0). Bit 2 checks bits 3, 6, 7, 10, and 11. The parity is correct. Bit 4 checks bits 5, 6, 7, and 12. This parity is incorrect, as we 2 ones. Bit 8 checks bit 9, 10, 11, and 12. This parity is correct.

Error Detection and Correction We have erroneous parity for check bits 1 and 4. With two parity bits that don’t check, we know that the error is in the data, and not in a parity bit. Which data bits are in error? We find out by adding the bit positions of the erroneous bits. Simply, 1 + 4 = 5. This tells us that the error is in bit 5. If we change bit 5 to a 1, all parity bits check and our data is restored.

Q A &