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 thread, even
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 lines
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 thread,
[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 = (((y shifted left 2) + y)
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
i.e. y = y * 10 + n
he's
[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 publishing
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.
Perhaps you could
[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 algorithm is three
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 the very
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 here.
This
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
where astonishment
John Machin wrote:
Philippe Martin wrote:
Yes I had arm in mind (for some reason) while it is the Smc8831
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
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
numbers
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) - but I
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 line (from
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 line (from
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 what
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
eather in my
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
[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 on extracting
[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 + n
he's
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
you don't mind
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 access to
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 [0..9]
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 you think
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 said
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 smartcard
can it
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
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 one
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 for the Epson
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
That was
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, enlightenment
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) + n
Yeah yeah
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 =
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] #represents
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
python library.
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,N2,Nn]
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 which holds a binary
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] #represents the
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.
l1 =
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 you
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
This is
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 - I do not wish to use any
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
embedded system where an int has 16 bits - I do
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 that this is
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
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
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 I
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 compiler you are
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
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
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 the CPU in the device?
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:
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]
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 you
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 any
python library.
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.python, 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 where an int has 16 bits - I do not
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 the code result.
This is
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.
--
Grant
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 mean ARM as in
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(str, l1]
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 have to kill all of us.
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!!
He obviously doesn't want to
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 C in an
embedded system where an int has
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. I'll try
Philippe Martin wrote:
Yes I had arm in mind (for some reason) while it is the Smc8831
(http://www.google.com/url?sa=Ustart=1q=http://www.epsondevice.com/www/PDFS/epdoc_ic.nsf/5388db40b5eee4f949256a9c001d589f/944b73008b0bad33492570a00015d6ba/%24FILE/S5U1C88000C_2Ev3.pdfe=9797)
That appears to
68 matches
Mail list logo