Altera_Forum
Honored Contributor
9 years agoTiming calculation help!
Hi, I'm new to nios. I'm writing an app to calculate position of a moving point.
S = S0 - v*t. I need help to implement the t value. I'm thinking of using for loop for (t=0;t<1000;t++) { S = S0 - v*t; } As I understand, each t increase will be equivalent to 1 clock cycle so it will be 20ns (my clock is 50MHz). So if I want t to calculate in second I must do it like this: S = S0 - v*t*20/1000,000,000 Is it usable or I must use timer interval core?