CHAPTER 8
Hardware Design Using DSP Chips
8.1 INTRODUCTION
In Chapter 7, we used the
fdatool
to illustrate the analysis and design of a
digital filter in which the coefficients of the filter and the input samples are
represented by a finite number of bits. We also found the effect of rounding or
truncating the results of adding signals or multiplying the signal value and the
coefficient of the filter and ascertained that there is no possibility of limit cycles
or unstable operation in the filter. In the example chosen we decided that an
FIR filter would meet the frequency response specifications of a lowpass elliptic
filter, with a wordlength of 8 bits. Very often, however, a digital filter is used
as a prominent part of a digital system such as a cell phone, which has other
components such as power supply, keyboard, or other I/O interfaces. So we have
to simulate the performance of the whole system with all components connected
together in the form of a block diagram.
8.2 SIMULINK AND REAL-TIME WORKSHOP
Simulink is the software that is available as a companion toolbox to MATLAB
and is used to model and simulate the performance of dynamic systems, under
varying conditions. Just as MATLAB works with a number of toolboxes, Simulink
has access to a library of many additional tools called blocksets, such as the
DSP blockset, fixed-point blockset, communications blockset, and control system
blockset, as shown on the left side of Figure 8.1.
The Simulink browser library includes blocksets for simulation of aeronautical
and mechanical systems, too, namely, are
aerospace blockset
and
simMe-
chanics
.
1
Each of these blocksets contains a large number of blocks that are used
to define specific transfer functions or algorithms and a variety of input signals.
1
Depending on the version of Simulink, this may or may not contain some of the blocksets mentioned
in this chapter.
Introduction to Digital Signal Processing and Filter Design, by B. A. Shenoi
Copyright © 2006 John Wiley & Sons, Inc.
381
382
HARDWARE DESIGN USING DSP CHIPS
Figure 8.1 Screen capture of the Simulink browser and block diagram of a model.
The GUI interface is used to drag and drop these blocks from the blockset and
connect them to describe a block diagram representation of the dynamic system,
which may be a continuous-time system or a discrete-time system. A mechanical
system model [6] is shown in Figure 8.1. Simulink is based on object-oriented
programming, and the blocks are represented as objects with appropriate prop-
erties, usually specified in a dialog box. Indeed, the
fdatool
that we used in
Chapter 7 can be launched from SIMULINK as an object or from the MATLAB
command window because both of them are integrated together to operate in a
seamless fashion. Simulink itself can be launched either by typing
simulink
in
the MATLAB command window or by clicking the Simulink icon in its toolbar.
For the simulation of a digital filter, we choose the DSP blockset, which
contains the following blocks in a tree structure:
DSP Blockset
→DSP Sinks
→DSP Sources
→Estimation
→Filtering →Adaptive Filters
→Math Functions →Filter Design →Analog Filter Design
→Platform Specific I/O →Multirate filters →Digital Filter Design
→Quantizers →Digital Filter
→Signal Management →Filter Realization
Wizard
→Signal Operations →Overlap-Add FFT filter
→Statistics →Overlap-Save FFT filter
→Transforms
DESIGN PRELIMINARIES
383
When we open Simulink window, and click
File→New→Model
in sequence,
we get a window for the new model. Then we drag the block shown above
as
Digital Filter Design
and drop it in the window for the new model.
When we click on this object in the new window, it opens the same window
as the one for the
fdatool
shown in Figure 7.1. After we have imported the
parameters of the digital filter that we designed in an earlier session, or after we
have completed the design of the quantized filter as explained in Chapter 7, we
use the
Filter Realization Wizard
shown above under the
DSP Blockset
and get the realization structure for the filter. This serves as the model for the
filter to which we can now connect different types of sources and observe the
output on the scope connected to the filter, as the sink. Very often, we are
required to design a whole system, in which case a digital filter is the only
major block in the system, but there are other subsystems integrated with it.
So it may be necessary to use the blocks for the adaptive filters or multirate
filters or the blocks from the
Communication
blockset and
Controls
blockset,
besides the
DSP Blockset
, and so on. After building the block diagram model
for the total digital signal processing system, and using Simulink to carry out
extensive simulation of the model under varying conditions, we check to ensure
that it meets the specifications satisfactorily; if not, we may have to modify the
design of the filter or tune the parameters. For example, we may simulate the
total system with a finite number of bits in floating-point or fixed-point format,
using the
Fixed Point
blockset to represent all data. We may have to change
the design completely and simulate the new system.
8.3 DESIGN PRELIMINARIES
All the design and simulation of digital filters and digital systems done by MAT-
LAB and Simulink is based on numerical computation of scientific theory. When
this work is completed, we have to decide on one of the following choices:
1. Design a VLSI chip, using software such as VHDL, to meet our particular
design specifications
2. Select a DSP chip from manufacturers such as Texas Instruments, Analog
Devices, Lucent, or Motorola and program it to work as a digital system
3. Choose a general-purpose microprocessor and program it to work as a
digital signal processor system.
4. Design the system using the field-programmable gate arrays (FPGAs).
In all cases, several design considerations have to be explored as thoroughly as
possible before we embark on the next step in hardware design.
If we decide to select a DSP chip from one of the abovementioned manufac-
tures, we have to consider the bandwidth of the signal(s) that the digital filter or
the the digital system will be processing, based on which sampling frequency of
the ADC is selected. However, the sampling frequency of the ADC may not be
384
HARDWARE DESIGN USING DSP CHIPS
the same as the clock frequency of the CPU in the chip or the rate at which data
will be transferred from and to the memory by the CPU (central processing unit).
This in turn determines the rating in mips (millions of instructions per second).
Depending on the amount of data or memory space required by the processor, the
amount of power is determined. Other considerations are the I/O (input/output)
interfaces, additional devices such as the power supply circuit, and the micro-
controller, add-on memory, and peripheral devices. Finally the most important is
the the cost per chip. We also need to consider the reliability of the software and
technical support provided by the manufacturer; credibility and sustainability of
the manufacturer also become important if the market for the digital filter or the
system is expected to last for many years.
The selection of the DSP chip is facilitated by an evaluation of the chips avail-
able from the major manufacturers listed above and their detailed specifications.
For example, the DSP Selection Guide, which can be downloaded from the TI
(Texas Instruments) Website
www.dspvillage.ti.com
, is an immense source
of information on all the chips available from them.
The DSP chips provided by TI are divided into three categories. The fam-
ily of TMS3206000 DSP platform are designed for systems with very high
performance, ranging within 1200–5760 mips for fixed-point operation and
600–1350 mflops (million floating-point operations per second) for floating-
point operation. The fixed-point DSPs are designated by TMS320C62x and
TMS320C64x, and the floating-point DSPs belong to the TMS320C67x family.
The fixed-point TMS32062x DSPs are optimized for multichannel, multifunc-
tion applications such as wireless base stations, remote-access servers, digital
subscriber loop (DSL) systems, central office switches, call processing, speech
recognition, image processing, biometric equipment, industrial scanners, pre-
cision instruments, and multichannel telephone systems. They use 16 bits for
multiplication and 32 bits for instructions in single-precision format as well as
double-precision format. The fixed-point TMS320C64x DSPs offer the high-
est level of performance at clock rates of up to 720 MHz and 5760 mips, and
they are best suited for applications in digital communications and video and
image processing, wireless LAN (local area networking), network cameras, base
station transceivers, DSL, and pooled modems, and so on. The floating-point
TMS320C67x DSPs operate at 225 MHz and are used in similar applications.
The TMS320C5000 DSP family is used in consumer digital equipments,
namely, products used in the Internet and in consumer electronics. Therefore
these chips are optimized for power consumption as low as 0.05 mW/mips and
speeds of ≤300 MHz and 600 mips; the TMS320C54x DSPs are well known as
the industry leader in portable devices such as cell phones(2G, 2.5G, and 3G), dig-
ital audio (MP3) players, digital cameras, personal digital assistants (PDAs), GPS
receivers, and electronic books. The TMS320C55x DSPs also deliver the highest
power efficiency and are software-compatible with the TMS320C54x DSPs.
The TMS320C2000 DSPs are designed for applications in digital con-
trol industry, including industrial drives, servocontrol, factory automation,
office equipment, controllers for pumps, fans, HVAC (heating–ventilation–air
CODE GENERATION
385
conditioning), and other home appliances. The TMS320C28x DSPs offer 32-bit,
fixed-point processing and 150 mips operation, whereas the TMS320C24x DSPs
offer a maximum of 40 mips operation.
More detailed information and specifications for the DSPs and other devices
such as ADCs, and codecs (coders/decoders) supplied by TI can be found in the
DSP Selection Guide. The amount of information on the software and hardware
development tools, application notes, and other resource material that is freely
available in this Website is enormous and indispensable. We must remember that
DSP chips produced by other manufacturers such as Analog Devices may be
better suited for specific applications, and they, too, provide a lot of information
about their chips and the applications.
8.4 CODE GENERATION
The next task is to generate a code in machine language that the DSP we have
selected understands and that implements the algorithm for the digital system
we have designed. First we have to convert the algorithm for the system under
development to a code in C/C++ language. This can be done manually by one
who is experienced in C language programming. Or we simulate the performance
of the whole system modeled in Simulink, and use a blockset available in it,
known as the Real-Time Workshop [7] to generate the ANSI Standard C code
for the model.
2
The C code can be run on PCs, DSPs, and microcontrollers in real
time and non–real time in a variety of target environments. We connect a rapid
prototyping target, for example, the xPC Target, to the physical system but use
the Simulink model as the interface to the physical target. With this setup, we test
and evaluate the performance of the physical target. When the simulation is found
to work satisfactorily, the Real-Time Workshop is used to create and download
an executable code to the target system. Now we can monitor the performance of
the target system and tune its parameters, if necessary. The Real-Time Workshop
is useful for validating the basic concept and overall performance of the whole
system that responds to a program in C code.
An extension of Real-Time Workshop called the Real-Time Workshop Embed-
ded Coder is used to generate optimized C code for embedded discrete-time
systems.
Note that the C code is portable in the sense that it is independent of any man-
ufacturer’s DSP chip. But the manufacturers may provide their own software to
generate the C code also, optimized for their particular DSP chip. However, pro-
gramming a code in machine language is different for DSP chips from different
manufacturers, and the different manufacturers provide the tools necessary to
obtain the machine code from the C code for their DSP chips.
2
Depending on the version of MATLAB/Simulink package installed on the computer in the college
or university, software such as FDA Tool, Real-Time Workshop and others mentioned in this chapter
may or may not be available.