Jeethu: No, I haven't done Huffman on a PIC, but it would be too hard to do so. Remember, we are going to do the hard work on the PC end to prepare the Huffman table and the compressed messages. You would have the overhead of the Huffman tree, which would have to be stored in the PIC, along with the compressed strings. Each entry in the Huffman tree would contain two bytes, LEFT and RIGHT. Each byte can be interpreted in two different ways. If the high bit is set then the rest of the byte contains a 7-bit ASCII character to be output. If the high bit is clear then the rest of the byte contains a pointer (ie: index) to the left or right child of this tree entry. Note that the fewer unique symbols (characters) that appear in your messages the smaller the Huffman table will be. The actual Huffman decode algorithm is actually pretty simple. You treat the the compressed message as a sequence of bits and walk to the left or right in the tree for each one. As soon as your walk encounters a link that has the high bit on then you have found the character to output. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) Remember, ----- Original Message ----- From: "Jeethu Rao" To: Sent: Friday, October 12, 2001 3:16 AM Subject: Re: [ee]: text compression > > Huffman will work fine if you have a large set of small strings that all > > similar occurance frequencies of each character code. > > > > Bob, > This is real interesting. Have you done huffman on PICs ? I managed with > RLE. > And RLE is of no help on text strings. But for huffman I could'nt imagine of > a way to do. > > Jeethu Rao > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body