• Advertisement

Archived

This topic is now archived and is closed to further replies.

Expressing byte with variant amount of bits

This topic is 5489 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I’ve been interested in data compression lately. Are there any other ways to represent byte/word values than normal 8/16 bit per byte? Perhaps some unbalancing of bits is possible? For example: byte values from 0-127 would be presented with 7 bits and values from 128-255 would be presented with 9 bits. Thanks Floru

Share this post


Link to post
Share on other sites
Advertisement
Most people tend to do that manually with bitwise shifts and masking so you still use "native" data types such as unsigned char, unsigned short etc to store the bits in, but shift and mask into temporary variables to use the value.

500 500 500

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
If the data is just ASCII text and numbers than a common thing on realtime monitoring devices that I have writen drivers for is using 6bit ascii. That way you store 4 characters in the space of 3 bytes. There are conversion functions available on the net if you search for 6 bit ascii.

Share this post


Link to post
Share on other sites

  • Advertisement