Results 1 to 9 of 9

Thread: Hi Nibble

  1. #1

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774

    Unhappy Hi Nibble

    Once apon a time along time ago I was introduced to a technique called hi-nibble/lo-nibble. Back then I was a pascal newbie trying hard to pass GCSEs.

    The principle was simple useing (128 I think) and some maths function one could take the first two parts of a string and store them in one byte. High and low!!

    The problem is now that I have a usefull function for this fella I can't remember it.

    If anyone has any idea what I am on about please help.
    ?
    'What's this bit for anyway?
    For Jono

  2. #2
    DerFarm
    Guest
    I believe it was called Endian Encoding. I've seen it used in
    applications that require the storage of relative large amounts of
    character data in a smaller space. The one I remember most was
    a program called NUTS that was used to analyze Nuclear
    Magnetic Resonance images.

    Essentially, the first 4 nibbles of the byte refer to the first of a
    hex value, the second refers to the second byte of the hex
    value. It's a two for one saving.

    The decoding function went something like this:

    (Character and 240)*256 + (character and 15) = Decimal Value


    Not too much application, tho.....

  3. #3
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    In general, one cannot store the information about two 8-bit bytes in one 8-bit byte.

    Due to the nature of certain files, there are compression schemes which will encode a file so that it can be stored in less than half the space required for the original file. WinZip will do this.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  4. #4

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    I knew it!!!!

    Thankyou. If you could put up with me a little longer how can I apply that formula (is that for in or out) it's been a while since I had to rearrange an equation.

    Thanks again.
    ?
    'What's this bit for anyway?
    For Jono

  5. #5
    DerFarm
    Guest
    ummmm...I think I mis-spoke.

    The process I was thinking of is a way of encoding numbers in a
    text file, at least the endian process used by Nuts.

    K°RÌ5ŠRKXƒÌù&ÝJâ»1ÌLŽK
    is an example of the ecoding. Each character represents a value
    that would take 4 or 5 characters to represent in text format.

    http://www.acornnmr.com/NutsHelp/cdff.html#3

    is the page describing the file that uses it. the quote above
    comes after the verbiage....


    Sorry.
    Guv was right....as usual.

  6. #6

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    Ok, thanx anyway.

    I guess me old memory didn't do the lesson justice.

    ta' for your time.

    [edit]
    That was one very old and long time ago lesson
    [/edit]
    Last edited by Matt_T_hat; Mar 31st, 2002 at 08:30 AM.

  7. #7
    sql_lall
    Guest

    Wink Correct!!

    By gov:
    In general, one cannot store the information about two 8-bit bytes in one 8-bit byte.
    It seems that many people think it is possible to do so, and try to make programs making this possible.

    Whatever happens, you can't!! There is no way you can make a 'zipping program' that will always compress files. There is just no possible way of making 2^n combinations (using n BITs), and converting them to 2 ^ n-1 combinations using one method, such that all of the 2^n can be compressed. The only thing you can do is rearrange/alter the already used n BITs.

    Also, there is a simple way of writing numbers to files so that the file size is smaller.
    All you have to do is split the number into 2-digit blocks, the save chr$(2-digit + 65). This is so that the 'nasty' low down CHR$() things, such as new-line, clear screen etc. are not included.
    Finally, for ultimate minimization of numbers, convert the whole thing into a binary strain, with each block of 4 (3 only gives numbers 0 - 7) standing for each digit. This is kind of like what someone else was saying. (NOte, this doen't always work, sometimes you get bigger files)

  8. #8
    New Member
    Join Date
    Apr 2002
    Location
    :0
    Posts
    4

    Wink Correct!

    By gov:

    In general, one cannot store the information about two 8-bit bytes in one 8-bit byte.
    there is a simple way of writing numbers to files so that the file size is smaller.
    save the file as binary instead of text .

  9. #9

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    I feel a little foolish.

    Twas searching 4 a way to make my files hard to read for storing midly sensitive data in.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width