• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Encoder

 
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do we convert 7 bit packed data to 8 bits. Any suggestions??

Thanks
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please elaborate a little on your question.
Casual googling on "packed data" points me to mainframe/database articles.
If you specify your environment i can move this to a more appropriate forum where you can get better answers.

P.S.: Excuse me for my unawareness if packed data is something well known
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So if I get you correctly, then you have seven bits which represent more than one value (packed data). Bits 1-3 may be valueA (range 0-7), bits 4-6 valueB (range 0-7), and bit 7 valueC (boolean). Or something like that.

What part are you having trouble with? How are the 7 bits stored? Are you trying to get the stored values out of the packed bit-array or are you trying to turn the packed bit-array into a byte so you can do other things with it?
 
Master Rancher
Posts: 4806
72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's another possibility. US-ASCII only really needs 7 bits per character, since all valid US-ASCII codes are in the range [0,127]. If you store such a number as a byte, the highest-order bit is 0. It's possible to compress your data slightly by omitting that eighth bit and packing the chars in a little more closely. You can fit 8 US-ASCII characters into 7 bytes, with most of the characters stored partly in one byte and partly in another. If we number the bits in each character from 0 to 6, they could be grouped thus:

This is just a guess though. Nikhil, does this sound anything like what you're dealing with?
 
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic