Leif,

I find your solution intriguing, but I cant think anymore today unless I get
paid for it. So I cant verify it.

Could you show how it would work with Harry's data:

"As an example. I start reading the bits, and if I
read  00110101 then I translate it to the number 0.  If I read 000111 I
translate it to 1,  0111 translates to 2, 1000 goes to 3, 10011 is 8,
..... 0100111 translates to 18.   There is about 100 of these codes."

And Harry, could you post more of the codes and their resulting values ?


Thanks,

Steve Richter

----- Original Message -----
From: "Leif Svalgaard" <leif@leif.org>
To: <mi400@midrange.com>
Sent: Thursday, December 20, 2001 9:38 AM
Subject: Re: [MI400] Is there an easy way to scan for bits?


> From: Harry Williams <planesmart@teleteam.com>
>
> Translate the codes into a binary tree.
> No code can be a prefix of another code.
> Let the first bit of your string be the signbit of a number S.
> Test on the sign, that determines which branch of the tree
> to take (0 or 1). Shift the bitstring left one bit. Test the
> sihn again, that determines which subbranch (00, 01, 10, or 11),
> etc. When a subbranch corresponds to a code, exit
> the testing setting the numeric value.
>
>
>
>
> _______________________________________________
> This is the MI Programming on the AS400 / iSeries (MI400) mailing list
> To post a message email: MI400@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/mi400
> or email: MI400-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/mi400.
>
>



This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].