Searching \ for 'General calculation type question' in subject line. ()
Help us get a faster server
FAQ page: massmind.org/techref/index.htm?key=general+calculation
Search entire site for: 'General calculation type question'.

Truncated match.
'General calculation type question'
2000\02\03@033943 by

Well I just flipped through the pages of the 16F876 data sheet and didn't
find anything to give insight into this (maybe because it's late and my eyes
hurt) but this should be a question that someone can easily answer.

What is the data path size of the ALU?  ie how many bits at a time can be
used in calculations?

With 8 bits I can calculate using decimal numbers up to 255, but what
happens when I want to multiply 255 by 255 (square a number) which is
somewhere over decimal 65000 I think, however many bits that would
take....can I do that with no worries?  I don't really need any final
results larger than decimal 255 I think, after all my calculations are done,
so I'm ok for moving 8 bits to the output ports in the end, but what I'm
doing is having 2 separate numbers each between 0 and 255 decimal, and I
want to add, multiply , subtract, and divide with them where I'll need
numbers up around 65000 decimal and eventually those numbers reduce back
down below 255 and I get my analysis final result.

So if I have 16 bits available for math operations in the PIC, I can use up
to decimal 65535 (or is that 65536?) either way my intermediate numbers fall
within 16 bits and I'm hoping I can do this.

part 0 4460 bytes
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">All the PIC's have 8 bit ALU's.&nbsp; So the maximum number you can handle in any *one* operation is 255.&nbsp; To perform 16 bit and above operations, you simply have to work on the numbers a byte at a time.&nbsp; Numbers larger than 8 bits are stored in successive memory locations.</FONT></P>

<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">There are hundreds of examples of 16 bit math operations on the web.&nbsp; Myke Predko has a nice page at<U> <A HREF="http://www.myke.com/PICMicro/16bit.htm" TARGET="_blank">http://www.myke.com/PICMicro/16bit.htm</A></U></FONT></P>

<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Regards</FONT>
</P>

<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Mike Rigby-Jones</FONT>
</P>
<UL>
<P><FONT SIZE=1 FACE="Arial">{Original Message removed}

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