Freescale Semiconductor SC140 specifications Multiple Wrap-Around Modulo Addressing Mode

Models: SC140

1 760
Download 760 pages 48.94 Kb
Page 79
Image 79

Address Generation Unit

Table 2-21 describes the modulo register values and the corresponding address calculation.

Table 2-21. Modulo Register Values for Modulo Addressing Mode

Modifier Mj

Address Calculation Arithmetic

 

 

 

 

$0000 0000

Unused

 

 

$0000 0001

Modulo 1

 

 

$0000 0002

Modulo 2

 

 

$7FFF FFFE

Modulo 231-2

$7FFF FFFF

Modulo 231-1

2.3.4.4 Multiple Wrap-Around Modulo Addressing Mode

Multiple wrap-around addressing is useful for decimation, interpolation, and waveform generation. The multiple wrap-around capability can be used for argument reduction. In multiple wrap-around modulo addressing mode, the modulus M is a power of 2 in the range of 21 to 231. The value M-1 is stored in the modifier register (Mj). The B registers B0 to B7 are not used for multiple wrap-around modulo addressing; therefore, their corresponding R8–R15 registers can be used for linear addressing.

The lower and upper boundaries are derived from the contents of Mj. The lower boundary (base address) value has zeros in the k LSBs where M = 2k and therefore must be a multiple of M. The Rn register involved in the memory access is used to set the MSBs of the base address. The base address is set so that the initial value in the Rn register is within the lower and upper boundaries. The upper boundary is the lower boundary plus the modulo size minus one (base address + M–1).

The size of the modulo buffer must be aligned to (be a multiple of) the access width. If the modulus is less than the access width, the data accessed as well as the address calculations are undefined.

If an offset Ni is used in the address calculations, it is not required to be less than or equal to M for proper modulo addressing. The multiple wrap-around modulo addressing mode supports unlimited boundary wraps.

When using the (Rn)+ and (Rn)- addressing modes with a modulus 2k ≥ 8, there is no functional difference between the multiple wrap-around and normal modulo modes since the address can only be wrapped around once.

As an example, consider the instruction move.w (r0 + $0042),d0. If the mctl is set to $000c, and m0 is set to $000f, then M0 = 16. If r0 is initially $24 (36), the lower boundary is $20 (32) and the upper boundary is $2f (47). The memory access is done from address $26 (38), calculated by 36 + 66 = 102, 102–48=54, 54–3x16=6, 6+32=38.

SC140 DSP Core Reference Manual

2-47

Page 79
Image 79
Freescale Semiconductor SC140 Multiple Wrap-Around Modulo Addressing Mode, Modifier Mj Address Calculation Arithmetic