BCD List to HEX List

John Machin sjmachin at lexicon.net
Sun Jul 30 19:25:11 EDT 2006


Philippe Martin wrote:
> Philippe Martin wrote:
>
> > Hi,
> >
> > I'm looking for an algo that would convert a list such as:
> >
> > I'm using python to prototype the algo: this will move to C in an embedded
> > system where an int has 16 bits - I do not wish to use any python library.
> >
> > l1 = [1,2,3,4,6,7,8] #represents the decimal number 12345678
> > l2 = func (l1)
> > # l2 = [0x1, 0x2, 0xD, 0x6, 0x8, 0x7] #represents 0x12D687
> >
> >
> > Regards,
> >
> > Philippe
>
> Thanks to all,
>
> I decided to attack the problem another way and change the code in device #2
> so it can now take the output from device #1.
>
> As device #2 only needs to compare, add, and subtract the stuff .. it makes
> my life much simpler.
>

I'm confused.
1. Was the original device #1 or #2?
2. How many bits does the non-original device's C compiler support?
3. If the original device is device #1, please explain where *it*
obtained an 8-digit decimal number expressed as 1 digit per byte (or
int) ...




More information about the Python-list mailing list