<< Chapter < Page Chapter >> Page >

The following lines of code were borrowed from the C FFT to serve as an example of arithmetic operations in C. Savethis code in a file called mathex.c and compile this file by typing c_asm mathex.c at a command prompt. Look at the resulting assembly file and investigate the differences betweeneach block. Be sure to reference page 6-10 of the compiler user's guide to findout what the state of the FRCT and OVM bits are. Run this program on the DSP, halt the program, and compare theoutput values in a memory window. Does each block work properly for all possible values?

int s1, s2; int t1, t2; int i1, i2; int n1 = 16383, n2 = 16382, n3 = 16381, n4 = 16380; void main(void) { /* Code for standard 32-bit hardware, */ /* with x,y limited to 16 bits */ s1 = (n1*n2 + n3*n4) >> 15; s2 = (n1 + n2) >> 1; /* Code for TI TMS320C54X series */ t1 = ((long int)(n1*n2) + (long int)(n3*n4)) >> 15; t2 = ((long int)n1 + (long int)n2) >> 1; /* Intrinsic code for TMS320C54X series */ i1 = _sadd(_smpy(n1,n2), _smpy(n3,n4)); i2 = _sshl(_sadd(n1, n2),-1); while(1); }

Compiling and linking

A working program can be produced by compiling the C code and linking assembly modules and the core module. The compilertranslates C code to a relocatable assembly form. The linker assigns physical addresses on the DSP to the relocatable dataand code segments, resolves .global references and links runtime libraries.

The procedure for compiling C code and linking assembly modules has been automated for you in the batch file v:\ece420\54x\dsptools\c_asm.bat . The name of the first file becomes the name of the executable. Once you havecompleted lab4main.c and c_fft_given.asm , type c_asm lab4main.c c_fft_given.asm to produce a lab4main.out file to be loaded onto the DSP. For the C FFT type c_asm lab4main.c lab4fft.c to produce lab4main.out . Load the output file onto the DSP as usual and confirmthat valid FFTs are calculated. Once valid output is obtained, measure howmany clock cycles it takes to compute both the assembly and C FFT.

Reference implementation of a psd estimator

We provide for you in Appendix D and E a complete C implementation of a PSD estimator. The input is an IIR-filtered pseudo-noise (PN)sequence generator and the PSD estimate is based on windowing the autocorrelation with a rectangular window.The code consists of the files lab4bmain.c , lab4b.h , intrinsics.h , pn.c , iirfilt.c , autocorr.c , c_fft_given_iirc.asm , and the previously-given TI FFT routine. The assembly file c_fft_given_iirc.asm differs from c_fft_given.asm in that the window array has been removed and variables and arrays associated with IIR filtering havebeen added. Note that the multiply functions in the functions are actually compiler directives contained in intrinsics.h . Make sure you know which ones are used and why; note that VPO is not defined by the TI compiler, therefore the corresponding section of the #ifdef statement is not used. Compile and link these files by issuing c_asm lab4bmain.c pn.c iirfilt.c autocorr.c c_fft_given_iirc.asm at the command line. Load lab4bmain.out onto the DSP and run the code. Make sure that anIIR-filtered PN sequence appears on channel 1 and its PSD estimate appears on channel 2.

Questions & Answers

anyone know any internet site where one can find nanotechnology papers?
Damian Reply
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
many many of nanotubes
what is the k.e before it land
what is the function of carbon nanotubes?
I'm interested in nanotube
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Berger describes sociologists as concerned with
Mueller Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Digital signal processing laboratory (ece 420). OpenStax CNX. Sep 27, 2006 Download for free at http://cnx.org/content/col10236/1.14
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Digital signal processing laboratory (ece 420)' conversation and receive update notifications?