Searching \ for '[PIC:] divide by 10 question' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/math/index.htm?key=divide
Search entire site for: 'divide by 10 question'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] divide by 10 question'
2004\01\28@054210 by Phil

flavicon
face
Hello everyone,

I'm looking for a divide by 10 routine. The number that I want to divide is an
8 bit number but I will very likely need to divide 10 bit numbers by ten as
well.

While playing with micro processors during the mid 70s I remember that
dividing by ten involved a shift right and an add instruction but I cannot
remember the sequence.

A web search has revealed many 16 bit division routines but they look more
complex than I remember for a simple divide by 10.

Again, can someone help?

--
Regards,
Phil.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\01\28@054210 by Phil

flavicon
face
Hello everyone,

I'm looking for a divide by 10 routine. The number that I want to divide is an
8 bit number but I will very likely need to divide 10 bit numbers by ten as
well.

While playing with micro processors during the mid 70s I remember that
dividing by ten involved a shift right and an add instruction but I cannot
remember the sequence.

A web search has revealed many 16 bit division routines but they look more
complex than I remember for a simple divide by 10.

Again, can someone help?

--
Regards,
Phil.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

.

2004\01\28@062254 by Jinx

face picon face
Have you tried the Code Generator

http://www.piclist.com/techref/piclist/codegen/constdivmul.htm

or here

http://www.piclist.com/techref/method/math/divconst.htm

there's a conditional  /10 example

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\01\28@062254 by Jinx

face picon face
Have you tried the Code Generator

http://www.piclist.com/techref/piclist/codegen/constdivmul.htm

or here

http://www.piclist.com/techref/method/math/divconst.htm

there's a conditional  /10 example

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

.

2004\01\28@063541 by Eugene Rosenzweig

flavicon
face
One step up from that, in the division index,
www.piclist.com/techref/microchip/math/div/index.htm
in Archive: list of links, there is a link to division by 10.

{Original Message removed}

2004\01\28@063541 by Eugene Rosenzweig

flavicon
face
One step up from that, in the division index,
www.piclist.com/techref/microchip/math/div/index.htm
in Archive: list of links, there is a link to division by 10.

{Original Message removed}

2004\01\28@065242 by hael Rigby-Jones

picon face
>-----Original Message-----
>From: Phil
>
>Hello everyone,
>
>I'm looking for a divide by 10 routine. The number that I want
>to divide is an 8 bit number but I will very likely need to
>divide 10 bit numbers by ten as well.
>
>While playing with micro processors during the mid 70s I
>remember that dividing by ten involved a shift right and an
>add instruction but I cannot remember the sequence.
>
>A web search has revealed many 16 bit division routines but
>they look more complex than I remember for a simple divide by 10.
>
>Again, can someone help?
>

I suspect you remember multipying by 10 which is as easy as you say.
(number << 3 + number << 1)

Dividing by non-binary powers is usualy much more long winded, depending on
the accuracy you want.

I wrote a small VB app to calculate the binary weightings required for
multiplication and division, given a desired accuracy target.

For a 1%(max) error it gives:
Add input / 16 to accumulator
Add input / 32 to accumulator
Add input / 256 to accumulator
Add input / 512 to accumulator
Actual divisor = 10.03922
Error = 0.39063 %

For 2%(max) error:
Add input / 8 to accumulator
Subtract input / 32 from accumulator
Add input / 128 to accumulator
Actual divisor = 9.84615
Error = 1.5625 %






=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to
spam_OUTpostmasterTakeThisOuTspambookham.com.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\01\28@065242 by hael Rigby-Jones

picon face
>-----Original Message-----
>From: Phil
>
>Hello everyone,
>
>I'm looking for a divide by 10 routine. The number that I want
>to divide is an 8 bit number but I will very likely need to
>divide 10 bit numbers by ten as well.
>
>While playing with micro processors during the mid 70s I
>remember that dividing by ten involved a shift right and an
>add instruction but I cannot remember the sequence.
>
>A web search has revealed many 16 bit division routines but
>they look more complex than I remember for a simple divide by 10.
>
>Again, can someone help?
>

I suspect you remember multipying by 10 which is as easy as you say.
(number << 3 + number << 1)

Dividing by non-binary powers is usualy much more long winded, depending on
the accuracy you want.

I wrote a small VB app to calculate the binary weightings required for
multiplication and division, given a desired accuracy target.

For a 1%(max) error it gives:
Add input / 16 to accumulator
Add input / 32 to accumulator
Add input / 256 to accumulator
Add input / 512 to accumulator
Actual divisor = 10.03922
Error = 0.39063 %

For 2%(max) error:
Add input / 8 to accumulator
Subtract input / 32 from accumulator
Add input / 128 to accumulator
Actual divisor = 9.84615
Error = 1.5625 %






=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to
.....postmasterKILLspamspam@spam@bookham.com.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

.

2004\01\28@095955 by Andrew Kieran

picon face
There are many solutions, but two in particular that I would
consider:

1)
o starting with number to be divided in 'value1'
o Shift right, store result in 'value1' and 'value2'
o shift right, 'value1' two more times, storing result in
'value1'
o subtract 'value2' from 'value1'
o The result is the original 'value1' divided by 10

This works likes this:
rrf - divides by two, store in 'value2'
rrf - now divided by four
rrf - now divided by eight
subtract 'value2' - now divided by ten

Note also that the state of the carry flag after the last shift
can be used to determne whether to round-up the result

2)
Alterately, I would consider using one of the general purpose
division routines from the PICLIST.  You should have one for
your code library anyway.  So unless you're code space is really
tight and you don't need to do any other division, I'd use the
general purpose routine rather than this specialized divide by
ten approach.

That's my $0.02

Andrew




________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag


---- On    , Phil (philspamKILLspamSPIDERWEB.COM.AU) wrote:

> Hello everyone,
>
> I'm looking for a divide by 10 routine. The number that I want
to divide is an
> 8 bit number but I will very likely need to divide 10 bit
numbers by ten as
> well.
>
> While playing with micro processors during the mid 70s I
remember that
> dividing by ten involved a shift right and an add instruction
but I cannot
> remember the sequence.
>
> A web search has revealed many 16 bit division routines but
they look more
> complex than I remember for a simple divide by 10.
>
> Again, can someone help?
>
> --
> Regards,
> Phil.
>
> --
> http://www.piclist.com hint: The list server can filter out
subtopics
> (like ads or off topics) for you. See
http://www.piclist.com/#topics
>
>

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\01\28@095955 by Andrew Kieran

picon face
There are many solutions, but two in particular that I would
consider:

1)
o starting with number to be divided in 'value1'
o Shift right, store result in 'value1' and 'value2'
o shift right, 'value1' two more times, storing result in
'value1'
o subtract 'value2' from 'value1'
o The result is the original 'value1' divided by 10

This works likes this:
rrf - divides by two, store in 'value2'
rrf - now divided by four
rrf - now divided by eight
subtract 'value2' - now divided by ten

Note also that the state of the carry flag after the last shift
can be used to determne whether to round-up the result

2)
Alterately, I would consider using one of the general purpose
division routines from the PICLIST.  You should have one for
your code library anyway.  So unless you're code space is really
tight and you don't need to do any other division, I'd use the
general purpose routine rather than this specialized divide by
ten approach.

That's my $0.02

Andrew




________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag


---- On    , Phil (.....philKILLspamspam.....SPIDERWEB.COM.AU) wrote:

> Hello everyone,
>
> I'm looking for a divide by 10 routine. The number that I want
to divide is an
> 8 bit number but I will very likely need to divide 10 bit
numbers by ten as
> well.
>
> While playing with micro processors during the mid 70s I
remember that
> dividing by ten involved a shift right and an add instruction
but I cannot
> remember the sequence.
>
> A web search has revealed many 16 bit division routines but
they look more
> complex than I remember for a simple divide by 10.
>
> Again, can someone help?
>
> --
> Regards,
> Phil.
>
> --
> http://www.piclist.com hint: The list server can filter out
subtopics
> (like ads or off topics) for you. See
http://www.piclist.com/#topics
>
>

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

.

2004\01\28@103310 by hael Rigby-Jones

picon face
{Quote hidden}

Have you actually tried this?  It seems to be a fairly common assumption
that division can be performed like this by reversing the method you would
use for multiplication.  It simply does not work, never has and never will.

The only way to use shifts, additions and subtractions to perform division
is to break the divisor down into it's binary powers, as per my previous
post.

Regards

Mike




=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to
@spam@postmasterKILLspamspambookham.com.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\01\28@103310 by hael Rigby-Jones

picon face
{Quote hidden}

Have you actually tried this?  It seems to be a fairly common assumption
that division can be performed like this by reversing the method you would
use for multiplication.  It simply does not work, never has and never will.

The only way to use shifts, additions and subtractions to perform division
is to break the divisor down into it's binary powers, as per my previous
post.

Regards

Mike




=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to
spamBeGonepostmasterspamBeGonespambookham.com.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

.

2004\01\28@114409 by M. Adam Davis

flavicon
face
Ok, let's see...

We'll start with 100
value1: 100
value2:

value1: 50
value2: 50

value1: 12
value2: 50

Result = value1 - value2 = -38

The reason this doesn't work is that you cannot add and subtract
divisors like you can add and subtract multipliers.  The equivilant
statement is:

x/8 - x/2 which then becomes
x/8 - 4x/8 which is equal to
-3x/8

The result of which is -3/8 of the original number.  If you add them
instead of subtracting, you get 5/8 of the original number.

The true divide by ten MUST include a factor of 5 in the divisor:
x/(2*5)

Since that cannot be duplicated in rotations (divisions or
multiplications by two) then the PIC can only approximate such a result
with rotations.   As others have said, the approximations involve adding
together smaller divisions of 2:
x/10 is larger than x/16, so add x/16 to the result.  The remainder is
x/26.66.
x/26 is larger than x/32, so add x/32 to the result.  The remainder is x/160
x/160 is larger than x/256, so add x/256 to the result.  The remainder
is x/426.66
etc

As you can see, with just the above three divisions you get 25x/256,
which is fairly close to 1/10.  You can compute the exact error by
subtracting the approximate from the ideal, then dividing by the ideal.
In this case, those three terms give you a 2.3% error.  You may be able
to come closer to the goal in fewer terms by doing 9/10 of x, then
subtracting that from x.

-Adam

Andrew Kieran wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\01\28@114409 by M. Adam Davis

flavicon
face
Ok, let's see...

We'll start with 100
value1: 100
value2:

value1: 50
value2: 50

value1: 12
value2: 50

Result = value1 - value2 = -38

The reason this doesn't work is that you cannot add and subtract
divisors like you can add and subtract multipliers.  The equivilant
statement is:

x/8 - x/2 which then becomes
x/8 - 4x/8 which is equal to
-3x/8

The result of which is -3/8 of the original number.  If you add them
instead of subtracting, you get 5/8 of the original number.

The true divide by ten MUST include a factor of 5 in the divisor:
x/(2*5)

Since that cannot be duplicated in rotations (divisions or
multiplications by two) then the PIC can only approximate such a result
with rotations.   As others have said, the approximations involve adding
together smaller divisions of 2:
x/10 is larger than x/16, so add x/16 to the result.  The remainder is
x/26.66.
x/26 is larger than x/32, so add x/32 to the result.  The remainder is x/160
x/160 is larger than x/256, so add x/256 to the result.  The remainder
is x/426.66
etc

As you can see, with just the above three divisions you get 25x/256,
which is fairly close to 1/10.  You can compute the exact error by
subtracting the approximate from the ideal, then dividing by the ideal.
In this case, those three terms give you a 2.3% error.  You may be able
to come closer to the goal in fewer terms by doing 9/10 of x, then
subtracting that from x.

-Adam

Andrew Kieran wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

.

2004\01\28@202842 by Jim Korman

flavicon
face
Michael Rigby-Jones wrote:

{Quote hidden}

Try this instead
    x <- x div 2
    x <- x - 10;
    x <- x div 2
    x <- x div 2

will give you x div 10

Jim

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

.

2004\01\28@210001 by Jim Korman

flavicon
face
Jim Korman wrote:

> Michael Rigby-Jones wrote:
<snip>
{Quote hidden}

<BACKSPACE stupid reply:blush/>


Jim

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

.
Return-Path: <>
Received: from mitvma.mit.edu ([18.92.0.3]) by tomts29-srv.bellnexxia.net
         (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP
         id <RemoveME20040128145836.EGMW19788.tomts29-srv.bellnexxia.netEraseMEspamEraseMEmitvma.mit.edu>>          for <RemoveMEpiclist_errorsspam_OUTspamKILLspamSYMPATICO.CA>;
         Wed, 28 Jan 2004 09:58:36 -0500
Received:  by mitvma.mit.edu (IBM VM SMTP Level 430) via spool with SMTP id 6718 ; Wed, 28 Jan 2004 09:58:18 EST
Received: from MITVMA.MIT.EDU (NJE origin LISTSERV@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 3851; Wed, 28 Jan 2004 09:58:19 -0500
Date:         Wed, 28 Jan 2004 09:58:19 -0500
From:         "L-Soft list server at MITVMA.MIT.EDU (1.8e)"
             <RemoveMELISTSERVTakeThisOuTspamspamMITVMA.MIT.EDU>
Subject: PICLIST: error report from NT.MASSMIND.ORG
To:           EraseMElistsjoshspamspamspamBeGone3MTMP.COM,
             "For RemoveMEBlackholeeclipseKILLspamspamEarthlink.Net" <piclist_errorsSTOPspamspamspam_OUTSYMPATICO.CA>
Message-ID:   <LISTSERV%spamBeGone2004012809581850STOPspamspamEraseMEMITVMA.MIT.EDU>
X-LSV-ListID: None

The enclosed message has been identified as a delivery error for the PICLIST
list because it was sent to 'KILLspamowner-piclistspamBeGonespamMITVMA.MIT.EDU'.

------------------------------ Message in error -------------------------------
Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail
         V1.2d/1.8d) with BSMTP id 3849; Wed, 28 Jan 2004 09:58:18 -0500
Received: from nt.massmind.org [66.13.172.18] by mitvma.mit.edu (IBM VM SMTP
         Level 430) via TCP with SMTP ; Wed, 28 Jan 2004 09:58:17 EST
X-Comment: mitvma.mit.edu: Mail was sent by nt.massmind.org
To: EraseMEowner-piclistspamEraseMEMITVMA.MIT.EDU
From: Mail Administrator<@spam@Postmaster@spam@spamspam_OUTnt.massmind.org>
Reply-To: Mail Administrator<spamBeGonePostmasterspamKILLspamnt.massmind.org>
Subject: Mail System Error - Returned Mail
Date: Wed, 28 Jan 2004 06:54:50 -0800
Message-ID: <.....20040128145450801.AAA388spam_OUTspamnt.massmind.org>> MIME-Version: 1.0
Content-Type: multipart/mixed;
               Boundary="===========================_ _= 9902038(388)"
Content-Transfer-Encoding: 7BIT


--===========================_ _= 9902038(388)
Content-Type: text/plain

This Message was undeliverable due to the following reason:

This message passed through a number of mail servers
greater than the maximum number specified in the
Maximum MTA Hops field. This probably indicates that
there are accounts on separate machines that forward
mail to each other.

There may also be a problem with the host address or
Domain Name System records.

Maximum Hops: 15

Please reply to
TakeThisOuTPostmaster.....spamTakeThisOuTnt.massmind.org
if you feel this message to be in error.


--===========================_ _= 9902038(388)
Content-Type: message/rfc822

Received: from cherry.ease.lsoft.com ([209.119.0.109]) by nt.massmind.org
         (Post.Office MTA v3.5.3 release 223 ID# 0-12345L500S10000V35)
         with ESMTP id org for <TakeThisOuTarchiveKILLspamspamspamPICLIST.ORG>;
         Fri, 23 Jan 2004 06:26:48 -0800
Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com (LSMTP for Digital Unix v1.1b) with SMTP id <.....11.00CB2CD0spamRemoveMEcherry.ease.lsoft.com>; Fri, 23 Jan 2004 9:29:05 -0500
Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e)
         with spool id 0716 for RemoveMEPICLISTspamspamBeGoneMITVMA.MIT.EDU; Fri, 23 Jan 2004
         09:28:55 -0500
Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail
         V1.2d/1.8d) with BSMTP id 9636; Fri, 23 Jan 2004 09:27:52 -0500
Received: from audiomind.dk [213.237.88.238] by mitvma.mit.edu (IBM VM SMTP
         Level 430) via TCP with ESMTP ; Fri, 23 Jan 2004 09:27:51 EST
Received: from winbox.Audiomind.local (192.168.2.3:8136) by audiomind.dk with
         [XMail 1.16 (Linux/Ix86) ESMTP Server] id <SD656> for
         <spamBeGonePICLIST@spam@spamspam_OUTMITVMA.MIT.EDU> from <TakeThisOuTPICLISTspamspamMITVMA.MIT.EDU>; Fri, 23 Jan
         2004 15:24:44 +0100
Received: from mail pickup service by winbox.Audiomind.local with Microsoft
         SMTPSVC; Fri, 23 Jan 2004 15:24:34 +0100
Received: from audiomind.dk ([192.168.2.6]) by winbox.intra.audiomind.dk with
         Microsoft SMTPSVC(6.0.3790.0); Tue, 20 Jan 2004 12:46:12 +0100
Received: from cherry.ease.lsoft.com (209.119.0.109:2137) by audiomind.dk with
         [XMail 1.16 (Linux/Ix86) ESMTP Server] id <SCF75> for
         <sorenEraseMEspamAUDIOMIND.DK> from <RemoveMEowner-piclistEraseMEspamspam_OUTMITVMA.MIT.EDU>; Mon, 19 Jan
         2004 16:22:37 +0100
Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com
         (LSMTP for Digital Unix v1.1b) with SMTP id
         <@spam@14.00CAB556RemoveMEspamEraseMEcherry.ease.lsoft.com>; Mon, 19 Jan 2004 10:22:32 -0500
Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e)
         with spool id 9776 for EraseMEPICLISTspam@spam@MITVMA.MIT.EDU; Mon, 19 Jan 2004
         10:22:20 -0500
Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail
         V1.2d/1.8d) with BSMTP id 7904; Mon, 19 Jan 2004 10:21:08 -0500
Received: from extsmtp1.localnet.com [207.251.201.54] by mitvma.mit.edu (IBM VM
         SMTP Level 430) via TCP with SMTP ; Mon, 19 Jan 2004 10:21:07 EST
Received: (qmail 14450 invoked from network); 19 Jan 2004 14:49:36 -0000
Received: from drballew.localnet.sys (HELO smtp2.localnet.com) (10.0.7.15) by
         extsmtp1.localnet.com with SMTP; 19 Jan 2004 14:49:36 -0000
Received: (qmail 12678 invoked from network); 19 Jan 2004 15:21:09 -0000
Received: from unknown (HELO kmp) (66.153.68.142) by mail1.localnet.com with
         SMTP; 19 Jan 2004 15:21:09 -0000
X-Comment: mitvma.mit.edu: Mail was sent by audiomind.dk
X-Comment: mitvma.mit.edu: Mail was sent by extsmtp1.localnet.com
X-AV-Scanned: yes  b2ab38ea032590bfaab7ef0876f8a8eb
X-AV-Scanned: yes  12dd4b4862a1bf66defec30f36930c40
X-Deliver-To: @spam@sorenspam_OUTspam.....audiomind.dk
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Importance: Normal
Precedence: list
X-OriginalArrivalTime: 20 Jan 2004 11:46:12.0182 (UTC)
                      FILETIME=[00951F60:01C3DF4B]
Message-ID:  <spamBeGoneKHEAKGMGPPBIPOHGAOODOEBHCMAA.no_spamEraseMEspamlocalnet.com>> Date:         Mon, 19 Jan 2004 10:21:19 -0500
Reply-To:     pic microcontroller discussion list <
PICLISTspamBeGonespamMITVMA.MIT.EDU>
Sender:       pic microcontroller discussion list <RemoveMEPICLIST@spam@spamspamBeGoneMITVMA.MIT.EDU>
From:         Ken Pergola <.....no_spam@spam@spamEraseMELOCALNET.COM>
Subject: Re: [PIC:] Free older PICmicros to a good home
To:           .....PICLISTRemoveMEspamMITVMA.MIT.EDU
In-Reply-To:  <47691.63.85.34.2.1074521736.squirrel@http://www.intertex.net>

Paul James E. wrote:

>  I help a teacher friend of mine with his college courses and I'm sure
>  he'd love to have these for use in his classes.   Please advise.

Hi Paul,

More people responded than I had expected. I'll keep you on the list if
there are any left.
Could you send your private e-mail to me so I could contact you if I have
any left?

Thanks,

Ken Pergola

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--===========================_ _= 9902038(388)--

.
Return-Path: <>
Received: from mitvma.mit.edu ([18.92.0.3]) by tomts37-srv.bellnexxia.net
         (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP
         id <.....20040128150337.TKMX8220.tomts37-srv.bellnexxia.netSTOPspamspam@spam@mitvma.mit.edu>>          for <piclist_errorsEraseMEspam@spam@SYMPATICO.CA>;
         Wed, 28 Jan 2004 10:03:37 -0500
Received:  by mitvma.mit.edu (IBM VM SMTP Level 430) via spool with SMTP id 6726 ; Wed, 28 Jan 2004 10:03:33 EST
Received: from MITVMA.MIT.EDU (NJE origin LISTSERV@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 4057; Wed, 28 Jan 2004 10:03:34 -0500
Date:         Wed, 28 Jan 2004 10:03:34 -0500
From:         "L-Soft list server at MITVMA.MIT.EDU (1.8e)"
             <RemoveMELISTSERVspamspamBeGoneMITVMA.MIT.EDU>
Subject: PICLIST: error report from NT.MASSMIND.ORG
To:           spamBeGonelistsjoshKILLspamspam@spam@3MTMP.COM,
             "For Blackholeeclipsespam_OUTspam@spam@Earthlink.Net" <spamBeGonepiclist_errors@spam@spamSYMPATICO.CA>
Message-ID:   <LISTSERV%RemoveME2004012810033361EraseMEspamKILLspamMITVMA.MIT.EDU>
X-LSV-ListID: None

The enclosed message has been identified as a delivery error for the PICLIST
list because it was sent to 'spamBeGoneowner-piclistspam_OUTspamRemoveMEMITVMA.MIT.EDU'.

------------------------------ Message in error -------------------------------
Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail
         V1.2d/1.8d) with BSMTP id 4055; Wed, 28 Jan 2004 10:03:34 -0500
Received: from nt.massmind.org [66.13.172.18] by mitvma.mit.edu (IBM VM SMTP
         Level 430) via TCP with SMTP ; Wed, 28 Jan 2004 10:03:33 EST
X-Comment: mitvma.mit.edu: Mail was sent by nt.massmind.org
To: .....owner-piclistspamRemoveMEMITVMA.MIT.EDU
From: Mail Administrator<Postmasterspam@spam@nt.massmind.org>
Reply-To: Mail Administrator<EraseMEPostmasterRemoveMEspamSTOPspamnt.massmind.org>
Subject: Mail System Error - Returned Mail
Date: Wed, 28 Jan 2004 06:54:54 -0800
Message-ID: <RemoveME20040128145454576.AAD388KILLspamspamTakeThisOuTnt.massmind.org>> MIME-Version: 1.0
Content-Type: multipart/mixed;
               Boundary="===========================_ _= 75988(388)"
Content-Transfer-Encoding: 7BIT


--===========================_ _= 75988(388)
Content-Type: text/plain

This Message was undeliverable due to the following reason:

This message passed through a number of mail servers
greater than the maximum number specified in the
Maximum MTA Hops field. This probably indicates that
there are accounts on separate machines that forward
mail to each other.

There may also be a problem with the host address or
Domain Name System records.

Maximum Hops: 15

Please reply to
spamBeGonePostmasterspam@spam@nt.massmind.org
if you feel this message to be in error.


--===========================_ _= 75988(388)
Content-Type: message/rfc822

Received: from cherry.ease.lsoft.com ([209.119.0.109]) by nt.massmind.org
         (Post.Office MTA v3.5.3 release 223 ID# 0-12345L500S10000V35)
         with ESMTP id org for <RemoveMEarchivespam_OUTspamPICLIST.ORG>;
         Fri, 23 Jan 2004 06:30:21 -0800
Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com (LSMTP for Digital Unix v1.1b) with SMTP id <9.00CB2CEAspamspamcherry.ease.lsoft.com>; Fri, 23 Jan 2004 9:32:27 -0500
Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e)
         with spool id 1460 for spam_OUTPICLISTspam_OUTspamspam_OUTMITVMA.MIT.EDU; Fri, 23 Jan 2004
         09:32:21 -0500
Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail
         V1.2d/1.8d) with BSMTP id 0725; Fri, 23 Jan 2004 09:30:36 -0500
Received: from audiomind.dk [213.237.88.238] by mitvma.mit.edu (IBM VM SMTP
         Level 430) via TCP with ESMTP ; Fri, 23 Jan 2004 09:30:35 EST
Received: from winbox.Audiomind.local (192.168.2.3:8166) by audiomind.dk with
         [XMail 1.16 (Linux/Ix86) ESMTP Server] id <SD68C> for
         <PICLISTspam_OUTspamMITVMA.MIT.EDU> from <RemoveMEPICLISTKILLspamspam@spam@MITVMA.MIT.EDU>; Fri, 23 Jan
         2004 15:25:23 +0100
Received: from mail pickup service by winbox.Audiomind.local with Microsoft
         SMTPSVC; Fri, 23 Jan 2004 15:24:40 +0100
Received: from audiomind.dk ([192.168.2.6]) by winbox.intra.audiomind.dk with
         Microsoft SMTPSVC(6.0.3790.0); Tue, 20 Jan 2004 12:25:50 +0100
Received: from cherry.ease.lsoft.com (209.119.0.109:5911) by audiomind.dk with
         [XMail 1.16 (Linux/Ix86) ESMTP Server] id <SCF22> for
         <sorenspamBeGonespam.....AUDIOMIND.DK> from <KILLspamowner-piclistspam.....MITVMA.MIT.EDU>; Mon, 19 Jan
         2004 06:13:43 +0100
Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com
         (LSMTP for Digital Unix v1.1b) with SMTP id
         <spam_OUT3.00CAAE0FspamKILLspamcherry.ease.lsoft.com>; Mon, 19 Jan 2004 0:08:17 -0500
Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e)
         with spool id 3121 for RemoveMEPICLISTRemoveMEspamEraseMEMITVMA.MIT.EDU; Mon, 19 Jan 2004
         00:08:11 -0500
Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail
         V1.2d/1.8d) with BSMTP id 6235; Sun, 18 Jan 2004 23:59:00 -0500
Received: from extsmtp2.localnet.com [207.251.201.58] by mitvma.mit.edu (IBM VM
         SMTP Level 430) via TCP with SMTP ; Sun, 18 Jan 2004 23:58:59 EST
Received: (qmail 11709 invoked from network); 19 Jan 2004 05:00:26 -0000
Received: from unknown (HELO smtp2.localnet.com) (10.0.7.15) by
         extsmtp2.localnet.com with SMTP; 19 Jan 2004 05:00:26 -0000
Received: (qmail 9900 invoked from network); 19 Jan 2004 04:59:01 -0000
Received: from unknown (HELO kmp) (63.246.198.41) by mail1.localnet.com with
         SMTP; 19 Jan 2004 04:59:01 -0000
X-Comment: mitvma.mit.edu: Mail was sent by audiomind.dk
X-Comment: mitvma.mit.edu: Mail was sent by extsmtp2.localnet.com
X-AV-Scanned: yes  5cc6ec58a9926847ccacb774ec37fd76
X-AV-Scanned: yes  2fa750440ffecf083577533932cc019f
X-Deliver-To: KILLspamsorenspamspamBeGoneaudiomind.dk
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Precedence: list
X-OriginalArrivalTime: 20 Jan 2004 11:25:50.0426 (UTC)
                      FILETIME=[285BF3A0:01C3DF48]
Message-ID:  <KHEAKGMGPPBIPOHGAOODIEAPCMAA.no_spamspamspamlocalnet.com>> Date:         Sun, 18 Jan 2004 23:59:10 -0500
Reply-To:     pic microcontroller discussion list <
RemoveMEPICLISTspamBeGonespamRemoveMEMITVMA.MIT.EDU>
Sender:       pic microcontroller discussion list <KILLspamPICLISTspamBeGonespamMITVMA.MIT.EDU>
From:         Ken Pergola <@spam@no_spamSTOPspamspam@spam@LOCALNET.COM>
Subject: Re: [EE]: NEC's version of the Intel 8255 Programmable Peripheral Interface
To:           PICLISTspamBeGonespamspamBeGoneMITVMA.MIT.EDU
In-Reply-To:  <016c01c3de46$4209c780$6564a8c0@engineering>

Edward Gisske wrote:

> I have a 1990 NEC V-Series Microprocessor Data Book that has a 20-page
> write-up on the uPD71055C-10. I can fax you a copy or look something up if
> you want

Hi Edward,

Thanks for your response.

I'm sending you an e-mail in private offline...


Best regards,

Ken Pergola

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--===========================_ _= 75988(388)--

.

2004\01\30@171529 by John N. Power

flavicon
face
> From:         Jim Korman[SMTP:spamBeGonejkormanspamALLTEL.NET]
> Sent:         Wednesday, January 28, 2004 8:27 PM
> To:   spam_OUTPICLISTSTOPspamspamMITVMA.MIT.EDU
> Subject:      Re: [PIC:] divide by 10 question

> Michael Rigby-Jones wrote:

>>{Original Message removed}

2004\01\30@191611 by John N. Power

flavicon
face
> From:         John N. Power[SMTP:RemoveMEjpowerspamspamBCPL.NET]
> Sent:         Friday, January 30, 2004 3:35 PM
> To:   TakeThisOuTPICLISTspamspamRemoveMEMITVMA.MIT.EDU
> Subject:      Re: [PIC:] divide by 10 question.


     It should be obvious from the context, but my previous post had an
     omission:

> Pseudo code statement of the process: (see following paragraph for
> statement about number format.)

> B = N + (N >> 1);
> for ( i = 0, quotient = 0; i < MAX_ITERS; i++ ) {
>     quotient = quotient + (B >> 4);
> }

     Should be:

B = N + (N >> 1);
for ( i = 0, quotient = 0; i < MAX_ITERS; i++ ) {
    quotient = quotient + (B >> 4);
          B = (B >> 4 );
}

John Power

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservspamspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

.

2004\01\30@215441 by William Chops Westfield

face picon face
On Friday, Jan 30, 2004, at 14:31 US/Pacific, John N. Power wrote:

>> Subject:      Re: [PIC:] divide by 10 question.
>>
At some point, it seems simpler to implement a general purpose
divide function.  I was a bit shocked that the JAL compiler's
idea of division is a repeated subtraction loop, but you know,
if you're talking about an 8 bit integer divided by a number
like "10", it's really not bad at all.  In fact, I've come
to think the subtraction for divide is pretty clever.  Certainly
nice and small!  If you're talking about display output (where
divide by 10 usually happens), speed is not likely to be an issue.

BillW

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservRemoveMEspammitvma.mit.edu with SET PICList DIGEST in the body

.

2004\01\31@040340 by Wouter van Ooijen

face picon face
> At some point, it seems simpler to implement a general purpose
> divide function.  I was a bit shocked that the JAL compiler's
> idea of division is a repeated subtraction loop

Before everyone thinks Jal can not do otherwise: one of the things the
GPL-Jal maintainers did was to separate the run-time functions into a
separate file so the user can change the implementation of *, / and %.
So if you don't like repeated substraction have it your way (or maybe it
has already been changed - check the latest sourceforge Jal
distribution).

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestSTOPspamspamRemoveMEmitvma.mit.edu

.


'[PIC:] divide by 10 question'
2004\02\02@160711 by Daniel Serpell
flavicon
face
El Fri, Jan 30, 2004 at 05:31:39PM -0500, John N. Power escribio:
>
>       Should be:
>
> B = N + (N >> 1);
> for ( i = 0, quotient = 0; i < MAX_ITERS; i++ ) {
>      quotient = quotient + (B >> 4);
>            B = (B >> 4 );
> }
>

Note that your routine, as writen, gives bad output for
a number of input data, ie: 10

B = 10 + 5 = 15
loop
  q = 0 + 15/16 = 0
  B = 15 / 16 = 0

 ...

q is always 0.

That's the problem with many algorithms that treat
division as multiplication by constants (you are
multiplying by 0.001100110011....), roundolf errors.

For a good introduction to reciprocal multiplication,
see: http://www.cs.uiowa.edu/~jones/bcd/divide.html


   Daniel.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\02\04@155119 by John N. Power

flavicon
face
> From:         Daniel Serpell[SMTP:spam_OUTdanielRemoveMEspamEraseMEATMLAB.UTFSM.CL]
> Sent:         Monday, February 02, 2004 4:06 PM
> To:   TakeThisOuTPICLISTRemoveMEspam@spam@MITVMA.MIT.EDU
> Subject:      Re: [PIC:] divide by 10 question

> El Fri, Jan 30, 2004 at 05:31:39PM -0500, John N. Power escribio:
>>
>>       Should be:
>>
>> B = N + (N >> 1);
>> for ( i = 0, quotient = 0; i < MAX_ITERS; i++ ) {
>>      quotient = quotient + (B >> 4);
>>            B = (B >> 4 );
>> }
>>

> Note that your routine, as writen, gives bad output for
> a number of input data, ie: 10
. . . .

> That's the problem with many algorithms that treat
> division as multiplication by constants (you are
> multiplying by 0.001100110011....), roundolf errors.

My original post labelled the code as "pseudo code" and
referred the reader to a following paragraph which identified
the need for carrying a fractional part. The above post
was just a correction to the original program.

John Power

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservRemoveMEspammitvma.mit.edu with SET PICList DIGEST in the body

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...