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?
This is the end of the preview. Sign up
access the rest of the document.