View Single Post
  #1   Spotlight this post!  
Unread 04-01-2008, 21:50
comphappy comphappy is offline
Registered User
AKA: Brennan Ashton
FRC #2605 (A2D_16)
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Bellingham, WA
Posts: 157
comphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to behold
Send a message via AIM to comphappy
Re: How does division work?

If you need the extra places the most efficient way to do it will be to bit shift the dividend, and remember that any time you need to do a calculation, you need to bit shift the result back. using bit shift instead of multiplying by something like 10 will save you a few clock cycles.

multiplication 8-bit by 8-bit method (if you multiply by an arbitrary value such as 10)
see here http://www.dcc.unicamp.br/~celio/mc4...los/mul8x8.asm

Program Memory : 14 locations
# of cycles : 71
RAM : 5 locations
That is a really big waist

bit shift method
c equivalent
x<<1;

can be done with the single asm command lrol (load and rotate left)