Home » SolvedQuestions » CUSAT B.Tech S3 CS Solved Question for OOPS

CUSAT B.Tech S3 CS Solved Question for OOPS

CUSAT B.Tech S3 CS Question for OOPS (Object Oriented Programming)Nov-2014

1

Solution of CUSAT B.Tech S3 CS Question for OOP (Object Oriented -Programming)Nov-2014

ANSWERS

PART A

(a)Write the advantages of Object Oriented Programming.

 

  • Through inheritance, we can eliminate redundant code extend the use of existing
  • Classes.
  • We can build programs from the standard working modules that communicate with one another, rather than having to start writing the code from scratch. This leads to saving of development time and higher productivity.
  • The principle of data hiding helps the programmer to build secure program that can not be invaded by code in other parts of a programs.
  • It is possible to have multiple instances of an object to co-exist without any interference.
  • It is possible to map object in the problem domain to those in the program.
  • It is easy to partition the work in a project based on objects.
  • The data-centered design approach enables us to capture more detail of a model can implemental form.
  • Object-oriented system can be easily upgraded from small to large system.
  • Message passing techniques for communication between objects makes to interface descriptions with external systems much simpler.
  • Software complexity can be easily managed.

 (b)Explain function overloading.

Fig. 1.7 illustrates that a single function name can be used to handle different number and different types of argument. This is something similar to a particular word having several different meanings depending upon the context. Using a single function name to perform different type of task is known as function overloading.

2

Polymorphism plays an important role in allowing objects having different internal structures to share the same external interface. This means that a general class of operations may be accessed in the same manner even though specific action associated with each operation may differ.

(c)Describe static members of a class.

Data members and member functions of a class in C++, may be qualified as static. We can have static data members and static member function in a class.

Static Data Member: It is generally used to store value common to the whole class. The static data member differs from an ordinary data member in the following ways :

(i) Only a single copy of the static data member is used by all the objects.

(ii) It can be used within the class but its lifetime is the whole program.

 

For making a data member static, we require :

(a) Declare it within the class.

(b) Define it outside the class.

 

for example

Class student

{

Static int count; //declaration within class

—————–

—————–

—————–

};

The static data member is defined outside the class as :

int student :: count; //definition outside class

Static Member Function: A static member function can access only the static members of a class. We can do so by putting the keyword static before the name of the function while declaring it for example,

Class student

{

Static int count;

—————–

public :

—————–

—————–

static void showcount (void) //static member function

{

Cout<<”count=”<<count<<”\n”; }

};

int student ::count=0;

Here we have put the keyword static before the name of the function shwocount ().

In C++, a static member function fifers from the other member functions in the following ways:

(i) Only static members (functions or variables) of the same class can be accessed by a static member function.

(ii) It is called by using the name of the class rather than an object as given below:

 

Name_of_the_class :: function_name

For example,

student::showcount();

(d)Explain data hiding.

The wrapping up of data and function into a single unit (called class) is known as encapsulation. Data and encapsulation is the most striking feature of a class. The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. These functions provide the interface between the object’s data and the program. This insulation of the data from direct access by the program is called data hiding or information hiding.

 

The principle of data hiding helps the programmer to build secure program that can not be invaded by code in other parts of a programs.

The data hiding concept in C++ is achieved by using the keyword private. Private data and functions can only be accessed from within the class itself. Public data and functions are accessible outside the class also. This is shown below :

3

Data hiding not mean the security technique used for protecting computer databases. The security measure is used to protect unauthorized users from performing any operation (read/write or modify) on the data.

(e)What is virtual base class?Explain the working of constructors in virtual base class.

Multipath inheritance may lead to duplication of inherited members from a grandparent base class.this may be avoided by making the common base class a virtual base class.

4

consider the above figure  the child has two  direct base classess parent1 and parent 2 which themselves have a common base class grandparent.the  child inherits the traits of grandfather via two separate paths.it can also inherit directly as shown by the broken line.the grand parent  is sometimes  referred to as indirect base class.all the public and protected members of grandparents  are inherited into child twice first via parent1 and again through parent2.

Class A

{

};

Class B1:virtual public A

{

};

Class B2:public virtual A

{

};

Class C : public B1,public B2

{

};

 

(f)        Write short notes on new and delete operators.

New Operator

In C++, the pointer support dynamic memory allocation (allocation of memory during runtime). While studying arrays we declared the array size approximately. In this case if the array is less than the amount of data we cannot increase it at runtime. So, if we wish to allocate memory as and when required new operator helps in this context.

The syntax of the new operator is given below :

pinter_variable = new data_type;

For example,

Char *cptr = new char (‘j’];

Int *empno = new int [size]; //size must be specified

Delete Operator

It is used to release or deallocate memory. The syntax of delete operator is :

delete_pointer_variable;

For example,

delete cptr;

delete [ ] empno; //some versions of C++ may require size

(g)        Write a program to overload any unary operator.

#include<iostream.h>

Using namespace std;

Class space

{

Int x,y,z;

Public:

Void getdata(int a,int b,int c);

Void display(void);

Void operator();

};

Void space : : getdata(int a,int b,int c)

{

X=a;

Y=b;

Z=c;

}

Void space : : display(void)

{

Cout<<x<<” ”;

Cout<<y<<” ”;

Cout<<z<<”\n ”;

}

Void space:: operator-()

{

X=-x;

Y=-y;

Z=-z;

}

Int main()

{

Space s;

s.getdata(10,-20,30);

cout<<”s”;

s.display();

-s;

Cout<<”s”;

s.display();

return 0;

}

 

 

 (h)      Explain exception handling.

Exceptions are basically of two types namely, synchronous and asynchronous exceptions. Errors such as “out of range index” and “over flow” belongs to synchronous type exceptions.The errors that are caused by the events beyond the control of program(such as keyboard interrupts) are called asynchronous exceptions.

The purpose of exception handling mechanism is to detect and report an exceptional circumstances so that appropriate action can be taken.The mechanism for exception handling is

1.Find the problem(hit the exception).

2.Inform that an error has occurred(throw the exception).

3.Receive the error information(Catch the exception).

4.Take corrective actions(Handle the exception).

The error handling code mainly consist of two segments,one to detect error and throw exceptions and other to catch the exceptions and to take appropriate actions.

C++ exception handling mechanism is basically built upon three keywords namely try,throw and catch.The keyword try is used to preface a block of statements which may generate exceptions.This block of statement is called try block.When an exception is detected it is thrown using throw statement in the try block.A catch block defined by the keyword catch ‘catches’ the exception thrown by the throw statement in the try block and handles it appropriately. The catch block that catches an exception must immediately follow the try block that throws the exception.The general form for this is

……………….

………………..

try

{

…………

…………….. //block of statements which detects and throw an exceptions

throw exception;

…………….

…………….

}

catch(type arg) //catches exceptions

{

…………… // Block of statements that handles the exceptions

………………

…………….

}

………….

…………..

 

  1. (a) Compare procedure oriented and object oriented programming languages.(5)

In the procedure oriented approach, the problem is viewed as the sequence of things to be done. The primary focus is on functions. The technique of hierarchical decomposition has been used to specify the tasks to be completed for solving a problem. Procedure oriented programming basically consists of writing a list of instructions for the computer to follow, and organizing these instructions into groups known as functions. In a multi-function program, many important data items are placed as global so that they may be accessed by all the functions. Each function may have its own local data. Global data are more vulnerable to an inadvertent change by a function. In a large program it is very difficult to identify what data is used by which function. In case we need to revise an external data structure, we also need to revise all functions that access the data. This provides an opportunity for bugs to creep in.Another serious drawback with the procedural approach is that we do not model real world problems very well. This is because functions are action-oriented and do not really corresponding to the element of the problem.

The major motivating factor in the invention of object-oriented approach is to remove some of the flaws encountered in the procedural approach. OOP treats data as a critical element in the program development and does not allow it to flow freely around the system. It ties data more closely to the function that operate on it, and protects it from accidental modification from outside function. OOP allows decomposition of a problem into a number of entities called objects and then builds data and function around these objects.

            (b)       describe goto,break,continue,and return with suitable examples.(10)

Goto

 

If the sentence label S is found before the goto label sentence, the function

_ gives the environment whose sentences we have to execute.

Syntax:

Goto label;

………….

………….

Label:

Statement;

 

continue

The continue statement passes control to the next iteration of the for or

while loop in which it appears, skipping any remaining statements in the body

of the loop. In nested loops, continue passes control to the next iteration of

the for or while loop enclosing it.

The example below shows a continue loop that counts the lines of code in the

file, magic.m, skipping all blank lines and comments. A continue statement is

used to advance to the next line in magic.m without incrementing the count

whenever a blank line or comment line is encountered.

fid = fopen(’magic.m’, ’r’);

count = 0;

while ~feof(fid)

line = fgetl(fid);

if isempty(line) | strncmp(line, ’%’, 1)

continue

end

count = count + 1;

end

disp(sprintf(’%d lines’, count));

break

The break statement terminates the execution of afor loop or while loop.

When a break statement is encountered, execution continues with the next

statement outside of the loop. In nested loops, exits from the innermost

statement is encountered, execution continues with the next

statement outside of the loop. In nested loops, break exits from the innermost

loop only.

The example below shows a while loop that reads the contents of the file

fft.m into a MATLAB character array. A break statement is used to exit the

while loop when the first empty line is encountered. The resulting character

array contains the M−file help for the fft program.

fid = fopen(’fft.m’, ’r’);

s = ’’;

while ~feof(fid)

line = fgetl(fid);

if isempty(line)

break

end

s = strvcat(s, line);

end

disp(s)

Return

A function may or may not return a value.a return statement returns a value to the calling function and assighns to the variablein the left side of the calling funvtion.if a function doesnot return a value,the return type in the function definition and declaration is specified as void.

Eg: return(0);

III.       (a)        Explain the key conept od object oriented programming.(10)

concepts used in object-oriented programming include:

  • Objects
  • Classes
  • Data abstraction and encapsulation
  • Inheritance
  • Polymorphism
  • Dynamic binding
  • Message passing

 

 

 Objects

Objects are the basic run time entities in an object-oriented system. They may represent a person, a place, a bank account, a table of data or any item that the program has to handle. They may also represent user-defined data such as vectors, time and lists. Programming problem is analyzed in term of objects and the nature of communication between them.

5

Classes

The entire set of data and code of an object can be made a user-defined data type with the help of class. Once a class has been defined, we can create any number of objects belonging to that class. Each object is associated with the data of type class with which they are created. A class is thus a collection of objects similar types.

Data Abstraction and Encapsulation

The wrapping up of data and function into a single unit (called class) is known as encapsulation. Data and encapsulation is the most striking feature of a class. The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. These functions provide the interface between the object’s data and the program. This insulation of the data from direct access by the program is called data hiding or information hiding.

Abstraction refers to the act of representing essential features without including the background details or explanation. Classes use the concept of abstraction and are defined as a list of abstract attributes such as size, wait, and cost, and function operate on these attributes. They encapsulate all the essential properties of the object that are to be created.

Inheritance

Inheritance is the process by which objects of one class acquired the properties of objects of another classes. It supports the concept of hierarchical classification. In OOP, the concept of inheritance provides the idea of reusability. This means that we can add additional features to an existing class without modifying it. This is possible by deriving a new class from the existing one. The new class will have the combined feature of both the classes.

 

Polymorphism

Polymorphism is another important OOP concept. Polymorphism, a Greek term, means the ability to take more than on form. An operation may exhibit different behavior is different instances. The behavior depends upon the types of data used in the operation. The process of making an operator to exhibit different behaviors in different instances is known as operator overloading. Using a single function name to perform different type of task is known as function overloading.

Dynamic Binding

Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding means that the code associated with a given procedure call is not known until the time of the call at run time.

Message Passing

An object-oriented program consists of a set of objects that communicate with each other. The process of programming in an object-oriented language, involves the following basic steps:

  1. Creating classes that define object and their behavior,
  2. Creating objects from class definitions, and
  3. Establishing communication among objects.

Message passing involves specifying the name of object, the name of the function (message) and the information to be sent.

 

            (b)       Differentiate call by value and call by reference(5)

Call by Value: – In this method the values of the actual parameters (appearing in the function call) are copied into the formal parameters (appearing in the function definition), i.e., the function creates its own copy of argument values and operates on them. The following program illustrates this concept :

//calculation of compound interest using a function

#include<iostream.h>

#include<conio.h>

#include<math.h> //for pow()function

Void main()

{

Float principal, rate, time; //local variables

Void calculate (float, float, float); //function prototype clrscr();

Cout<<”\nEnter the following values:\n”;

Cout<<”\nPrincipal:”;

Cin>>principal;

Cout<<”\nRate of interest:”;

Cin>>rate;

Cout<<”\nTime period (in yeaers) :”;

Cin>>time;

Calculate (principal, rate, time); //function call

Getch ();

}

//function definition calculate()

Void calculate (float p, float r, float t)

{

Float interest; //local variable

Interest = p* (pow((1+r/100.0),t))-p;

Cout<<”\nCompound interest is : “<<interest;

}

Call by Reference: – A reference provides an alias – an alternate name – for the variable, i.e., the same variable’s value can be used by two different names : the original name and the alias name.

In call by reference method, a reference to the actual arguments(s) in the calling program is passed (only variables). So the called function does not create its own copy of original value(s) but works with the original value(s) with different name. Any change in the original data in the called function gets reflected back to the calling function.

It is useful when you want to change the original variables in the calling function by the called function.

//Swapping of two numbers using function call by reference

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int num1,num2;

void swap (int &, int &); //function prototype

cin>>num1>>num2;

cout<<”\nBefore swapping:\nNum1: “<<num1;

cout<<endl<<”num2: “<<num2;

swap(num1,num2); //function call

cout<<”\n\nAfter swapping : \Num1: “<<num1;

cout<<endl<<”num2: “<<num2;

getch();

}

//function fefinition swap()

void swap (int & a, int & b)

{

Int temp=a;

a=b;

b=temp;

}

IV        (a)Explain Friend function(5)

to make an outside  functions friendlyto a class we have to simply declare this functions as a friend of the class as shown below,

class ABC

{

…….

…….

Public:

…….

…….

Friend void xyz(void);

};

the function  declaration should be preceded by the keyword friend.the function is defined elsewhere in the program.the function definition doesnot use either the keyword friendor the scope operator::.the function that are  declared with keyword friend are known as friend functios.

A function can be declared as friend in any number of classes.

(b)Write a program to display prime numbers using friend function(10)

V         Explain the following with example

(i)Inline function

These are the functions designed to speed up program execution. An inline function is expanded (i.e. the function code is replaced when a call to the inline function is made) in the line where it is invoked. You are familiar with the fact that in case of normal functions, the compiler have to jump to another location for the execution of the function and then the control is returned back to the instruction immediately after the function call statement. So execution time taken is more in case of normal functions. There is a memory penalty in the case of an inline function.

The system of inline function is as follows :

inline function_header

{

body of the function

}

The inlining does not work for the following situations :

  1. For functions returning values and having a loop or a switch or a goto statement.
  2. For functions that do not return value and having a return statement.
  3. For functions having static variable(s).
  4. If the inline functions are recursive (i.e. a function defined in terms of itself).

 

The benefits of inline functions are as follows :

  1. Better than a macro.
  2. Function call overheads are eliminated.
  3. Program becomes more readable.
  4. Program executes more efficiently.

 

(ii)Copy constructor(5)

Copy Constructor

It is of the form classname (classname &) and used for the initialization of an object form another object of same type. For example,

Class fun

{

Float x,y;

Public:

Fun (floata,float b)//constructor

{

x = a;

y = b;

}

Fun (fun &f) //copy constructor

{cout<<”\ncopy constructor at work\n”;

X = f.x;

Y = f.y;

}

Void display (void)

{

Cout<<””<<y<<end1;

}

};

Here we have two constructors, one copy constructor for copying data value of a fun object to another and other one a parameterized constructor for assignment of initial values given

Constructor overloading.

Overloaded Constructors

Besides performing the role of member data initialization, constructors are no different from other functions. This included overloading also. In fact, it is very common to find overloaded constructors. For example, consider the following program with overloaded constructors for the figure class :

Class figure

{

Private:

Float radius, side1,side2,side3; //data members

Char shape[10];

Public:

figure(float r) //constructor for circle

{

radius=r;

strcpy (shape, “circle”);

}

figure (float s1,float s2) //constructor for rectangle

strcpy

{

Side1=s1;

Side2=s2;

Side3=radius=0.0; //has no significance in rectangle strcpy(shape,”rectangle”);

}

Figure (float s1, floats2, float s3) //constructor for triangle

{

side1=s1;

side2=s2;

side3=s3;

radius=0.0;

strcpy(shape,”triangle”);

}

void area() //calculate area

{

float ar,s;

if(radius==0.0)

{

if (side3==0.0)

ar=side1*side2;

else

ar=3.14*radius*radius;

cout<<”\n\nArea of the “<<shape<<”is :”<<ar<<”sq.units\n”;

}

};

Void main()

{

Clrscr();

Figure circle(10.0); //objrct initialized using constructor

Figure rectangle(15.0,20.6);//objrct initialized using onstructor

Figure Triangle(3.0, 4.0, 5.0); //objrct initialized using constructor

Rectangle.area();

Triangle.area();

}

  1. Define inheritance.explain different kind of inheritances(15)

Inheritance is the process by which objects of one class acquired the properties of objects of another classes. It supports the concept of hierarchical classification. In OOP, the concept of inheritance provides the idea of reusability. This means that we can add additional features to an existing class without modifying it. This is possible by deriving a new class from the existing one. The new class will have the combined feature of both the classes.

 

SINGLE INHERITANCE

 

Single Level Inheritance

A derived class with only one base class is called single inheritance. Consider a simple example of single inheritance. In this program show a base class B and derived class D. The class B contains one private data member, one public data member, and three public member functions. The class D contains one private data members and two public member functions.

6

MULTIPLE INHERITANCE

A class can have more than one direct base classes.

Consider the following classes:

Class A {/* …..*/};

Class B {/* …..*/};

Class C : public A, public B

{ /*

.

*/

};

This is called Multiple Inheritance. If a class is having only one base class, then it is

known as single inheritance. In the case of Class C, other than the operations

specified in it, the union of operations of classes A and B can also be applied. A class can inherit properties from more than one class which is known as multiple inheritances.

This form of inheritance can have several super classes. A class can inherit the attributes of two or more classes as shown below diagram.

Multiple inheritances allow us to combine the features of several existing classes as a starting point for defining new classes. It is like a child inheriting the physical features of one parent and the intelligent if another.

 7

Hierarchical Inheritance

When the properties of one class are inherited by more than one class, it is called hierarchical inheritance.

This form has one super class and many Subclasses. More than one class inherits the traits of one class. For example: bank accounts.

8

Multi Level Inheritance

A class can be derived from another derived class which is known as multilevel inheritance.

Order of Constructor Calling in Multilevel Inheritance, when the object of a subclass is created the constructor of the subclass is called which in turn calls constructor of its immediate super class.

For example, if we take a case of multilevel inheritance, where class B inherits from class A, and class C inherits from class B, which show the order of constructor calling.

9

Hybrid Inheritance

There could be situations where we need to apply two or more types of inheritance to design one inheritance called hybrid inheritance.

For instance, consider the case of processing the student results, the weight age for sport is stored in separate classes.

10

VII.     (a) Write a program to implement multilevel inheritance in bank operations[BankàAccountàClient](10)

Example of Multilevel Inheritance

class A

{

A()

{

System.out.println(“Constructor of Class A has been called”);

}

}

class B extends A

{

B()

{

super();

System.out.println(“Constructor of Class B has been called”);

}

}

class C extends B

{

C()

{

super();

System.out.println(“Constructor of Class C has been called”);

}

}

class Constructor_Call

{

public static void main(String[] args)

{

System.out.println(“——Welcome to Constructor call Demo——“);

C objc = new C();

}

}

            (b)What is this pointer ?Explain the uses of this pointer with example.(5)

The this is a pointer that points to that object using which the function is called. The This pointer is automatically passed to a member function when it is called.

Each time your program creates a class instance (e.g. a and b in the following program), C++ creates a special pointer called this, which contains the address of the current object instance. Each time your program invokes an instance method (e.g. a.init()), the compiler pre-assigns a special pointer named this to point to the object instance. The value of this pointer changes with different instance invocations. C++ recognizes the this pointer only when a non-static member of the object instance is executing. The instances, in turn, use the this pointer to access the different methods.Every member function of a class has an implicitly defined constant pointer called this. The type of this is the type of the class of which the function is member. It is initialized when a member function is called  to the address of the class instance for which the function was called.The following statement is used to return the value to which this points to currently.return (*this);

 

VIII.    (a)        Explain the use of class template with an example.(10)

Template is a new concept which enables us to define generic and functions and thus provides support for generic programming. Generic programming as an approach where generic types are used as parameters in algorithms so that they work for a variety of suitable data types and data structures.

A template can be used to create a family of classes or functions.

The general format of a class template is: Template<class T>

class classname

{

//class member specification

//with anonymous type T

//whenever appropriate

….

….

};

The template definition of vector class shown below illutrates the syntax of a template:

#include <iostream>

using namespace std;

const size=3;

template<class T>

class vector

{

T*v; // type T vector

public:

vector()

{

v=new T[size];

for(int i=0;i<size;i++)

v[i]=0;

}

vector(T* a)

{

for(int i=0;i<size;i++)

v[i]=a[i];

}

T operator*(vector &y)

{

T sum=0;

for(int i=0;i<size;i++)

sum+=this->v[i]*y.v[i];

return sum;

}

};

int main()

{

int x[3]={1,2,3};

int y[3]={4,5,6};

vector<int> v1;

vector<int> v2;

v1=x;

v2=y;

int R= v1*v2;

cout<<”R=”<<r<<”\n”;

return 0;

}

The class template definition is very similar to an ordinary class definition except the prefix template<class T> and the use of type T. This prefix tells the complier that we are going to declare a template and use T as a type name in the Declaration. Thus, vector has become a parameterized class with the type T as its parameters. T may be substituted by any data type including the user defined types. Now we can create vectors for holding different data types.

Example;

vector<int> v1(10); //10 element int vector

vector<float> v2(30); //30 element float vector

The type T may represent a class name as well.

Example:

Vector<complex> v3 (5); // vector of 5 complex numbers

A class created from a class template is called a template class. The syntax for defining an object of a template class is:

Classname<type> objectname (arglist);

This process of creating a specific class from a class template is called instantiation. The complier will perform the error analysis only when an instantiating take place. It is,

therefore, advisable to create and debug an ordinary class before converting it in to template.

therefore, advisable to create and debug an ordinary class before converting it in to template

            (b)       List any five string handling functions with syntax.(5)

1.Strlen()

Calculate the length of string

Syntax  strlen(s1);

2.Strcpy()

Copies a string to another string

Syntax :strcpy(s1,s2)

3.strcat()

Concatenates two strings

Syntax:strcat(s1,s2)

4.strcmp()

Compare two strings

Syntax:strcmp(s1,s2)

5.strlwr()

Converts string to lowercase

Strlwr(s1)

IX        (a)        Explain virtual function.(5)

If there are member functions with same name in base class and derived class ,virtual function gives programmer capability to call member functionof different classby a same function call depending upon different context.this featurein c++ is known as polymorphismwhich is one of the important feature of OOP

If base class and derived class has same functionand if you write codeto accessthat function using pointerof base class then the functionin the base classis executed even if the object of derived classis referencedwith that pointer variable

            (b)       List different file opening modes and explain file manipulators with example.(10)

File Opening Modes:

The ifstream and ofstream constructors and the function open() are used to open the files.Upto now a single arguments a single argument is used that is filename.However,these functions can take two arguments, the second one for specifying the file mode.The general form of function open() with two arguments is:

stream-object.open(“filename”,mode);

The second argument mode specifies the purpose for which the file is opened.The prototype of these class member functions contain default values for second argument and therefore they use the default values in the absence of actual values.The default values are as follows :

ios::in for ifstream functions meaning open for reading only.

ios::out for ofstream functions meaning open for writing only.

The file mode parameter can take one of such constants defined in class ios.The following table lists the file mode parameter and their meanings.

11

File manipulators

Close-close a file

CloseIn-close an input file

closeout-close an output file

endl-end of an output file

flush-flush output to file

5,084 total views, 2 views today

Leave a Reply

x

Check Also

Kerala University S8 CS Solved Questions of Software Engineering

Kerala University S8 CS Solved Questions of Software Engineering &Project Management April-2012 ...

3

CUSAT B.Tech S5 CS Solved Question for Microprocessor Based System Design

CUSAT B.Tech S5 CS Solved Question for Microprocessor Based System Design June-2011 ...