Digital Signal Processing Reference
In-Depth Information
3.7 LINEAR AND CIRCULAR ADDRESSING MODES
Addressing modes determine how one accesses memory. They specify how data are
accessed, such as retrieving an operand indirectly from a memory location. Both
linear and circular modes of addressing are supported. The most commonly used
mode is the indirect addressing of memory.
3.7.1 Indirect Addressing
Indirect addressing can be used with or without displacement. Register R repre-
sents one of the 32 registers A0 through A15 and B0 through B15 that can specify
or point to memory addresses. As such, these registers are pointers. Indirect address-
ing mode uses a “*” in conjunction with one of the 32 registers. To illustrate, con-
sider R as an address register.
1. *R. Register R contains the address of a memory location where a data value
is stored.
2. *R
(d). Register R contains the memory address (location). After the
memory address is used, R is postincremented (modified) such that the new
address is the current address offset by the displacement value d. If d
++
=
1 (by
default), the new address is R
1, or R is incremented to the next higher
address in memory. A double minus (
+
) instead of a double plus would
update or postdecrement the address to R
--
-
d.
3. *
R(d). The address is preincremented or offset by d, such that the current
address is R
++
d. A double minus would predecrement the memory address
so that the current address is R
+
-
d.
4. *
+
R(d). The address is preincremented by d, such that the current address is
R
d (as with the preceding case). However, in this case, R preincrements
without modification. Unlike the previous case, R is not updated or modified.
+
3.7.2 Circular Addressing
Circular addressing is used to create a circular buffer. This buffer is created in hard-
ware and is very useful in several DSP algorithms, such as in digital filtering or cor-
relation algorithms where data need to be updated. An example in Chapter 4
illustrates the implementation of a digital filter in assembly code using a circular
buffer to update the “delay” samples. Implementing a circular buffer using C code
is less efficient.
The C6x has dedicated hardware to allow a circular type of addressing. This
addressing mode can be used in conjunction with a circular buffer to update samples
by shifting data without the overhead created by shifting data directly. As a pointer
Search WWH ::




Custom Search