Digital Signal Processing - Lab Report - 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

ELP-319 : Lab Report

Experiment - 1
(Familiarization with Code Composer Studio (CCS))

Submitted by​: Monday Sub-Group - 3 :- Yash Garg – 2015EE10691


Performed on - 30/7/18 Narayani Bhatia – 2015EE10045

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 ​:

1) Implementing program to find sum of numbers in an array, in assembly language


2) Implementing C code for same task and comparing the clock cycles required

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.

Assembly language​ is a low-level programming language for microprocessors and other


programmable devices. With assembly language, a programmer works only with
operations that are implemented directly on the physical CPU.

Assembly languages generally lack high-level conveniences such as functions and


structs, and they are not portable between various families of processors. They have the
same structures and set of commands as machine language, but allow a programmer to
use names instead of numbers. This language is still useful for programmers when speed
is necessary or when they need to carry out an operation that is not possible in
high-level languages (like C/C++, Java).
Procedure​ :-

- 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)

1) ​Assembly Code (.asm)​ :


- Clock cycles used = 38 (as shown below)

- 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

You might also like