Digital Signal Processing - Lab Report - 1
Digital Signal Processing - Lab Report - 1
Digital Signal Processing - Lab Report - 1
Experiment - 1
(Familiarization with Code Composer Studio (CCS))
Objective :- To get comfortable with the Code Composer Studio, learn to run and
verify the given code, and understand about the architecture of the processor by :
Theory :-
Code Composer Studio is an integrated development environment (IDE) that supports
the TI microcontroller and embedded processors portfolio. Code Composer Studio
comprises a suite of tools used to develop and debug embedded applications. It includes
an optimizing C/C++ compiler, source code editor, project build environment, debugger,
profiler, and many other features.
- Following assembly code (.asm) was written to sum the numbers present in ‘x’
array and store the final result in variable ‘y’.
- Following C code (.c) was written to sum the numbers present in ‘x’ array and
store the final result in variable ‘y’. For this, we were also required to add library
rts55.lib to the project.
- Numbers in the array are (in decimal representation) : {16384, 8192, 4096, 2048,
1024, 512, 256, 128, 64, 32}
Observations and Results :-
- Theoretically required sum is 16384 + 8192 + 4096 + 2048 + 1024 + 512 + 256 +
128 + 64 + 32, which is equal to 32736 (in decimal representation) and 7FE0 (in
hexadecimal representation)
- From the memory values shown below, we can see that x is an array storing the
required values in contiguous memory segment and y is another 32-bit variable
storing the required sum 0x7FE0.
2) C language code :
- Clock cycles used = 532 (as shown below)
- Also value obtained for y is 32736 (decimal equivalent of 0x7FE0), hence we can
say that both of our programs are working correctly.
Conclusion :-
In this experiment we implemented programs for summing numbers of array, in
assembly as well as C language. We also observed the difference between the clock
cycles required for both the programs.
Clearly Assembly program required much less cycles as they are written directly as low
level instructions and much less operations are executed per instruction line. Also
assembly language typically has a direct mapping between assembly language code
statements and machine language instructions whereas C does not have such a direct
mapping, so compilers have to do quite a bit of translation to create machine language.
This translation typically involves some extra overhead as it is typically more general and
thus needs extra code than actually required to execute the desired instructions. And
thus this requires more clock cycles.
References :-
[1] ELP-319 Lab Manual
[2] Mnemonic Instruction Set Reference Guide
[3] https://www.quora.com/How-is-assembly-faster-than-C-C++
[4] https://www.techopedia.com/definition/3903/assembly-language
[5] www.mathworks.com/products/connections/product_detail/code-composer-studio