DSPAA Notes
DSPAA Notes
1. Sketch a neat figure of DSP system and explain the various blocks. Explain
the issues to be considered in designing and implementing a DSP system with
a neat figure
a.) anti aliasing filter: An anti-aliasing filter (AAF) is a filter used before a signal sampler to
restrict the bandwidth of a signal to satisfy the Nyquist–Shannon sampling theorem over the band
of interest.
b.) ADC: In electronics, an analog-to-digital converter (ADC, A/D, or A-to-D) is a system that
converts an analog signal, such as a sound picked up by a microphone or light entering a digital
camera, into a digital signal.
c.) DSP: Digital signal processing (DSP) is the use of digital processing, such as by computers or
more specialized digital signal processors, to perform a wide variety of signal processing
operations.
a.) Arithmetic Format. One of the most fundamental characteristics of a programmable digital
signal processor is the type of native arithmetic used in the processor.
c.) Speed
h) Cost.
A. While performing the addition of N numbers each of n bits long, the sum can
grow up to n+log2 N bits long. If the accumulator is of n bits long, then an
overflow error will occur. This can be overcome by using a shifter to scale down
B. Similarly while calculating the product of two n bit numbers, the product can
grow up to 2n bits long. Generally the lower n bits get neglected and the sign bit
C. Finally in case of addition of two floating-point numbers, one of the operands has
From the above cases it is clear that, a shifter is required in the architecture of a
DSP.
are used to implement the functions of the type A+BC. A typical MAC unit is as shown
ALU:
ADD, SUB, INC, DEC etc and logical operations like AND, OR , NOT, XOR etc. The
c. Repeat the problem of the start and end addresses of the circular buffer
are 0210h and 0201h respectively
b. & c.
6. With the help of a neat block diagram explain the need and operations of
a. Address Generation Unit
b. Program Sequencer
7. Explain the implementation of an 8-tap FIR Filter given by y(n) = Σ h(i) x(n-i) using
a. Parallel Implementation
b. Pipeline Implementation
SAME AS Q.13
A commonly used notation for DSP implementations is Q15. In the Q15 representation, the least
significant 15 bits represent the fractional part of a number. In a processor where 16 bits are used
to represent numbers, the Q15 notation uses the MSB to represent the sign of the number and the
rest of the bits represent the value of the number. In general, the value of a 16-bit Q15 number N
represented as: b15…………b1b0 N= - b15+ b142 -1+…………+b02 -15 Range:-1 to 1- 2-15
i. Eight MACs
b. Consider a MAC unit whose inputs are 16-bit numbers. If 256 products
are to be summed up in this MAC, how many guard bits should be provided
for the accumulator to prevent overflow condition from occurring?
b.
15. Interpret the need and role of Digital filters. Sketch a neat figure and explain
the structure of a Digital filter. Compare the salient features of FIR and IIR filters
with relevant equations showing their advantages and drawbacks
Filters are used to remove the unwanted components in the sequence. They are
characterized by the impulse response h (n). The general difference equation for an Nth
order filter is given by, y (n) = Σ aky(n-k)+ Σ bkx(n-k)
FIR Filters
FIR filters have impulse responses of finite lengths. In FIR filters the present output depends
only on the past and present values of the input sequence but not on the previous output
sequences. Thus they are non recursive hence they are inherently stable.
FIR filters possess linear phase response. Hence they are very much applicable for the
applications requiring linear phase response.
The difference equation of an FIR filter is represented as y (n) = Σ bkx(n-k)
The frequency response of an FIR filter is given as H (e jθ)=Σbk e-jkθ
also H (Z)=Σbk Z-k
The major drawback of FIR filters is, they require more number of filter coefficients to realize
a desired response as compared to IIR filters. Thus the computational time required will also
be more.
IIR Filters
Unlike FIR filters, IIR filters have an infinite number of impulse response samples. They are
recursive filters as the output depends not only on the past and present inputs but also on
the past outputs. They generally do not have linear phase characteristics. Typical system
function of such filters is given by, H (Z) = (b0+b1z-1+b2z-2+…………bLz-L) / (1-a1z-1-a2z-
2-………aNz-N)
16. Compute the indices for an 16-point FFT using Bit reversed Addressing Mode
showing all the intermediate steps
17. What are the memory addresses of the operands in each of the following cases
of indirect addressing modes? In each case, what will be the content of the addreg
after the memory access? Assume that the initial contents of the addreg and the
offsetreg are 0200h and 0010h, respectively.
ADD *addreg-
ADD +*addreg
ADD offsetreg+,*addreg
18.
a. Interpret the need for shifters in DSP applications? Also explain the
implementation of a 4-bit Barrel Shifter and its working showing its block
diagram
Shifters are used to either scale down or scale up operands or the results. The following
scenarios give the necessity of a shifter a. While performing the addition of N numbers each
of n bits long, the sum can grow up to n+log2 N bits long. If the accumulator is of n bits long,
then an overflow error will occur. This can be overcome by using a shifter to scale down the
operand by an amount of log2N. b. Similarly while calculating the product of two n bit
numbers, the product can grow up to 2n bits long. Generally the lower n bits get neglected
and the sign bit is shifted to save the sign of the product. c. Finally in case of addition of two
floating-point numbers, one of the operands has to be shifted appropriately to make the
exponents of two numbers equal.
From the above cases it is clear that, a shifter is required in the architecture of a
DSP.
b. It is required to find the sum of 128 numbers each represented by 32-bits.
How many bits should the accumulator have so that the sum can be
computed without the occurrence of overflow error or loss of accuracy?
The sum of 128, 32 bit numbers can grow up to (32+ log2 128 )=39 bits long. Hence the
accumulator should be 39 bits long in order to avoid overflow error from occurring.
As the length of the accumulator is fixed, the operands have to be shifted by an amount of
log2 128 = 7 bits prior to addition operation, in order to avoid the condition of overflow.
19. What are guard bits? Interpret its need in a MAC unit of a DSP device.
Consider a MAC unit whose inputs are 24-bit numbers. How many guard bits
should be provided if 512 products have to be added in the accumulator to prevent
overflow condition? What is the overall size of the accumulator required?
20.
a. Explain the need and working of a MAC unit in DSP applications with the
help of its block diagram. Discuss how overflow and underflow can be
overcome while performing multiplications
b. How many bits should the accumulator require to find the sum of 128
numbers each represented by 16 bits, so that the sum can be computed
without the occurrence of overflow error or loss of accuracy?
The sum of 128, 16 bit numbers can grow up to (16+log2 128 )= 23 bits long. Hence the
accumulator should be 23 bits long in order to avoid overflow error from occurring.
21. Explain the implementation of an 8-tap FIR Filter given by
SAME AS Q.13
22. Explain the implementation of a 4-bit shift right barrel shifter with a neat figure.
A Barrel Shifter is to be designed with 16 inputs for left shifts from 0 to 15 bits. How
many control lines are required to implement the shifter?
A Barrel Shifter is to be designed with 16 inputs for left shifts from 0 to 15 bits.
How many control lines are required to implement the shifter?
As the number of bits used to represent the input are 16, log2 16=4 control inputs are
required.
UNIT 2
The first stage, prolog, contains instructions to build the second-stage loop
cycle, and
the epilog stage (last stage) contains instructions to finish all loop iterations.
Soft-
ware pipelining is used by the compiler when optimization option level –o2
or –o3
is invoked. The most efficient software pipelined code has loop trip counters
that
count down: for example,
for (i = N; i != 0; i--)
Software pipelining
The first stage, prolog, contains instructions to build the second-stage loop
cycle, and
the epilog stage (last stage) contains instructions to finish all loop iterations.
Soft-
ware pipelining is used by the compiler when optimization option level –o2
or –o3
is invoked. The most efficient software pipelined code has loop trip counters
that
count down: for example,
for (i = N; i != 0; i--)