文档库 最新最全的文档下载
当前位置:文档库 › WhatisthedifferencebetweenDSPandgeneralpur……(精)

WhatisthedifferencebetweenDSPandgeneralpur……(精)

WhatisthedifferencebetweenDSPandgeneralpur……(精)
WhatisthedifferencebetweenDSPandgeneralpur……(精)

What is the difference between DSP and general purpose MPU in structure? Compared with general purpose MPU, what is advantage and disadvantage of DSP? Give some examples in DSP application?

Answer: Conventional CPU, such as X86, applies “Von Neuman structure”. In the CPU, program instruction and data use the same read/write memory and there is only one address bus and one data bus. Different wit h common MPU, DSP uses “Harvard structure” and has separated program memory and data memory with separated program address/data bus and data address/data bus. DSP have the capability of pipe line/ parallel operation and even support multi-processor operation.

Compared with common MPU, DSP is more popular in embedded application for its saving power, small size and powerful calculation ability. However, limited on-chip resource and too complex structure cause the DSP application very difficult: we need built a DSP hardware platform, we need choose a proper RTOS, small but efficient, we have to write key parts of our routine in assemble language and so on. Another big disadvantage of DSP is its limited ability in logic operation. Sometimes, we have to use PowerPC, ARM or FPGA to enhance system ability if there are a lot of logic operations. For example, in video comp ression system, “DSP+ARM” structure is applied popularly and ARM is used to deal with a lot of logic operations in communication issues.

What is the difference between fixed-point and float-point DSP instructions? How to realize float-point operation, such as multiply, with fixed-point DSP instructions? Answer: Normally, there are two kinds of DSP: fixed-point DSP and float-point DSP. The former, such as TI’s TMS320C62XX, only deals with fixed-point operation and the later, such as TI’s TMS320C67XX, deal s both fixed-point and float-point operations, but with a much lower MIPS (computational ability). Popularly, to get the strongest computation power with the lowest cost, fixed-point DSP is used to realize float-point operation in integer point format.

In fixed-point DSP, by presetting the point position of fraction, we can express a float-point number in integer point format.

For example, float x = 0.5 can be expressed as int x = 0.5 * 215 = 16384 (Q15), herein the fraction point is preset at the position 15 and this is expressed with Q15, see the following figure.

When fixed-point DSP is used to operate float-point number, make sure the point positions of operands are the same.

For example, if float x is expressed in fixed-pointed DSP as int x with fraction point position of Q x and float y as int y with fraction point position of Q y , then operation “float x + float y” is as follows:

float z = float x + float y

z * 2-Qz = x * 2-Qx + y* 2-Qy (float z is expressed as int z with Q z)

= x * 2-Qx + y* 2(Qx-Qy) * 2-Qx

= [x + y* 2(Qx-Qy)] * 2-Qx

z = [x + y* 2(Qx-Qy)] * 2 (Qz-Qx)

So, float add operation can be expressed with the following instructions in fixed-point format (in C version):

int x, y, z ;

long temp;

temp = y << (Q x– Q y );

temp = x+temp;

if (Q x– Q z) >= 0

z = (int) (temp >> (Q x– Q z);

else

z = (int) temp << (Q z – Q x)

To realize float-point multiply operation: float z = float x * float y, the following instructions in fixed-point format can be used:

// float z = float x * float y

// z * 2-Qz = (x * 2-Qx) * (y* 2-Qy) (float z is expressed as int z with Q z) // z = (x * y) *2Qz –(Qx - Qy)

int x, y, z;

long temp;

temp = (long) x;

z =(temp * y) >>(Q x + Q y - Q z) ;

相关文档