Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: 3-byte representation (Simplified!)

by BrowserUk (Patriarch)
on Oct 13, 2011 at 00:49 UTC ( [id://931117]=note: print w/replies, xml ) Need Help??


in reply to Re^2: 3-byte representation (Simplified!)
in thread 3-byte representation

my $packed = pack '(l<X)*', @array; is more concise, probably faster

That's clever, but does have the limitation that you cannot produce a big-endian stream.

Mind, I don't know if there is any hardware that accepts 24-bit BE values.

A shame there seems to be no way to get rid of the final map on the unpacking side.

Agreed. This isn't the first time that I've wished that pack would allow the insertion of values from the template.

I've also wished for a more generic version of vec that allowed arbitrary numbers of bits, rather than just powers of 2.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^4: 3-byte representation (Simplified!)
by johngg (Canon) on Oct 13, 2011 at 14:33 UTC
    Mind, I don't know if there is any hardware that accepts 24-bit BE values.

    I don't know if there are still any out in the wild and I don't recall their endian-ness but ICL 1900 series machines used a 6-bit character representation and had 24-bit words.

    Update: Corrected typo, supplied missing word :-(

    Cheers,

    JohnGG

      I'm pretty sure that the only 6-bit byte machines still running -- if any at all -- will be in museums.

      These days, the most likely candidates are DACS, sound-cards, maybe video, and GPS type hardware.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://931117]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found