–4–
ZALR <data memory address>
ADD <data memory address>
For the result to be used as an input value for anything
other than another ALU operation, the data must first be
stored back into data memory from the accumulator.
Not all ALU operations can be performed in a single
35 ns cycle; an add as shown above can be accom-
plished every two cycles. All references to TMS320C50
cycles assume a 28.57 MHz device with a 35 ns cycle
time. Not all ALU instructions (i.e., ADD #k, SUB #k,
ADD #lk, SUB #lk, ADRK) can be used with the repeat
feature.
ADSP-2115 MAC
As shown in Figure 1, the ADSP-2115 multiplier/accumu-
lator (MAC) sits next to the ALU. Like the ALU, it has two
X and two Y input registers, MX0, MX1 and MY0, MY1.
The unit performs both multiplications and MACs inde-
pendent of the ALU. This is a key difference from the
architecture of the TMS320C50.
MAC operations are performed on any X-Y assortment
of input registers. They may be loaded from any combi-
nation of program and data memory or other data regis-
ters in the processor. The result of the operation appears
in the MAC result register (MR) or the MAC feedback
register (MF). Like the ALU, the feedback and result reg-
isters can also serve as the X and Y inputs for any multi-
plication or MAC operation. The result registers of the
barrel shifter and ALU can also be used directly as X in-
puts to the MAC (and vice versa).
The instructions for the MAC are specified in a register
transfer, algebraic syntax. An example is shown below.
The first line shows multiplication of two signed oper-
ands and the second example shows multiplication with
accumulation of one signed and one unsigned operand.
(Signed and unsigned operands can be mixed in any
combination.)
The second example is a multifunction instruction. The
first “clause” of the instruction (up to the first comma) is
the MAC operation. The second clause loads the X input
register from data memory (DM) and the third clause
loads the Y input from program memory. Any MAC
operation can be executed on a sustained, single-cycle
basis. (These operand fetching clauses of the instruction
may be omitted, if they are not needed, as in the first
example.)
MR=MX0*MY0 (SS)
MR=MR+MX1*MY1(SU), MX1=DM(I0,M0), MY1=PM(I4,M4)
The MR (MAC result) register is actually a 40-bit accu-
mulator. It is divided into two 16-bit pieces (MR0 and
MR1) and an 8-bit overflow register (MR2). DSP applica-
tions frequently deal with numbers over a large dynamic
range. The eight “overflow” bits of MR2 allow for 256
MAC overflows before a loss of data can occur. The
MAC also supports multiprecision operations as well as
automatic unbiased rounding.
All multiplication and MAC operations execute in a
single 50 ns cycle. (Please consult an
ADSP-21xx Data
Sheet
for the most recent specifications.) Two new
operands can be loaded into the input registers in paral-
lel with the computation so that a new MAC operation
with new operands can be started every cycle. The
ADSP-2115 runs at full speed even with an off-chip
memory access.
TMS320C50 MAC Operation
There is no dedicated multiplier/accumulator hardware
in the TMS320C50. The TMS320C50 requires the use of
both the multiplier and the ALU to perform a complete
multiplication/accumulation operation. A multiplication
is performed by loading the TREG0 register with the first
operand. Once this data is loaded, a value from the data
bus can be multiplied with the value in the TREG0 regis-
ter. The instructions for the multiplier are specified with
a mnemonic. The instructions for a multiplication are
shown below.
LT <data memory address>
MPY <data memory address>
A product is obtained every two cycles.
A full multiplication/accumulation requires the use of
the ALU as well as the multiplier. The instruction
required to perform a MAC operation is shown below.
This instruction requires two words of program memory
storage.
MAC <prog. mem. address> <data mem. address>
With both operands in on-chip memory, the MAC
instruction takes three 35 ns cycles in non-repeat mode.
In repeat mode, it will require
2 + n
cycles, where
n
is the
number of repeats.
There are four different mnemonics used for the multi-
ply/accumulate function: MAC, MACD, MADD, MADS.
The specific use of each of these depends upon the
source of the data. For a dual operand fetch, such as that
needed for a digital filter, the MADD instruction should
be used. The DMOV portion of the MADD instruction will
not function with external memory. All data must reside
on chip.
The TMS320C50 provides one bit of extension in the
accumulator (a 31-bit accumulator with an overflow bit
compared to the 40-bit accumulator of the ADSP-2115).
After more than one overflow, the calculation of the
TMS320C50 is corrupted. Automatic rounding is not
supported in the multiplier. This is unlike the ADSP-
2115, where up to 256 overflows can occur with no lost
data and automatic rounding is performed in the same
cycle as the multiply operation.
ADSP-2115 Shifter
The barrel shifter in the ADSP-2115 has an input register,
SI, and accepts as inputs any result registers in the pro-
cessor (e.g., MR1, AR) including its own result register,