Dale - Computer Science Illuminated 97

Dale - Computer Science Illuminated 97 - 70 Chapter 3 Data...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
70 Chapter 3 Data Representation What about the decoding process? When we use character sets, we just take the bits in chunks of 8 or 16 bits to see what character it represents. In Huffman encoding, with its variable length codes, it seems like we might get confused trying to decode a string because we don’t know how many bits we should include for each character. But that potential confusion has been eliminated by the way the codes are created. An important characteristic of any Huffman encoding is that no bit string used to represent a character is the prefix of any other bit string used to represent a character. Therefore, as we scan left to right across a bit string, when we find a string that corresponds to a character, that must be the character it represents. It can’t be part of a larger bit string. Therefore, if the following bit string is created with the previous table: 1010110001111011 it must be decoded into the word BOARD. There is no other possibility. So how is a particular set of Huffman codes created to begin with?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online