ohn Machin wrote:
> [EMAIL PROTECTED] wrote:
> > "For each nibble n of x" means to take each 4 bit piece of the BCD
> > integer as a value from zero to sixteen (though only 0 through 9
> > will appear), from most significant to least significant.
> The OP's input, unvaryingly through the whole thre
John Machin wrote:
> [EMAIL PROTECTED] wrote:
> > "For each nibble n of x" means to take each 4 bit piece of the BCD
> > integer as a value from zero to sixteen (though only 0 through 9
> > will appear), from most significant to least significant.
> The OP's input, unvaryingly through the whole t
"John Machin" <[EMAIL PROTECTED]> wrote:
| [EMAIL PROTECTED] wrote:
|
| >My version assumes three subroutines: extracting
| > nibbles, shifting, and adding, Those are pretty simple, so I asked
| > if he needed them rather than presenting them.
| > Assuming we have
| > them, the algorithm is three
[EMAIL PROTECTED] wrote:
> John Machin wrote:
> > [EMAIL PROTECTED] wrote:
> >
> > >My version assumes three subroutines: extracting
> > > nibbles, shifting, and adding, Those are pretty simple, so I asked
> > > if he needed them rather than presenting them.
> > > Assuming we have
> > > them, the
John Machin wrote:
> [EMAIL PROTECTED] wrote:
>
> >My version assumes three subroutines: extracting
> > nibbles, shifting, and adding, Those are pretty simple, so I asked
> > if he needed them rather than presenting them.
> > Assuming we have
> > them, the algorithm is three lines long.
>
> Perhap
[EMAIL PROTECTED] wrote:
>My version assumes three subroutines: extracting
> nibbles, shifting, and adding, Those are pretty simple, so I asked
> if he needed them rather than presenting them.
> Assuming we have
> them, the algorithm is three lines long.
Perhaps you could enlighten us by publishi
John Machin wrote:
> [EMAIL PROTECTED] wrote:
> > John Machin wrote:
> > > [EMAIL PROTECTED] wrote:
> > > > To turn BCD x to binary integer y,
> > > >
> > > > set y to zero
> > > > for each nibble n of x:
> > > > y = (((y shifted left 2) + y) shifted left 1) + n
> > >
> > > Yeah yeah yeah
[EMAIL PROTECTED] wrote:
> John Machin wrote:
> > [EMAIL PROTECTED] wrote:
> > > Philippe Martin wrote:
> > > > Yes, I came here for the "algorithm" question, not the code result.
> > >
> > > To turn BCD x to binary integer y,
> > >
> > > set y to zero
> > > for each nibble n of x:
> > > y
John Machin wrote:
> [EMAIL PROTECTED] wrote:
> > Philippe Martin wrote:
> > > Yes, I came here for the "algorithm" question, not the code result.
> >
> > To turn BCD x to binary integer y,
> >
> > set y to zero
> > for each nibble n of x:
> > y = (((y shifted left 2) + y) shifted left 1)
Grant Edwards wrote:
> On 2006-08-01, Philippe Martin <[EMAIL PROTECTED]> wrote:
>
> >> Perhaps if Philippe could divulge the part number that's in
> >> the bottom right corner of the manual that he has, and/or any
> >> part number that might be mentioned in the first few pages of
> >> that manual
On 2006-08-01, Philippe Martin <[EMAIL PROTECTED]> wrote:
>> Perhaps if Philippe could divulge the part number that's in
>> the bottom right corner of the manual that he has, and/or any
>> part number that might be mentioned in the first few pages of
>> that manual, enlightenment may ensue
>
John Machin wrote:
>
> Simon Forman wrote:
>> Philippe, please! The suspense is killing me. What's the cpu!?
>>
>> For the love of God, what's the CPU?
>>
>> I-can't-take-it-anymore-it's-such-a-simple-question-ingly yours,
>
> Yes, please .
>
> I've found a C compiler manual on the web f
Simon Forman wrote:
> Philippe, please! The suspense is killing me. What's the cpu!?
>
> For the love of God, what's the CPU?
>
> I-can't-take-it-anymore-it's-such-a-simple-question-ingly yours,
Yes, please .
I've found a C compiler manual on the web for the Epson S1C33 CPU as
well as the
Philippe, please! The suspense is killing me. What's the cpu!?
For the love of God, what's the CPU?
I-can't-take-it-anymore-it's-such-a-simple-question-ingly yours,
~Simon
--
http://mail.python.org/mailman/listinfo/python-list
Philippe Martin wrote:
> Sorry forgot a few answers/comments:
>
> John Machin wrote:
> > SHOULD BE >=
> >currently add([6, 6], [4, 4] -> [10, 10]
>
> True, thanks
>
> > *** try - 10 instead of % 10
> > If the first operand is > 19, you have a bug!
> > This might save a few CPU cycles on your s
John Machin wrote:
> Have you actually tried it? Do you mean it barfs on the word "long"
> [meaning that it's not an ANSI-compliant C compiler], or that "long" is
> only 16 bits?
:-) if the documentation tells me there is no 32 bit support, why should I
not believe it ?
> because (1) [like I sa
Philippe Martin wrote:
> John Machin wrote:
>
> > So why don't you get a freely available "bignum" package, throw away
> > the bits you don' t want, and just compile it and use it, instead of
> > writing your own bug-ridden (see below) routines? Oh yeah, the bignum
> > package might use "long" and
Sorry forgot a few answers/comments:
John Machin wrote:
> SHOULD BE >=
>currently add([6, 6], [4, 4] -> [10, 10]
True, thanks
> *** try - 10 instead of % 10
> If the first operand is > 19, you have a bug!
> This might save a few CPU cycles on your smartcard
can it ? each array value will be
John Machin wrote:
> So why don't you get a freely available "bignum" package, throw away
> the bits you don' t want, and just compile it and use it, instead of
> writing your own bug-ridden (see below) routines? Oh yeah, the bignum
> package might use "long" and you think that you don't have acce
Philippe Martin wrote:
> Paul Rubin wrote:
>
> > Philippe Martin <[EMAIL PROTECTED]> writes:
> >> I actually need numbers much larger than 32 bits.
***NOW*** you tell us, after all the stuffing about re 32 bits.
> >
> > What is the max size hex number you need? What is the application if
> > yo
[EMAIL PROTECTED] wrote:
> Philippe Martin wrote:
> > Yes, I came here for the "algorithm" question, not the code result.
>
> To turn BCD x to binary integer y,
>
> set y to zero
> for each nibble n of x:
> y = (((y shifted left 2) + y) shifted left 1) + n
Yeah yeah yeah
i.e. y = y * 10 +
[EMAIL PROTECTED] wrote:
>
> Philippe Martin wrote:
>> Yes, I came here for the "algorithm" question, not the code result.
>
> To turn BCD x to binary integer y,
>
> set y to zero
> for each nibble n of x:
> y = (((y shifted left 2) + y) shifted left 1) + n
>
> Do you need instruction
Philippe Martin wrote:
> Yes, I came here for the "algorithm" question, not the code result.
To turn BCD x to binary integer y,
set y to zero
for each nibble n of x:
y = (((y shifted left 2) + y) shifted left 1) + n
Do you need instruction on extracting nibbles, and shifting and
adding
Paul Rubin wrote:
> Philippe Martin <[EMAIL PROTECTED]> writes:
>> On device #1 no constraint for my purpose. On the smartcard, the tradeoff
>> is between using EEPROM (plenty + slow + small life expectancy) for temp
>> variables versus RAM (very little) ... but I do not think it is an issue
>> ea
Philippe Martin <[EMAIL PROTECTED]> writes:
> On device #1 no constraint for my purpose. On the smartcard, the tradeoff is
> between using EEPROM (plenty + slow + small life expectancy) for temp
> variables versus RAM (very little) ... but I do not think it is an issue
> eather in my case. Speed is
Paul Rubin wrote:
> Philippe Martin <[EMAIL PROTECTED]> writes:
>> Well I am under NDA so I cannot tell you what the application is - I need
>> numbers (dec) with up to 24 digits.
>
> You actually need to represent numbers up to 10**24??
>
>> As I said, I went the other way - more data on the li
Paul Rubin wrote:
> Philippe Martin <[EMAIL PROTECTED]> writes:
>> Well I am under NDA so I cannot tell you what the application is - I need
>> numbers (dec) with up to 24 digits.
>
> You actually need to represent numbers up to 10**24??
>
>> As I said, I went the other way - more data on the li
Philippe Martin <[EMAIL PROTECTED]> writes:
> Well I am under NDA so I cannot tell you what the application is - I need
> numbers (dec) with up to 24 digits.
You actually need to represent numbers up to 10**24??
> As I said, I went the other way - more data on the line (from dev 1 to dev
> 2) - b
Paul Rubin wrote:
> Philippe Martin <[EMAIL PROTECTED]> writes:
>> I actually need numbers much larger than 32 bits.
>
> What is the max size hex number you need? What is the application if
> you don't mind my asking?
Well I am under NDA so I cannot tell you what the application is - I need
num
Philippe Martin <[EMAIL PROTECTED]> writes:
> I actually need numbers much larger than 32 bits.
What is the max size hex number you need? What is the application if
you don't mind my asking?
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> Philippe Martin wrote:
>
>>
>> Yes I had arm in mind (for some reason) while it is the Smc8831
>>
(http://www.google.com/url?sa=U&start=1&q=http://www.epsondevice.com/www/PDFS/epdoc_ic.nsf/5388db40b5eee4f949256a9c001d589f/944b73008b0bad33492570a00015d6ba/%24FILE/S5U1C88000C_2
John Machin wrote:
>
> Philippe Martin wrote:
>
>> >> 3. How does the device manage to compute the 8-decimal-digit number
>> >> that is your input??
>>
>> What device manager ? think about it before being rude
>>
>
> No device manager [noun] was mentioned. You may have inferred rudeness
> w
Paul Rubin wrote:
> Philippe Martin <[EMAIL PROTECTED]> writes:
>> > Why are you avoiding naming the chip and its compiler?
>>
>> I must disagree on that one: There are many threads on this site where
>> people just have fun talking algorithm. I'm not an algo. expert and I
>> know there are many
Philippe Martin <[EMAIL PROTECTED]> writes:
> > Why are you avoiding naming the chip and its compiler?
>
> I must disagree on that one: There are many threads on this site where
> people just have fun talking algorithm. I'm not an algo. expert and I know
> there are many here.
This is just like t
Philippe Martin wrote:
>
> Yes I had arm in mind (for some reason) while it is the Smc8831
> (http://www.google.com/url?sa=U&start=1&q=http://www.epsondevice.com/www/PDFS/epdoc_ic.nsf/5388db40b5eee4f949256a9c001d589f/944b73008b0bad33492570a00015d6ba/%24FILE/S5U1C88000C_2Ev3.pdf&e=9797)
That appea
Philippe Martin wrote:
> >> 3. How does the device manage to compute the 8-decimal-digit number
> >> that is your input??
>
> What device manager ? think about it before being rude
>
No device manager [noun] was mentioned. You may have inferred rudeness
where astonishment was being implied.
John Machin wrote:
> Philippe Martin wrote:
>> John Machin wrote:
>>
>> >
>> > 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
Philippe Martin wrote:
> Grant Edwards wrote:
>
>> On 2006-07-31, John Machin <[EMAIL PROTECTED]> wrote:
>>
but if you
wish ==>
on one device, the processor in an 8-bit arm and the X-compiler is made
by epson
>>>
>>> 1. You still haven't *NAMED* the CPU and the compiler!
Grant Edwards wrote:
> On 2006-07-31, John Machin <[EMAIL PROTECTED]> wrote:
>
>>> but if you
>>> wish ==>
>>>
>>> on one device, the processor in an 8-bit arm and the X-compiler is made
>>> by epson
>>
>> 1. You still haven't *NAMED* the CPU and the compiler!!
>
> He obviously doesn't want to h
Dennis Lee Bieber wrote:
> On Sun, 30 Jul 2006 17:07:57 -0500, Philippe Martin
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
>> Paul Rubin wrote:
>>
>> >
>> > If you prefer, You can do it all in one line:
>> >
>> >vlist = [int(d, 16) for d in ('%X' % int(''.join(map(
On 2006-07-31, John Machin <[EMAIL PROTECTED]> wrote:
>> but if you
>> wish ==>
>>
>> on one device, the processor in an 8-bit arm and the X-compiler is made by
>> epson
>
> 1. You still haven't *NAMED* the CPU and the compiler!!
He obviously doesn't want to have to kill all of us.
> 2. Do you m
On 2006-07-30, John Machin <[EMAIL PROTECTED]> wrote:
>> Yes, I came here for the "algorithm" question, not the code
>> result.
>
> This is comp.lang.python, not comp.algorithms
>
> Why are you avoiding naming the chip and its compiler?
It's top secret. If he told us, he'd have to kill us.
--
Philippe Martin wrote:
> John Machin wrote:
>
> >
> > Philippe Martin wrote:
> >> John Machin wrote:
> >>
> >> > Have you considered asking on a newsgroup where your problem might
> >> > actually be on-topic, like:
> >> > comp.lang.c
> >>
> >> Yes, I came here for the "algorithm" question, not
Philippe Martin wrote:
> John Machin wrote:
>
> >
> > 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 wh
John Machin wrote:
>
> Philippe Martin wrote:
>> John Machin wrote:
>>
>> > Have you considered asking on a newsgroup where your problem might
>> > actually be on-topic, like:
>> > comp.lang.c
>>
>> Yes, I came here for the "algorithm" question, not the code result.
>>
>
> This is comp.lang.
John Machin wrote:
>
> 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
Philippe Martin wrote:
> John Machin wrote:
>
> > Have you considered asking on a newsgroup where your problem might
> > actually be on-topic, like:
> > comp.lang.c
>
> Yes, I came here for the "algorithm" question, not the code result.
>
This is comp.lang.python, not comp.algorithms
Why are
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
John Machin wrote:
> Have you considered asking on a newsgroup where your problem might
> actually be on-topic, like:
> comp.lang.c
Yes, I came here for the "algorithm" question, not the code result.
Regards,
Philippe
--
http://mail.python.org/mailman/listinfo/python-list
Philippe Martin wrote:
> John Machin wrote:
>
> > Philippe Martin wrote:
> >
> >>
> >> Thanks John, I do not have a long available on the device: stuck with 16
> >> bits.
> >>
> >
> > What does "available on the device" mean? Having a "long" is a property
> > of a C complier, not a device. What is
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 decima
Philippe Martin <[EMAIL PROTECTED]> writes:
> Thanks John, I do not have a long available on the device: stuck with 16
> bits.
Oh, I think I understand now, why you were asking about algorithms.
You really did want something whose intermediate results all fit in 16
bits.
Even if your C compiler
John Machin wrote:
> Philippe Martin wrote:
>
>>
>> Thanks John, I do not have a long available on the device: stuck with 16
>> bits.
>>
>
> What does "available on the device" mean? Having a "long" is a property
> of a C complier, not a device. What is the CPU in the device? What is
> the C com
Philippe Martin wrote:
>
> Thanks John, I do not have a long available on the device: stuck with 16
> bits.
>
What does "available on the device" mean? Having a "long" is a property
of a C complier, not a device. What is the CPU in the device? What is
the C compiler you are using? N.B. Last time
Paul Rubin wrote:
> Philippe Martin <[EMAIL PROTECTED]> writes:
>> I'm just using Python to prototype, so I cannot use any of these great
>> features of the language.
>
> I think when writing a prototype, you should use whatever features you
> want, except maybe at the upper levels of program org
Philippe Martin <[EMAIL PROTECTED]> writes:
> I'm just using Python to prototype, so I cannot use any of these great
> features of the language.
I think when writing a prototype, you should use whatever features you
want, except maybe at the upper levels of program organization. The
idea of proto
Dennis Lee Bieber wrote:
> On Sun, 30 Jul 2006 16:39:47 -0500, Philippe Martin
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
>>
>> My apologies, I clearly made a mistake with my calculator, yes the
>> resulting array I would need is [0xb,0xc,0x6,0x1,0x4,0xe]
>>
> Take note
John Machin wrote:
> Philippe Martin wrote:
>> John Machin wrote:
>>
>> > Philippe Martin wrote:
>> >> Hi,
>> >>
>> >> I'm looking for an algo that would convert a list such as:
>> >
>> > Such as what?
>> >
>> >>
>> >> I'm using python to prototype the algo: this will move to C in an
>> >> embedde
Philippe Martin wrote:
> John Machin wrote:
>
> > Philippe Martin wrote:
> >> Hi,
> >>
> >> I'm looking for an algo that would convert a list such as:
> >
> > Such as what?
> >
> >>
> >> I'm using python to prototype the algo: this will move to C in an
> >> embedded system where an int has 16 bits
Paul Rubin wrote:
> Philippe Martin <[EMAIL PROTECTED]> writes:
>> 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
>
> Th
Philippe Martin <[EMAIL PROTECTED]> writes:
> 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
This is untested, but should give
John Machin wrote:
> Philippe Martin wrote:
>> Hi,
>>
>> I'm looking for an algo that would convert a list such as:
>
> Such as what?
>
>>
>> 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
Philippe Martin wrote:
> Hi,
>
> I'm looking for an algo that would convert a list such as:
Such as what?
>
> 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] #represent
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, Philippe Martin wrote:
>
>> Marc 'BlackJack' Rintsch wrote:
>>
>>> And now please describe you problem a little better. ;-)
>>
>> I'll try.
>>
>> first of all python is not going to be used for my purpose (sigh)
>>
>> I have device A
In <[EMAIL PROTECTED]>, Philippe Martin wrote:
> Marc 'BlackJack' Rintsch wrote:
>
>> And now please describe you problem a little better. ;-)
>
> I'll try.
>
> first of all python is not going to be used for my purpose (sigh)
>
> I have device A which holds a binary coded decimal array [N1,N
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, Philippe Martin wrote:
>
>> 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
>> pytho
In <[EMAIL PROTECTED]>, Philippe Martin wrote:
> 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] #repres
67 matches
Mail list logo