Presentation is loading. Please wait.

Presentation is loading. Please wait.

Representing characters

Similar presentations


Presentation on theme: "Representing characters"— Presentation transcript:

1 Representing characters

2 Representing characters
Characters include 0, 1, 2, a, b, c, &, :, ) etc. Encode each character by an integer code number Numeric character code values specified by ASCII American Standard Code for Information Interchange

3 ASCII Character Code Table
Table from Tim's Amstrad NC Users' Site:

4 Error Correction & Parity Bits
Play “magic trick” using a 6 x 6 grid of cards Student lays out 5 x 5 grid with each card face up or down Add sixth row and column to make the trick “harder” Ask student to flip one card while back is turned Use even parity to identify the erroneous bit From “Computer Science Unplugged” © Bell, Witten, and Fellows, 1998 Page 33

5 Error Detection & Parity Bits
Computers routinely transmit data (in binary form) Transmission errors may occur causing bit(s) to be changed Add an extra bit the so-called parity bit to a bit string Choose the parity bit so that the number of 1’s is even Transmit the data If the number of 1’s in the received bit string is odd, then an error occurred and we must re-transmit that chunk of data

6 Error Detection & Parity Bits: Example
Transmit 8-data bits: Apply even parity bit before transmission: If we receive: We detect an error by noting that the number of 1’s is odd Note: You could also implement an odd parity method in which the parity bit is set so the number of 1’s is odd

7 Experimenting with Parity Bits
Transmit 8-data bits: Apply even parity bit before transmission: What happens if two bits are inverted due to a transmission error? Answer: The parity would be even so no error would be detected

8 Experimenting with Parity Bits
Reconsider the 6 x 6 grid of cards Suppose we have an error with two cards being flipped? Answer: Parity bits could only tell there was an error Suppose we have an error with three cards being flipped? Suppose we have an error with four cards being flipped? Answer: Parity bits would not reveal an error

9 Other Error Detection & Recovery Methods
Computers can add a row and column of parity bits as in the card trick ECC RAM modules designed for server computers have built-in parity bits For example 1 parity bit for every 8-bits of actual data Adding more than one parity bit can help detect and correct multiple bit errors Other techniques include CRC (Cyclic Redundancy Checking) and Hamming Codes


Download ppt "Representing characters"

Similar presentations


Ads by Google