16 bit division with high precision problem?

OP (Company: frau) #584519
Rate this post
• ▲ useful
▼ not useful
Hi, all

I use mega128 to control ad5933 chip, since now it's the last step of my 
whole project, sticking with assembly language is a better option.

I am doing damage matrix between two column of data, after I simplified 
the equation, actually I just need to calculate undamage/damage, they 
are all 16bit numbers, and because they are very close numbers, I have 
to divide out 4 or 5 decimal until I can see the difference, for 
instance(I calculated in MATLAB):

UN_1/DA_1 = 0.9993
UN_2/DA_2 = 1.0208

etc...

1. I read AVR200 unsigned 16bits division carefully, I think I can put 
the decimal in the remainder, right?
Later I will do (UN/DA)^2, assume I already save UN/DA, since mega128 
has fractional multiplication, I'd like to take advantage of it. so how 
could I convert this remainder into fractional.

2. And how many digits of remainder I need to reserve for this 
precision.

Hope someone with experience could explain to me my questions, I am 
really getting lost right now.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.