4.4.4.1 Bit-Reversed Addressing Implementation
Bit-Reversed Addressing mode is enabled in any of these situations:
- BWMx bits (W register selection) in the MODCON register are any value
other than ‘
1111
’ (the stack cannot be accessed using Bit-Reversed Addressing) - The BREN bit is set in the XBREV register
- The addressing mode used is Register Indirect with Pre-Increment or Post-Increment
If the length of a bit-reversed buffer is M = 2N bytes, the last ‘N’ bits of the data buffer start address must be zeros.
The XB[14:0] bits are the Bit-Reversed Addressing modifier, or ‘pivot point’, which is typically a constant. In the case of an FFT computation, its value is equal to half of the FFT data buffer size.
When enabled, Bit-Reversed Addressing is executed only for Register Indirect with Pre-Increment or Post-Increment Addressing and word-sized data writes. It does not function for any other addressing mode or for byte-sized data and normal addresses are generated instead. When Bit-Reversed Addressing is active, the W Address Pointer is always added to the address modifier (XB) and the offset associated with the Register Indirect Addressing mode is ignored. In addition, as word-sized data are a requirement, the LSb of the EA is ignored (and always clear).
If Bit-Reversed Addressing has already been enabled by setting the BREN (XBREV[15]) bit, a write to the XBREV register should not be immediately followed by an indirect read operation using the W register that has been designated as the Bit-Reversed Pointer.
Normal Address | Bit-Reversed Address | ||||||||
---|---|---|---|---|---|---|---|---|---|
A3 | A2 | A1 | A0 | Decimal | A3 | A2 | A1 | A0 | Decimal |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 8 |
0 | 0 | 1 | 0 | 2 | 0 | 1 | 0 | 0 | 4 |
0 | 0 | 1 | 1 | 3 | 1 | 1 | 0 | 0 | 12 |
0 | 1 | 0 | 0 | 4 | 0 | 0 | 1 | 0 | 2 |
0 | 1 | 0 | 1 | 5 | 1 | 0 | 1 | 0 | 10 |
0 | 1 | 1 | 0 | 6 | 0 | 1 | 1 | 0 | 6 |
0 | 1 | 1 | 1 | 7 | 1 | 1 | 1 | 0 | 14 |
1 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 1 | 1 |
1 | 0 | 0 | 1 | 9 | 1 | 0 | 0 | 1 | 9 |
1 | 0 | 1 | 0 | 10 | 0 | 1 | 0 | 1 | 5 |
1 | 0 | 1 | 1 | 11 | 1 | 1 | 0 | 1 | 13 |
1 | 1 | 0 | 0 | 12 | 0 | 0 | 1 | 1 | 3 |
1 | 1 | 0 | 1 | 13 | 1 | 0 | 1 | 1 | 11 |
1 | 1 | 1 | 0 | 14 | 0 | 1 | 1 | 1 | 7 |
1 | 1 | 1 | 1 | 15 | 1 | 1 | 1 | 1 | 15 |