Professional Documents
Culture Documents
Delta
11
1-bit ADC
1-bit
Digital decimator
B-bit
1-bit DAC
Figure 1.6
1.3
DSP Hardware
DSP systems require intensive arithmetic operations, especially multiplication and addition. In this section, different digital hardware architectures for DSP applications will be discussed.
12
ASIC
Chip count Flexibility Design time Power consumption Processing speed Reliability Development cost Production cost 1 none long low high high high low
DBB
>1 limited medium mediumhigh high lowmedium medium high
mP
1 programmable short medium lowmedium high low lowmedium
DSP chips
1 programmable short lowmedium mediumhigh high low lowmedium
Processor Address bus 1 Address bus 2 Address bus Data bus 1 Data bus 2 Data bus
Processor
Memory 1 (a)
Memory 2
Memory (b)
Figure 1.7 Different memory architectures: (a) Harvard architecture, and (b) von Newmann architecture
standard development tools support, and the lack of reprogramming flexibility sometimes outweigh their benefits. Digital building blocks offer a more general-purpose approach to high-speed DSP design. These components, including multipliers, arithmetic logic units (ALUs), sequencers, etc., are joined together to build a custom DSP architecture for a specific application. Performance can be significantly higher than general-purpose DSP devices. However, the disadvantages are similar to those of the special-purpose DSP devices lack of standard design tools, extended design cycles, and high component cost. General architectures for computers and microprocessors fall into two categories: Harvard architecture and von Neumann architecture. Harvard architecture has a separate memory space for the program and the data, so that both memories can be accessed simultaneously, see Figure 1.7(a). The von Neumann architecture assumes that
DSP HARDWARE
13
there is no intrinsic difference between the instructions and the data, and that the instructions can be partitioned into two major fields containing the operation command and the address of the operand. Figure 1.7(b) shows the memory architecture of the von Neumann model. Most general-purpose microprocessors use the von Neumann architecture. Operations such as add, move, and subtract are easy to perform. However, complex instructions such as multiplication and division are slow since they need a series of shift, addition, or subtraction operations. These devices do not have the architecture or the on-chip facilities required for efficient DSP operations. They may be used when a small amount of signal processing work is required in a much larger system. Their real-time DSP performance does not compare well with even the cheaper general-purpose DSP devices, and they would not be a cost-effective solution for many DSP tasks. A DSP chip (digital signal processor) is basically a microprocessor whose architecture is optimized for processing specific operations at high rates. DSP chips with architectures and instruction sets specifically designed for DSP applications have been launched by Texas Instruments, Motorola, Lucent Technologies, Analog Devices, and many other companies. The rapid growth and the exploitation of DSP semiconductor technology are not a surprise, considering the commercial advantages in terms of the fast, flexible, and potentially low-cost design capabilities offered by these devices. Generalpurpose-programmable DSP chip developments are supported by software development tools such as C compilers, assemblers, optimizers, linkers, debuggers, simulators, and emulators. Texas Instruments' TMS320C55x, a programmable, high efficiency, and ultra low-power DSP chip, will be discussed in the next chapter.
14
of the DSP device itself. Floating-point DSP chips also allow the efficient use of the high-level C compilers and reduce the need to identify the system's dynamic range.
This real-time constraint limits the highest frequency signal that can be processed by a DSP system. This is given as fM fs 1 < : 2 2tp 1: 3: 2
It is clear that the longer the processing time tp , the lower the signal bandwidth fM . Although new and faster DSP devices are introduced, there is still a limit to the processing that can be done in real time. This limit becomes even more apparent when system cost is taken into consideration. Generally, the real-time bandwidth can be increased by using faster DSP chips, simplified DSP algorithms, optimized DSP programs, and parallel processing using multiple DSP chips, etc. However, there is still a trade-off between costs and system performances, with many applications simply not being economical at present.
1.4
A generalized DSP system design is illustrated in Figure 1.8. For a given application, the theoretical aspects of DSP system specifications such as system requirements, signal analysis, resource analysis, and configuration analysis are first performed to define the system requirements.
15
Software architecture
Hardware Schematic
Hardware Prototype
DSP algorithms MATLAB or C/C++ ADC Other computers Data files DSP software Data files DAC Other computers
Signal generators
At the algorithm development stage, we most likely work with high-level DSP tools (such as MATLAB or C=C) that enable algorithmic-level system simulations. We then migrate the algorithm to software, hardware, or both, depending on our specific needs. A DSP application or algorithm can be first simulated using a general-purpose computer, such as a PC, so that it can be analyzed and tested off-line using simulated input data. A block diagram of general-purpose computer implementation is illustrated in Figure 1.9. The test signals may be internally generated by signal generators or digitized from an experimental setup based on the given application. The program uses the stored signal samples in data file(s) as input(s) to produce output signals that will be saved in data file(s).
16
Advantages of developing DSP software on a general-purpose computer are: 1. Using the high-level languages such as MATLAB, C=C, or other DSP software packages can significantly save algorithm and software development time. In addition, C programs are portable to different DSP hardware platforms. 2. It is easy to debug and modify programs. 3. Input/output operations based on disk files are simple to implement and the behaviors of the system are easy to analyze. 4. Using the floating-point data format can achieve higher precision. 5. With fixed-point simulation, bit-true verification of an algorithm against fixedpoint DSP implementation can easily be compared.
17
18
simulator is able to show memory contents, all the internal registers, I/O, etc., and the effect on these after each instruction is performed. Input/output operations are simulated using disk files, which require some format conversion. This approach reduces the development process for software design only. Full real-time emulators are normally used when the software is to be tested on prototype target hardware. Writing and testing DSP code is a highly iterative process. With the use of a simulator or an evaluation board, code may be tested regularly as it is written. Writing code in modules or sections can help this process, as each module can be tested individually, with a greater chance of the whole system working at the system integration stage. There are two commonly used methods in developing software for DSP devices: an assembly program or a C=C program. Assembly language is one step removed from the machine code actually used by the processor. Programming in assembly language gives the engineers full control of processor functions, thus resulting in the most efficient program for mapping the algorithm by hand. However, this is a very time-consuming and laborious task, especially for today's highly paralleled DSP architectures. A C program is easier for software upgrades and maintenance. However, the machine code generated by a C compiler is inefficient in both processing speed and memory usage. Recently, DSP manufactures have improved C compiler efficiency dramatically. Often the ideal solution is to work with a mixture of C and assembly code. The overall program is controlled by C code and the run-time critical loops are written in assembly language. In a mixed programming environment, an assembly routine may be either called as a function, or in-line coded into the C program. A library of hand-optimized functions may be built up and brought into the code when required. The fundamentals of C language for DSP applications will be introduced in Appendix C, while the assembly programming for the TMS320C55x will be discussed in Chapter 2. Mixed C and assembly programming will be introduced in Chapter 3. Alternatively, there are many high-level system design tools that can automatically generate an implementation in software, such as C and assembly language.
19
Execution
Figure 1.10
data is to be shared by programs using different languages and different computer platforms, especially for data transfer over computer networks. In addition, an ASCII file can be generated using a word processor program or an editor. MATLAB is an interactive, technical computing environment for scientific and engineering numerical analysis, computation, and visualization. Its strength lies in the fact that complex numerical problems can be solved easily in a fraction of the time required with a programming language such as C. By using its relatively simple programming capability, MATLAB can be easily extended to create new functions, and is further enhanced by numerous toolboxes such as the Signal Processing Toolbox. MATLAB is available on most commonly used computers such as PCs, workstations, Macintosh, and others. The version we use in this book is based on MATLAB for Windows, version 5.1. The brief introduction of using MATLAB for DSP is given in Appendix B. The purpose of a programming language is to solve a problem involving the manipulation of information. The purpose of a DSP program is to manipulate signals in order to solve a specific signal-processing problem. High-level languages are computer languages that have English-like commands and instructions. They include languages such as C=C, FORTRAN, Basic, and Pascal. High-level language programs are usually portable, so they can be recompiled and run on many different computers. Although C is categorized as a high-level language, it also allows access to low-level routines. In addition, a C compiler is available for most modern DSP devices such as the TMS320C55x. Thus C programming is the most commonly used high-level language for DSP applications. C has become the language of choice for many DSP software development engineers not only because it has powerful commands and data structures, but also because it can easily be ported on different DSP platforms and devices. The processes of compilation, linking/loading, and execution are outlined in Figure 1.10. A C compiler translates a high-level C program into machine language that can be executed by the computer. C compilers are available for a wide range of computer platforms and DSP chips, thus making the C program the most portable software for DSP applications. Many C programming environments include debugger programs, which are useful in identifying errors in a source program. Debugger programs allow us to see values stored in variables at different points in a program, and to step through the program line by line.
1.5
The code composer studio (CCS) is a useful utility that allows users to create, edit, build, debug, and analyze DSP programs. The CCS development environment supports
20
several Texas Instruments DSP processors, including the TMS320C55x. For building applications, the CCS provides a project manager to handle the programming tasks. For debugging purposes, it provides breakpoint, variable watch, memory/register/stack viewing, probe point to stream data to and from the target, graphical analysis, execution profiling, and the capability to display mixed disassembled and C instructions. One important feature of the CCS is its ability to create and manage large projects from a graphic-user-interface environment. In this section, we will use a simple sinewave example to introduce the basic built-in editing features, major CCS components, and the use of the C55x development tools. We will also demonstrate simple approaches to software development and debugging process using the TMS320C55x simulator. The CCS version 1.8 was used in this book. Installation of the CCS on a PC or a workstation is detailed in the Code Composer Studio Quick Start Guide [8]. If the C55x simulator has not been installed, use the CCS setup program to configure and set up the TMS320C55x simulator. We can start the CCS setup utility, either from the Windows start menu, or by clicking the Code Composer Studio Setup icon. When the setup dialogue box is displayed as shown in Figure 1.11(a), follow these steps to set up the simulator: Choose Install a Device Driver and select the C55x simulator device driver, tisimc55.dvr for the TMS320C55x simulator. The C55x simulator will appear in the middle window named as Available Board/Simulator Types if the installation is successful, as shown in Figure 1.11(b). Drag the C55x simulator from Available Board/Simulator Types window to the System Configuration window and save the change. When the system configuration is completed, the window label will be changed to Available Processor Types as shown in Figure 1.11(c).
Let us begin with the simple sinewave example to get familiar with the TMS320C55x simulator. In this book, we assume all the experiment files are stored on a disk in the computer's A drive to make them portable for users, especially for students who may share the laboratory equipment.