Wrapping To A Different Bank - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

2. Find the nearest power of two greater than or equal to the circular buffer size. In this
example, the value would be 2
3. From k, derive the characteristics of the lower boundary of the circular buffer. Since the "k"
least-significant bits of the address of the lower boundary must all be 0s, then the buffer
base address must be some multiple of 2
6
multiple of 2
= 64.
4. Locate the circular buffer in memory.
— The location of the circular buffer in memory is determined by the upper 16 - k bits of the
address pointer register used in a modulo arithmetic operation. If there is an open area of
memory from locations 111 to 189 ($006F to $00BD), for example, then the addresses of the
lower and upper boundaries of the circular buffer will fit in this open area for J = 2:
Lower boundary = (J x 64) = (2 x 64) = 128 = $0080
Upper boundary = (J x 64) + 36 = (2 x 64) + 36 = 164 = $00A4
— The exact area of memory in which a circular buffer is prepared is specified by picking a value
for the address pointer register, R0 or R1, whose value is inclusively between the desired lower
and upper boundaries of the circular buffer. Thus, selecting a value of 139 ($008B) for R0
would locate the circular buffer between locations 128 and 164 ($0080 to $00A4) in memory
since the upper 10 (16 - k) bits of the address indicate that the lower boundary is 128 ($0080).
— In summary, the size and exact location of the circular buffer is defined once a value is assigned
to the M01 register and to the address pointer register (R0 or R1) that will be used in a modulo
arithmetic calculation.
5. Determine the upper boundary of the circular buffer, which is the lower boundary + #
locations - 1.
6. Select a value for the offset register if it is used in modulo operations.
— If the offset register is used in a modulo arithmetic calculation, it must be selected as follows:
|N| ≤ M01 + 1 [where |N| refers to the absolute value of the contents of the offset register]
— The special case where N is a multiple of the block size, 2

"Wrapping to a Different Bank."

7. Perform the modulo arithmetic calculation.
— Once the appropriate registers are set up, the modulo arithmetic operation occurs when an
instruction with any of the following addressing modes using the R0 (or R1, if enabled) register
is executed:
(Rn)
(Rn)+
(Rn)-
(Rn)+N
(Rn+N)
(Rn+xxxx)
— If the result of the arithmetic calculation would exceed the upper or lower bound, then wrapping
around is correctly performed.
4.3.2.6
Wrapping to a Different Bank
For the normal case where |N| is less than or equal to M01, the primary address arithmetic unit will
automatically wrap the address pointer around by the required amount. This type of address modification is
useful in creating circular buffers for FIFOs, delay lines, and sample buffers up to 16,384 words long. It is
also used for decimation, interpolation, and waveform generation.
≥ 37, which gives us a value of k = 6.
k
k
. In this case, k = 6, so the base address is some
Address Generation Unit
AGU Address Arithmetic
k
, is discussed in Section 4.3.2.6,
4-31

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents