Unit 3 Programmable Digital Signal Processors
Unit 3 Programmable Digital Signal Processors
UNIT#3
3.1 Introduction:
The TMS320 family consists of two types of single chips DSPs: 16-bit fixed point
&32-bit floating-point. These DSPs possess the operational flexibility of high-speed
controllers and the numerical capability of array processors
There are several families of commercial DSP devices. Right from the early
eighties, when these devices began to appear in the market, they have been used in
numerous applications, such as communication, control, computers, Instrumentation,
and consumer electronics. The architectural features and the processing power of these
devices have been constantly upgraded based on the advances in technology and the
application needs. However, their basic versions, most of them have Harvard
architecture, a single-cycle hardware multiplier, an address generation unit with dedicated
address registers, special addressing modes, on-chip peripherals interfaces.
databus bus
16-bit 24-bit program/data 24-bit program
External buses program/data bus bus bus
16-bit data bus
On-chip Memory 544 words RAM 512 words PROM -
2 x 256 words data
4K words ROM RAM
2 x 256 words data
ROM
64 K words 16K words
Off-chip memory program 64K words program program
64k words data 2 x 64K words data 16K words data
16 words
Cache memory - - program
Instruction cycle time 100 nsec 97.5 nsec. 125 nsecc.
Special addressing
modes Bit reversed Modulo Modulo
Bit reversed Bit reversed
Data address
generators 1 2 2
Synchronous serial
Interfacing features I/O Synchronous and DMA
DMA Asynchronous serial
I/O DMA
The program bus pair (PAB, PB); which carries the instruction code from the program
memory.
Three data bus pairs (CAB, CB; DAB, DB; and EAB, EB); which interconnected the
various units within the CPU. In Addition the pair CAB, CB and DAB, DB are used to
read from the data memory, while
The pair EAB, EB; carries the data to be written to the memory. The 54xx can generate
up to two data-memory addresses per cycle using the two auxiliary register arithmetic
unit (ARAU0 and ARAU1) in the DAGEN block. This enables accessing two operands
simultaneously.
The 54xx CPU is common to all the 54xx devices. The 54xx CPU contains a
40-bit arithmetic logic unit (ALU); two 40-bit accumulators (A and B); a barrel shifter; a
17 x 17-bit multiplier; a 40-bit adder; a compare, select and store unit (CSSU); an
exponent encoder(EXP); a data address generation unit (DAGEN); and a program
address generation unit (PAGEN).
Accumulators A and B; store the output from the ALU or the multiplier/adder
block and provide a second input to the ALU. Each accumulators is divided into three
parts: guards bits (bits 39-32), high-order word (bits-31-16), and low-order word (bits 15-
0), which can be stored and retrieved individually.
Barrel shifter: provides the capability to scale the data during an operand read or write.
No overhead is required to implement the shift needed for the scaling operations.
The54xx barrel shifter can produce a left shift of 0 to 31 bits or a right shift of 0 to 16
bits on the input data. The shift count field of status registers ST1, or in the temporary
register T. Figure 3.3 shows the functional diagram of the barrel shifter of
TMS320C54xx processors.
The barrel shifter and the exponent encoder normalize the values in an
accumulator in a single cycle. The LSBs of the output are filled with0s, and the MSBs
can be either zero filled or sign extended, depending on the state of the sign-extension
mode bit in the status register ST1. An additional shift capability enables the processor to
perform numerical scaling, bit extraction, extended arithmetic, and overflow prevention
operations.
The compare, select, and store unit (CSSU) is a hardware unit specifically
incorporated to accelerate the add/compare/select operation. This operation is essential to
implement the Viterbi algorithm used in many signal-processing applications.
The exponent encoder unit supports the EXP instructions, which stores in the T
register the number of leading redundant bits of the accumulator content. This
information is useful while shifting the accumulator content for the purpose of scaling.
The amount and the types of memory of a processor have direct relevance to the
efficiency and performance obtainable in implementations with the processors. The 54xx
memory is organized into three individually selectable spaces: program, data, and I/O
spaces. All 54xx devices contain both RAM and ROM. RAM can be either dual-access
type (DARAM) or single-access type (SARAM). The on-chip RAM for these processors
is organized in pages having 128 word locations on each page.
A part of on-chip ROM may contain a boot loader and look-up tables for function
such as sine, cosine, - law, and A- law.
ST0: Contains the status of flags (OVA, OVB, C, TC) produced by arithmetic operations
& bit manipulations.
ST1: Contain the status of various conditions & modes. Bits of ST0&ST1registers can be
set or clear with the SSBX & RSBX instructions.
HM: Hold mode, indicates whether the processor continues internal execution or
acknowledge for external interface.
0: Always read as 0
ASM: Accumulator Shift Mode. 5 bit field, & specifies the Shift value within -16 to 15
range.
INTR: Interrupt vector pointer, point to the 128-word program page where the interrupt
vectors reside.
OVLY: RAM OVERLAY, OVLY enables on chip dual access data RAM blocks to be
mapped into program space.
AVIS: It enables/disables the internal program address to be visible at the address pins.
DROM: Data ROM, DROM enables on-chip ROM to be mapped into data space.
Data addressing modes provide various ways to access operands to execute instructions
and place results in the memory or the registers. The 54XX devices offer seven basic
addressing modes
1. Immediate addressing.
2. Absolute addressing.
3. Accumulator addressing.
4. Direct addressing.
5. Indirect addressing.
7. Stack addressing.
The instruction contains the specific value of the operand. The operand can be short
(3,5,8 or 9 bit in length) or long (16 bits in length). The instruction syntax for short
operands occupies one memory location,
1. Dmad addressing.
MVDK Smem,dmad
MVDM dmad,MMR
2. Pmad addressing.
MVDP Smem,pmad
MVPD pmem,Smad
3. PA addressing.
PORTR PA, Smem,
4.*(lk) addressing .
Example:
Accumulator content is used as address to transfer data between Program and Data
memory.
Ex: READA *AR2
Base address + 7 bits of value contained in instruction = 16 bit address. A page of 128
locations can be accessed without change in DP or SP.Compiler mode bit (CPL) in ST1
register is used.
If CPL =0 selects DP
CPL = 1 selects SP,
It should be remembered that when SP is used instead of DP, the effective address is
computed by adding the 7-bit offset to SP.
Figure 3.7 Block diagram of the direct addressing mode for TMS320C54xx Processors.
54xx have 8, 16 bit auxiliary register (AR0 AR 7). Two auxiliary register
arithmetic units (ARAU0 & ARAU1)
Used to access memory location in fixed step size. AR0 register is used for
indexed and bit reverse addressing modes.
Figure 3.8 Block diagram of the indirect addressing mode for TMS320C54xx Processors.
Table 3.2 Indirect addressing options with a single data memory operand.
Circular Addressing;
A circular buffer is a sliding window contains most recent data. Circular buffer of
size R must start on a N-bit boundary, where 2N > R .
The circular buffer size register (BK): specifies the size of circular buffer.
End of buffer address (EOB) : By repalcing the N LSBs of ARx with the N
LSBs of BK.
Figure 3.9 Block diagram of the circular addressing mode for TMS320C54xx Processors.
Bit-Reversed Addressing:
Dual-Operand Addressing:
If in an instruction with a parallel store the source operand the destination operand
point to the same location, the source is read before writing to the destination. Only 2 bits
are available in the instruction code for selecting each auxiliary register in this mode.
Thus, just four of the auxiliary registers, AR2-AR5, can be used, The ARAUs together
with these registers, provide capability to access two operands in a single cycle. Figure
3.11 shows how an address is generated using dual data-memory operand addressing.
Name Function
Opcode This field contains the operation code for the instruction
Xmod Defined the type of indirect addressing mode used for accessing the Xmem
operand
XAR Xmem AR selection field defines the AR that contains the address of Xmem
Ymod Defies the type of inderect addressing mode used for accessing the Ymem
operand
Yar Ymem AR selection field defines the AR that contains the address of Ymem
Table 3.3.Function of the different field in dual data memory operand addressing
Figure 3.11 Block diagram of the Indirect addressing options with a dual data memory
operand.
Used to modify the memory-mapped registers without affecting the current data-
page pointer (DP) or stack-pointer (SP)
PSHD X2
Example Problem
1. Assuming the current content of AR3 to be 200h, what will be its contents after
each of the following TMS320C54xx addressing modes is used? Assume that the
contents of AR0 are 20h.
a. *AR3+0
b. *AR3-0
c. *AR3+
d. *AR3
e. *AR3
f. *+AR3(40h)
g. *+AR3(-40h)
Solution:
2. Assume that the register AR3 with contents 1020h is selected as the pointer for
the circular buffer. Let BK = 40h to specify the circular buffer size as
40h.Determine the start and the end addresses fort the buffer. What will be the
contents of register AR3 after the execution to the instruction LD*AR3 + 0%, A,
if the contents of register AR0 are 0025h?
Solution:
AR3 = 1020h means that currently it points to location 1020h. Masking the lower
6 bits zeros gives the start address of the buffer as 1000h. Replacing the same bits
with the BK gives the end address as 1040h.
3. Assuming the current contents of AR3 to be 200h, what will be its contents after
each of the following TMS320C54xx addressing modes is used? Assume that the
contents of AR0 are 20h
a. *AR3 + 0B
b. *AR3 0B
Solution:
Data memory: To store data required to run programs & for external memory
mapped registers.
It contains program counter (PC), the program counter related H/W, hard stack,
repeat counters &status registers.
End of a block repeat loop: The PC is loaded with the contents of the block repeat
program address start register.