please dont rip this site
Home About Projects PIC code SX code

Most of this code has originated from requests and challenges on the PICList mailing list.

I tried to debug the routines as much as possible (for a hobby), but no guarantees. In case you find a bug, please let me know.

Please send any questions or comments to golovchenko@mail.ru, or the PICList, as many nice folks hang around there and most probably will be glad to help you.

Routine Name Size, instructions Max timing, cycles Temporary registers Notes
Multiplication
24 by 24 bits 29 513 1
Division
8 by 8 bits to 24 bit floating point 41 413 1
16 by 8 bits with Q16.16 fixed point result 39 460 1
24 by 16 bits (and 24 by 15) 27/28 584/581 3
32 by 16 bits using 16 by 16 bits with a 16 bit result 36 345 2/4
48 by 24 bits (and 48 by 23) 58/51 1458/1266 5/4 my versions at the bottom
Scaled 8 bit: x 256*x/y 28 281 3
Approximate 8 bit reciprocal: 32768/x 19 47 0
Divide 14 bit integer using a fixed point divisor and result (7Q8 format) 27 264 0
Square
10 bits 68 70 0 this is a debugged John Payson's version
Routine Name Size, instructions Max timing, cycles Temporary registers Notes
Square Root
24 bit floating point 85 406 6 IEEE<>Microchip format conversion
12 bit integer 32 118 3
8 bit 20 66 2
8 bit fast 53 19 0
8 bit small 9 87 0 Idea from Scott Dattalo, tweak by Dmitry Kiryashov
Powers and logarithms
Fixed point Q0.16 log2x 105 323 3 also notes on xy
Fixed point Q6.10 2x 121 291 4
CORDIC
Vector magnitude, 16 bits 147 ~1600/800 4
Routine Name Size, instructions Max timing, cycles Temporary registers Notes
Radix Conversion
16 bit binary to 5 digit decimal 68 226 0 strips a digit at a time
16 bit binary to 3 digit decimal 34 108 0 based on John Payson's 5 digit version
16 bit binary to 3 digit decimal 56 57 0 based on Scott Dattalo's 8 bit BIN2BCD
5 digit decimal to 16 bit binary 35 36 0
5 digit decimal (BCD) to 16 bit binary 23 341 1
Miscellaneous
8 bit random number generator 10 10 0 my version at the bottom
Delay exactly N cycles - - 0 scalable for any N size
Routine Name Size, instructions Max timing, cycles Temporary registers Notes

Questions:

Says: Vittorio Capini replies: hi Mr. Nikolai. In the code "Fixed Point Q(0.16) log2(x) I do not understand how to build the table, starting from the relationship [log2(0.5)-log2(0.5:0.5/16:1)]. what is it log2(0.5:0.5/16:1) ? can you take an example.+

+

See

Vittorio Capini Says: +


file: /Techref/member/NG--944/pic_collection.htm, 21KB, , updated: 2016/7/29 00:27, local time: 2024/11/15 00:22, owner: NG--944,
TOP NEW HELP FIND: 
18.119.132.236:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.ecomorder.com/techref/member/NG--944/pic_collection.htm"> PIC Code Collection</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?