Microprocessor 4. Philippe Darche

Чтение книги онлайн.

Читать онлайн книгу Microprocessor 4 - Philippe Darche страница 14

Microprocessor 4 - Philippe Darche

Скачать книгу

(cf. § 3.1 from Darche (2003)). Thus, the microcontroller 68HC12 from the MC6800 family from Motorola has the instructions bclr (bit clear) and bset (bit set) that initialize respectively at 0 or at 1 one position bit specified with the help of a binary mask (see exercise E2.4) in an address word A. These instructions use this mode associated with pre-studied conventional addressing modes. It should be noted that the addressing space is limited compared to other modes. The example in Figure 1.22 shows a reset at 0 for the MSb (Most Significant bit) of an I/O port in byte format implanted at the address 0F16.

Schematic illustration of the execution of an instruction in bit addressing.

      Figure 1.22. Execution of an instruction in bit addressing

      1.2.4.4. MMR addressing

      1.2.4.5. Addressing modes specific to the digital signal processor

      Other than indirect register addressing with post- or pre-increment/decrement, two other modes are particularly adapted to digital signal processing, which justifies their implementation in DSPs. This is circular addressing and (address) bit-reversed addressing.

      1.2.4.5.1. Circular addressing

      Digital signal processing consists of digitizing samples xi (i ∈ [0, ∞]) of the signal that are stored in memory, then carrying out a mathematical processing such as filtering on them to then reconstruct the analog signal. To simplify the discourse, memorization of coefficients needed for the calculation is not attempted. The sample flow is of infinite length, and the calculation is only made on a limited number of consecutive samples on the sampled sequence. This set is called a “window”. Linear addressing of the buffer FIFO (First In, First Out) illustrated in Figure 1.23a is not well adapted as it is necessary to test whether the pointers have reached the end. Moreover, the size of the buffer is necessarily high. The circular buffer (ring or cyclic buffer, circular queue), that Figure 1.23b shows, is a much better solution as it makes it possible to decrease its size to that of the window of samples needed for the calculation.

Schematic illustration of (a and b) the window of five samples.

      Figure 1.23. Window of five samples

Schematic illustration of a circular buffer.

      Figure 1.24. Circular buffer

      This is conveyed in algorithmic form by:

      0 < |M| ≤ L

      I ← I + M

      if M > 0

      then

      1 if I ≥ B + L

      2 then I ← I - L; buffer overflow or overflow from above

      3 end_if

      otherwise

      1 if I < B

      2 then I ← I + L; buffer overflow or overflow from below

      3 end_if

      4 end_if

Schematic illustration of the comparison between linear and circular addressings.

      Figure 1.25. Comparison between linear and circular addressings (from Rao (2001))

      The use domain is digital signal filtering carried out by a DSP where digital values, the results of a quantification of an analog signal, are stored in a delay line that can be implemented with a circular buffer in place of carrying out costly temporal shifts. The DSP ADSP-210xx family from Analog Devices uses this mode. One example of use is implementation of a Finite Impulse Response (FIR) described in § V3-5.2.

      1.2.4.5.2. Reverse bit order addressing

Скачать книгу