notes38 - CLASS NOTES DATA COMPRESSION: Encoding of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CLASS NOTES DATA COMPRESSION: Encoding of strings: Each character is represented with the same number of bits .ASCII(which has 8 bits per character) and UNICODE(which has 16 bits per character) are examples of fixed length encoding. Variable length encoding: Uses binary codes of different length to represent each character. Data compression comes from this type of encoding. Prefix Rule in Variable length encoding : - To prevent ambiguities in variable length encoding, each encoding should not be the prefix of another encoding. Ex 1: 011-A, 010- B,10-C 010 10 011== B C A This encoding is unambiguous since it follows the prefix rule. Ex 2: 011-A, 010-B, 01-C 010 100 11 This encoding is ambiguous since C is the prefix of B and A. We therefore use and encoding “trie” to represent the encoding and to enforce the prefix rule. /*Image*/ For the above tree,A=010,B=11,C=00,D=10 AND R=011. So, using the above encoding 01011011010000101001011011010 consists of 11 characters and uses 29 bits, but had this been in Ascii it would’ve had 11 characters and 88 bits instead. # Different encoding tries give different degrees of compression.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/02/2012 for the course CS 251 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 5

notes38 - CLASS NOTES DATA COMPRESSION: Encoding of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online