The pre-adder can be reused as a 2:1 multiplexer to select between the A[26:0] and D[26:0], useful for connecting ping-pong buffers implemented in the programmable logic (PL) memory. The idea is to make the pre-adder perform either A + 0, or 0 + D, where A receives data from the ping buffer and D receives data from the pong buffer. See the following figure. The following configurations are included.
- Configure AMULT to receive data from AD_DATA with AMULTSEL.
- Configure the pre-adder to select A2A1 with PREADDINSEL because B is narrower than A.
- Configure the pre-adder to the add mode with INMODE so that the pre-adder to compute either A + 0, or 0 + D.
- Connect the A-D multiplexer select pin from the PL to both INMODEA and INMODE. When these signals are both 0, A is selected to go to AMULT, the input of the vector multiplier; when they are both 1, D is selected.
Note: The pre-adder must not be used for selecting between B and D because B only has 24 bits whereas D has 27 bits.
Figure 1. Hierarchical View of the DSP58 Input Registers and Pre-Adder as a Multiplexer