Shop OBEX P1 Docs P2 Docs Learn Events
Variable encoding/compression — Parallax Forums

Variable encoding/compression

ArchiverArchiver Posts: 46,084
edited 2002-04-25 16:56 in General Discussion
Hi everybody, I'm new to this list and to the Stamp.

One of the problems that I see myself possibly encountering in my
Stamp projects is a lack of variables space. Both in size and number.

I guess it would be possible to interace some sort of external memory
chip to the stamp, but maybe there is some way to extend the memory
capabilities of the stamp internally.

One of the problems is that a byte takes up 8 bits and allows 256
states, while a word allows 65536 states while only using up double
the number of bits. It appears that the smaller variable sizes are
less efficient, in terms of bit number versus the capacity of the
variable. This becomes a problem especially if one wants to use many
small variables.

So I was wondering if there are any encoding or compression schemes
which would allow for more efficient use of available variable space?

Perhaps one would be to encode many smaller variables into 1 large
variable.
For example, the word variable 12345. Could be used as an encoding of
the five numbers 1,2,3,4,5. Although this particular scheme is rather
inefficient, there may be some other schemes that someone else can
thing of, along those lines which would work more efficiently. Perhaps
along with some sort of base conversion scheme, maybe to hexadecimal?

I also thought of using lookup tables in the form of DATA statements
as some sort of encoding scheme.

Anyone else have any ideas about this?


Paul Lugger











__________________________________________________________________
Get your free Australian email account at http://www.start.com.au

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-04-25 16:56
    Read the section in the manual about word, byte, nibble and bit variables,
    perhaps that will solve the small variable problem. Also groups of pins can
    be used as well like 1 pin, 2 pins 4 pins 8 pins and 16 at once into a
    single variable. There really is enough variable space if you are a bit
    clever in how you go about it..

    Mike B.
    Original Message
    From: "J 1" <plugger2@s...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, April 24, 2002 8:14 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Variable encoding/compression


    > Hi everybody, I'm new to this list and to the Stamp.
    >
    > One of the problems that I see myself possibly encountering in my
    > Stamp projects is a lack of variables space. Both in size and number.
    >
    > I guess it would be possible to interace some sort of external memory
    > chip to the stamp, but maybe there is some way to extend the memory
    > capabilities of the stamp internally.
    >
    > One of the problems is that a byte takes up 8 bits and allows 256
    > states, while a word allows 65536 states while only using up double
    > the number of bits. It appears that the smaller variable sizes are
    > less efficient, in terms of bit number versus the capacity of the
    > variable. This becomes a problem especially if one wants to use many
    > small variables.
    >
    > So I was wondering if there are any encoding or compression schemes
    > which would allow for more efficient use of available variable space?
    >
    > Perhaps one would be to encode many smaller variables into 1 large
    > variable.
    > For example, the word variable 12345. Could be used as an encoding of
    > the five numbers 1,2,3,4,5. Although this particular scheme is rather
    > inefficient, there may be some other schemes that someone else can
    > thing of, along those lines which would work more efficiently. Perhaps
    > along with some sort of base conversion scheme, maybe to hexadecimal?
    >
    > I also thought of using lookup tables in the form of DATA statements
    > as some sort of encoding scheme.
    >
    > Anyone else have any ideas about this?
    >
    >
    > Paul Lugger
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > __________________________________________________________________
    > Get your free Australian email account at http://www.start.com.au
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
Sign In or Register to comment.