Wednesday, 6 March 2013

Monday, 4 March 2013

Write a program in C++ using a nested for loop to print the contents of a double dimensional array in matrix format.


/*Program to print the contents of a double dimensional array in matrix format.*/
#include<iostream.h>
void main()
{
          int a[10][10]; /*two dimensional array for matrix representation*/
          int i,j;
          int row,col;
          cout<<”Enter row and column of a matrix (up to 10): “;
          cin<<row<<col;
cout<<”Enter the elements for the”<<row<< “X”<<col<<” matrix : ” <<endl;
/*store elements in two dimensional array*/

Sunday, 3 March 2013

Write about the key features of OOPS with relevant real time examples.

A major factor in the invention of Object-Oriented approach is to remove some of the flaws encountered with the procedural approach. In OOP, data is treated as a critical element and does not allow it to flow freely. It bounds data closely to the functions that operate on it and protects it from accidental modification from outside functions. OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. A major advantage of OOP is code reusability.

Objects

Write the different between a) Latch and flip flop b) Synchronous and Asynchronous latches.

a) Difference between Latch and flip flop

Latches are Level Sensitive, while Flip-Flops are Edge  Sensitive.
A positive level latch is transparent to the positive level(enable), and it lathes the final input before it is changing its level(i.e. before enable goes to '0' or before the clock goes to -ve level.
A positive edge flop will have its output effective when the clock input changes from '0' to '1' state ('1' to '0' for negedge flop) only.
For posedge flop check out the Morris mano book (digital design), in that he gave how the flop behaves with respect to an edge. (Explained with Gate level logic diagram). This will gives you a clear picture of Flop.