<anbu at peoplestring dot com> wrote:

> Why are codes preferred in multiples of 8?

Because computers read, process, and write information 8 bits at a time
(or 8 times some power of 2).

To read, say, 3 bits, a computer must read in one or two 8-bit bytes,
depending on context, and rotate and mask the unwanted bits.  This is
inefficient and makes random-access tasks like searching much more
difficult than if code units are aligned on 8-bit boundaries.

This sort of thing is useful when data size is at a premium, but once
you go there, there are many general-purpose compression techniques that
will provide better efficiency than a straight variable-width encoding.

--
Doug Ewell | Thornton, Colorado, USA | RFC 5645, 4645, UTN #14
www.ewellic.org | www.facebook.com/doug.ewell | @DougEwell ­




Reply via email to