DSP Notes - Module 5
DSP Notes - Module 5
com
General purpose digital signal processors: These are basically high-speed microprocessors
with architecture and instruction sets optimized for DSP operations. They include fixed point
processors such as Texas Instruments TMS320C5x, TMS320C5.4x and Motorola DSP563x
and floating-point processors such as Texas instruments TMS3f.OC4x, TMS320C67xx and
analog devices ADSP21 xxx.
Special purpose digital signal processors: These types of processors consist of hardware i)
designed for specific DSP algorithms such as FFr, ii) hardware designed for specific
applications such as PCM and filtering. Examples for special purpose DSPs are Mi tel 's multi-
channel telephony voice echo canceller (MT93001 ), FFT processor (PDSP 1651 SA,TM-44,
TM-66) and programmable FIR filter (UPDSP 16256, Model3092).
Harvard Architecture
The term Harvard originated from the Harvard Mark 1 relay-based computer which
stored instruction on punched tape and data in relay latches. The Harvard architectures
physically separate men1ories for their instructions and data, requiring dedicated buses for each
of them. Instructions and operands can therefore be fetched simultaneously.
Most of the DSP processors use a modified Harvard architecture with two or three
memory buses· allowing access to filter coefficients and input signals in the same cycle. Since
it possesses two independent bus systems, the Harvard architecture is capable of simultaneous
reading an instruction code and reading or writing a memory or peripheral as part of the
execution of the previous instruction. Since it has two memories, it is not possible for the CPU
to mistakenly write codes into the program memory and therefore compute the code while it is
executing.
However, it is less flexible. It needs two independent memory banks. These two
resources are not interchangeable.
1
Youtube - @IMPLearn
[Link]
The modified Harvard architecture used DSPs multiport memory that has separate bus
systems for program memory and data memory and input/output peripherals. It ·may also have
multiple bus system for program memory alone or for data memory alone. These multiple bus
system increases complexity of the CPU, but allow it to access several memory locations,
simultaneously, thereby increasing the data throughput between memory and, CPU.
Pipelining
Most of the early microprocessors execute instructions entirely sequentially. After the
execution of first instruction the next one starts. The problem with this is that it is extremely
inefficient, since the second instruction must wait until all the steps of first instruction are
completed. To improve the efficiency, advanced microprocessors and digital signal processors
use an approach called pipelining in which different phases of operation and execution of
instructions are carried out in parallel. That is in modem processors the first step of execution
is performed on the first instruction, and then when the instruction passes to the next step, a
new instruction is started. The steps in the pipeline are often called stages
The basic action of any microprocessor can be broken down into a series of four simple steps.
They are
1. The Fetch phase(F) in which the next instruction is fetched from the address stored in
the program counter.
2. The decode phase (D) in which the instruction in the instruction register is decoded
and the address in the program counter is incremented
3. Memory read (R) phase reads the data from the data buses and also writes data to the
data buses.
2
Youtube - @IMPLearn
[Link]
4. The Execute phase (X) executes the instruction currently in the instruction register and
also completes the write process.
Pipelining a processor means breaking down its instruction into a series of discrete pipeline
stages which can be completed in sequence by specialized hardware. Because an instruction's
Lifecycle consists of four distinct phases, the instruction execution process is divided into a
sequence of four discrete pipeline stages, where each pipeline stage corresponds to a phase in
the standard instruction Lifecycle. Note that the number of pipeline stages is referred to as the
pipeline depth. So, a four-stage pipeline has a pipeline depth of four.
To understand the pipelining in a better way, let us assume that the number of stages is four
and the execution time of an instruction is four nanoseconds. If we assume. the time taken for
each stage in the instruction is equal, then the time - taken for each stage is one nanosecond.
So, our original single-cycle processor's four-nanosecond execution process is now broken
down into four discrete, sequential pipeline stages of one nanosecond each· in length. At the
beginning of the first nanosecond, the first instruction enters the fetch stage. After that
nanosecond is complete, the second nanosecond begins and the first instruction moves on to
the decode stage while the second instruction enters the fetch stage. At the start of the third
nanosecond, the first instruction advances to the ·memory read stage, the second instruction
advances to the decode stage, and the third green instruction enters the fetch stage. At the fourth
nanosecond, the first instruction advances to the execution stage, the second to the memory
read stage, the third to the decode stage, and the fourth to the fetch stage. After the fourth
nanosecond has fully elapsed and the fifth nanosecond starts, the first -instruction has passed
from the pipeline and is now finished executing. Thus, we can say that at the end of four
nanoseconds (= four clock cycles) the pipelined processor depicted below has completed one
instruction. At start of the fifth nanosecond, the pipeline is now full and the processor can begin
completing instructions at a rate of one instruction per nanosecond. This 1 instruction
completion rate is a four-fold improvement over the single-cycle processor's completion rate
of 0.25 instructions/ns (or 4 instruction every 16 nanoseconds).
3
Youtube - @IMPLearn
[Link]
Pipelining leads to dramatic improvements in system performance. The more stages that we
can break the pipeline into, the more theoretical speed we can get from it.
where x(n) is the input to the filter, h(n) is the impulse response of the filter and y(n) is
output of the filter. The output of an FIR filter is simply a finite length weighted sum of the
present and previous inputs to the filter. Hence to perform filtering through above equation, the
minimum requirement is to quickly multiply two values, and add the result. To make it
possible, a fast dedicated hardware MAC, using either fixed point or floating-point arithmetic
is mandatory. Characteristics of a typical fixed-point MAC include
4
Youtube - @IMPLearn
[Link]
5
Youtube - @IMPLearn
[Link]
6
Youtube - @IMPLearn
[Link]
32 32-bit registers
Control registers
Control logic
The program fetch, instruction dispatch, and instruction decode units can deliver up to eight
32-bit instructions to the functional units every CPU clock cycle. The processing of
instructions occurs in each of the two data paths (A and B), each of which contains four
functional units (.L, .S, .M, and .D) and 16 32-bit general-purpose registers. A control register
file provides the means to configure and control various processor operations. To understand
how instructions are fetched, dispatched, decoded, and executed in the data path, see
Internal Memory
The C67x DSP has a 32-bit, byte-addressable address space. Internal (on-chip) memory is
organized in separate data and program spaces. When off-chip memory is used, these spaces
are unified on most devices to a single memory space via the external memory interface
(EMIF).
The C67x DSP has two 32-bit internal ports to access internal data memory. The C67x DSP
has a single internal port to access internal program memory, with an instruction-fetch width
of 256 bits.
7
Youtube - @IMPLearn
[Link]
• DMA Controller (C6701 DSP only) transfers data between address ranges in the
memory map without intervention by the CPU. The DMA controller has four
programmable channels and a fifth auxiliary channel.
• EDMA Controller performs the same functions as the DMA controller. The EDMA has
16 programmable channels, as well as a RAM space to hold multiple configurations for
future transfers.
• HPI is a parallel port through which a host processor can directly access the CPU’s
memory space. The host device has ease of access because it is the master of the
interface. The host and the CPU can exchange information via internal or external
memory. In addition, the host has direct access to memory-mapped peripherals.
• Expansion bus is a replacement for the HPI, as well as an expansion of the EMIF. The
expansion provides two distinct areas of functionality (host port and I/O port) which
can co-exist in a system. The host port of the expansion bus can operate in either
asynchronous slave mode, similar to the HPI, or in synchronous master/slave mode.
This allows the device to interface to a variety of host bus protocols. Synchronous
FIFOs and asynchronous peripheral I/O devices may interface to the expansion bus.
• McBSP (multichannel buffered serial port) is based on the standard serial port interface
found on the TMS320C2000 and TMS320C5000 devices. In addition, the port can
buffer serial samples in memory automatically with the aid of the DMA/EDNA
controller. It also has multichannel capability compatible with the T1, E1, SCSA, and
MVIP networking standards.
• Timers in the C6000 devices are two 32-bit general-purpose timers used for these
functions:
o Time events
o Count events
o Generate pulses
o Interrupt the CPU
o Send synchronization events to the DMA/EDMA controller.
• Power-down logic allows reduced clocking to reduce power consumption. Most of the
operating power of CMOS logic dissipates during circuit switching from one logic state
to another. By preventing some or all of the chip’s logic from switching, you can realize
significant power savings without losing any data or operational context.
8
Youtube - @IMPLearn
[Link]
9
Youtube - @IMPLearn
[Link]
The quantization error arises when a continuous signal is converted into digital
value, the quantization error is given by
10
Youtube - @IMPLearn
[Link]
11
Youtube - @IMPLearn
[Link]
12
Youtube - @IMPLearn
[Link]
13
Youtube - @IMPLearn
[Link]
14
Youtube - @IMPLearn
[Link]
15
Youtube - @IMPLearn
[Link]
In general, we can represent the fixed-point number ‘N’ to any desired accuracy by the series
𝑛2
𝑁 = ∑ 𝐶𝑖 𝑟 𝑖
𝑖=𝑛1
30.285 = ∑ 𝐶𝑖 10𝑖
𝑖=−3
16
Youtube - @IMPLearn
[Link]
Examples:
Convert the decimal number 30.275 to binary form
0.55 * 2 ➔1.10 ➔1
0.10 * 2 ➔0.20 ➔0
0.20 * 2 ➔0.40 ➔0
0.40 * 2 ➔0.80 ➔0
0.80 * 2 ➔1.60 ➔1
0.60 * 2 ➔1.20 ➔1
0.20 * 2 ➔0.40 ➔0
(30.275)10 = (11110.01000110)2
0.275 * 2 ➔0.55 ➔0
0.111000
↓ ↓↓↓↓↓↓ (Complement each bit)
1.000111
17
Youtube - @IMPLearn
[Link]
(0.875)10 = (0.111000)2
↓ ↓↓↓↓↓↓ (Complement each bit)
1.000111
+ 1
1.001000
(-0.875)10 = (1.001000)2
Examples:
Find the sign magnitude, 1’s complement, 2’s complement for the given numbers.
1. -7/32
2. -7/8
3. 7/8
18
Youtube - @IMPLearn
[Link]
For example
(0.100)2
(0.101)2
(1.001)2 = (-0.125)10 in sign magnitude form
(0.5)10 = (0.100)2
-(0.25)10 = (1.110)2 →Two’s complement of -0.25
(10.010)2
Here the carry is generated after the addition. Neglect the carry bit to get the result in
decimal. (0.010)2 = (0.25)10
19
Youtube - @IMPLearn
[Link]
Fixed point processors are used in different flexible embedded applications because it
uses low power and less cost. The fixed-point digital signal processor are; TI’s TM320C54x,
ADI DSP BF53X, TM320C55x, TM320C64x, TM320C62x and Motorola MSC810x.
For both the operations of fixed-point and floating-point DSPs, SHARC DSPs are
simply designed, optimized & executed with equivalent efficiency. As compared to fixed-point
DSPs, the programs of floating-point DSPs are simple, however, they are normally very
expensive and power consumption is also more. The types of floating-point DSPs are TI’s
TMS320c67x and ADI ADSP 2116x/2126x.
20
Youtube - @IMPLearn
[Link]
DSPs are extensively used in Microprocessors are used in PCs for text editing,
telecommunications, audio signal processing, computation, multimedia display &
digital image processing, etc communication over the Internet.
In DSP, instruction can be simply executed in a The microprocessor uses several clock
single CLK cycle. cycles for one instruction execution.
DSP is suitable for the operation of array It is suitable for general-purpose processing.
processing.
Addressing modes used in this processor are Addressing modes used in microprocessors are
direct & indirect. direct, immediate, register indirect, indirect
register, etc.
Address generation can be possible by The program counter or PC can be incremented
combining program sequencers & DAGs. to produce an address sequentially.
It includes three separate computational units: It includes simply the main unit like ALU.
MAC, ALU & Sifter.
The program flow can be controlled by an Program counter can control the execution flow.
instruction register & program sequencer.
It includes separate data & program memories. It does not have separate memories.
In DSP, several operands are fetched at once. In a microprocessor, the operand can be fetched
serially.
In DSP, address & data bus are multiplexed In a microprocessor, address & data bus are not
multiplexed.
21
Youtube - @IMPLearn
[Link]
During playback, the digital processor decodes the stored data. DAC converter converts
the signal to analog for human hearing. The digital processor also improves quality by
improving volume, reducing noise, equalization, etc.
Smart Phones
The smartphones, IPAD, iPods, etc. are all digital appliances that have a processor that
takes inputs from users and converts them to digital form, processes them, and displays the
output in a human-understandable form.
22
Youtube - @IMPLearn
[Link]
23
Youtube - @IMPLearn