Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/23/98 00:05
Read: times


 
#109 - RE: 24bit MATH Routines
What in fact do you need? Complete math routines or maybe only some of them? I've implemented in one project digital filtering and had to use 24 bit math that was in fact fixed point arithmetic.

How did I program 24 bit multiplication?
I was simulating this multiplication using available 8051 instructions MUL, ADD and ADDC. 8 bit multiplication is hardware supported, so you have to split 24 bit multiplication into a couple of 8 bit multiplications and then use addition to ad partial results to result (the principles are the same as hand multiplication in decimal notation) . My advice is, try this on paper by explicitly writing and then try to code this in assembly language. Use registers as much as you can to optimize code size and speed. Using XCH instruction is a good choice for exchanging data (partial 8 bit results) with registers (it replaces 2 MOV instructions and therefore you get 1 machine cycle).
Finnaly check your math using a PC based simulator-debugger and verify math results.

List of 6 messages in thread
TopicAuthorDate
24bit MATH Routines            01/01/70 00:00      
RE: 24bit MATH Routines            01/01/70 00:00      
RE: 24bit MATH Routines            01/01/70 00:00      
RE: 24bit MATH Routines            01/01/70 00:00      
RE: 24bit MATH Routines            01/01/70 00:00      
RE: 24bit MATH Routines            01/01/70 00:00      

Back to Subject List