
Memory and performance trade-offs 363
case timing has to be assumed, even though statistically the
routine will execute faster 99.999% of the time!
Using on-chip memory
Some microcontrollers and DSP chips have local memory
which can be used to store data or instructions and thus offers fast
local storage. Any access to it will be fast and thus data and code
structures will always gain some benefit if they are located here.
The problem is that to gain the best benefit, both the code and data
structures must fit in the on-chip memory so that no external
accesses are necessary. This may not be possible for some pro-
grams and therefore decisions have to be ...