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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/07/02 23:19
Read: times


 
#21531 - RE: Spread Sheet in 8052 for quick table.
"You'll use quite a bit of code space for the tables but then again it should prove to be very fast opposed to doing hundreds of comparisons"

If you do loads of comparisons, then the time taken to determine the result will depend on just how many comparisons fail before the match is found; ie it will be variable.
Using a table lookup, the time to find a result from the table will be the same for all values.

Which of these is "best" depends on the specific criteria in your particular case; eg, if your input values are generally only within a restricted band, then you may be able to reduce your average lookup time by using comparisons and ensuring that the commonest values match first;
If, on the other hand, consitent timing across the whole range is important - then the table wins.
etc, etc

List of 6 messages in thread
TopicAuthorDate
Spread Sheet in 8052 for quick table.            01/01/70 00:00      
RE: Spread Sheet in 8052 for quick table.            01/01/70 00:00      
RE: Spread Sheet in 8052 for quick table.            01/01/70 00:00      
RE: Spread Sheet in 8052 for quick table.            01/01/70 00:00      
RE: Spread Sheet in 8052 for quick table.            01/01/70 00:00      
RE: Spread Sheet in 8052 for quick table.            01/01/70 00:00      

Back to Subject List