Vous êtes sur la page 1sur 4

SUDHARSAN ENGINEERING COLLEGE

Sathiyamangalam—622 501, Pudukkottai (Dt.)

Department Of Electronics and Communication Engineering


Class : III (I.T) Total Marks: 20 Marks
Date : 18.08.2010 Time : 9.15 am to 10.05 am

EMBEDDED SYSTEMS

DRILL TEST – VIII

Answer all the Questions

PART – A (4 x 2 = 8 Marks)
1. What are the benefit of optimization of memory needs?

 When codes are made compact and fitted in available memory areas without
affecting the code performance that is called as an Optimization memory.

 It reduces also the total number of CPU cycles.

2. What is Cross Compiler?

Two Compilers are pre-required. One compiler is for the host computer which does
the development and design and also the testing and debugging. The second compiler
is a cross compiler. The cross compiler runs on a host but develops the machine code
for a target system. Example GNU Compiler.

3. Name some features of source code engineering tools for embedded C++.

 It searches and lists the dependencies and hierarchies of included header files.

 Naviagation

 Editing

 Debugging

 Configuring

4. What is meant by Reentrant Function?

A function is called Reentrant if three conditions are satisfied.

All the arguments pass the values and none of the argument is a pointer.
SUDHARSAN ENGINEERING COLLEGE
Sathiyamangalam—622 501, Pudukkottai (Dt.)

Department Of Electronics and Communication Engineering


When an operation is not atomic that function should not operate on any variable

 Function doesn‟t call any other function that is not itself re-entrant.

PART – B (1 x 12 = 12 Marks)

5. Explain the Embedded programming in C++.


 C++ is an object oriented Program (OOP) language, which in addition, supports
the procedure oriented codes of C.
 Program coding in C++ codes provides the advantage of objected oriented
programming as well as the advantage of C and in-line assembly.

C++

struct that binds all the member functions together in C. But a C++ class has object
features. It can be extended and child classes can be derived from it. A number of
child classes can be derived from a common class. This feature is called
polymorphism. A class can be declared as public or private. The data and methods
access is restricted when a class is declared private. Struct does not have these
features.
 A class binds all the member functions together for creating objects. The objects
will have memory allocation as well as default assignments to its variables that
are not declared static
 A class can derive (inherit) from another class also. Creating a child class from
RTCSWT as a parent class creates a new application of the RTCSWT.
 Methods (C functions) can have same name in the inherited class. This is called
method overloading
 Methods can have the same name as well as the same number and type of
arguments in the inherited class. This is called method overriding. These are the
two significant
 features that are extremely useful in a large program.
 Operators in C++ can be overloaded like in method overloading.
 For example, operators ++ and ! are overloaded to perform a set of operations.
Disadvantages
SUDHARSAN ENGINEERING COLLEGE
Sathiyamangalam—622 501, Pudukkottai (Dt.)

Department Of Electronics and Communication Engineering


 Lengthier Code when using Template, Multiple Inheritance (Deriving a class
from many parents), Exceptional handling, Virtual base classes and classes for IO
Streams.

Ways to overcome the disadvantages

 Declare private as many classes as possible. It helps in optimising the generated


codes.
 Use char, int and boolean (scalar data types) in place of the objects (reference
data types) as arguments and use local variables as much as feasible.
 Recover memory already used once by changing the reference to an object to
NULL.
 A special compiler for an embedded system can facilitate the disabling of
specific features provided in C++.
 Embedded C++ is a version of C++ that provides for a selective disabling of the
above features
 Use Embedded C++: It provides for less runtime overhead and less runtime
library. The solutions for the library functions are available and ported in C
directly.
 The IO stream library functions in an embedded C++ compiler are also reentrant.
6. Write about the „C‟ Program elements.
The ‘C’ program elements are
1. Header
a. Include directive is used to include various header files such as
i. include <stdio.h>
ii. include <conio.h>
iii. include <math.h>
iv. include <stdlib.h>
2. Source files
3. Pre-processor directives
a. Include code files  “filename.c”
SUDHARSAN ENGINEERING COLLEGE
Sathiyamangalam—622 501, Pudukkottai (Dt.)

Department Of Electronics and Communication Engineering


b. Include the constant data files  these data files are stored and
maintained for the program code which have to be extended with
.const extension.
4. Include the string data files  Are available for storing string.
5. Include initial data file  To store the default value.

Vous aimerez peut-être aussi