Wednesday, 4 January 2012

DLD PUT PAPER


Pre-University Examination
Digital Logic Design
Time: 3 Hours                                             Max Mark : 100

Note:- Attempt All Question

1. Attempt any four.
(a).Represent decimal 5137 in the 2421 code. Show that the code is self-complementation and perform 954+469 BCD numbers and also show the necessary steps for their sum.
(b).Explain singed binary no and the range of 16 bit unsigned no, 16 bit signed one’s complement no and the range of 16 bit singed 2’s complement number.
(c).Simplify the following function using tabulation method implements the reduced function using NAND gates only.

F(A,B,C,D,E)=M(0,1,3,5,6,9,11,14,21,23,24,31)+d(25,30)
Assume both normal and complement inputs are available.

(d). Simplify the following expression to SOP and POS form both------
(I).  (A+C+DI)(AI+B+DI)(AI+BI+DI)(AI+B+CI)
(II). ACDI+CID+ABI+ABCD

(e). Explain how does parity help in error detection? Given the 8-bit data word 01011011, generate the 13-bit composite word for the hamming code that corrects single errors and detects double errors.
(f). Explain the floating point data representation for decimal no. and binary number when it a floating point number said to be a normalized. Represent the no. (46.5)10 as a 32-bit floating binary number.

2. 1. Attempt any four.
(a). Describe look ahead carry adder.
(b). Explain priority encoder and design a four input priority encoder but with input D0 having the highest priority and input D3 the lowest priority.
(c). Design a code converter that converts a decimal digit from the 8,4,-2,-1 code to BCD.
(d). A binary multiplier multiplies two unsigned 4-bit number. Design the circuit using AND gates and binary adders.
(e). Show that a full subtracter can be constructed with 2 half subtracter and an OR gate and Implemented full adder with two 4×1 MUX.
(f).Construct a 5:32 decoder with 4 3:8 decoders with enable and a 2:4line decoder.
3. Attempt any four.
(a). What is race around condition in JK latch? How to avoid it. Draw and explain the working of master slave J-K flip flop.
(b). Explain shift register its application & universal shift register.
4.  Attempt any two.
(a). Explain in brief the ASM chart. Explain how the ASM chart differ from a state diagrame.
Show the 8 exit paths in an ASM block emanating from the decision boxes that check the 8 possible binary values of 3 cntrol variables x,y,z.
(b). Draw the ASM chart for a circuit with two 8-bit register RA,RB that receive two unsigned binary numbers that perform the subtraction operation RA-RB→RA use 2’s complement method for subracctio and set a borrow to 1 if answer is negative.
(c). what is PLA? How is differ from ROM. List PLA programming table for the BCD to excess-3 code converter.

5. 1. Attempt any tow.
(a). Explain what is hazards & different types of Hazards, how hazards occure in combination circuit.
(b).
(i). Explain the difference between asynchronous and synchronous sequential circuit.
(ii). Define fundamental –mode operation.
(iii). Explain the difference between stable and unstable state.
(iv).What is the difference between an internal state and a total state?



  

Tuesday, 3 January 2012

PUT PAPER OF D.S

Pre University Exam 
B.Tech(CS)-III Semester
Data Structure Using C(ECS-302)
1.Attempt any four parts.
(a). Define abstract data type. Write a program to sort 100 complex numbers into ascending number of their absolute values. Given absolute value (X+iY)=(X2+Y2)1/2

(b). Write a C function to concatenate two circularly linked lists pointed by list1 and list2 in such a way that circular list pointed by list1 is appended to the circular list pointed by list2.

(c) .describe the asymptotic notation. Explain what you understand by worst case complexity of an algorithm.

(d).Explain the linked list representation of a polynomial? WAP for addition of polynomial.

 (e).What are sparse matrices? Explain hoe they are represented?

(f).Calculate the address of A[10][20] of the given matrix A[50][50],having float values in row major and column major order.

2. Attempt any four parts.

(a).Write the algorithm to evaluate a postfix expression using a stack. And evaluate the following: 5,6,2,+,*,12,4,1,-,-,*

(b).Write down the algorithm for the insertion and deletion operation performed on the DeQueue.

(c). What is the advantage of circular queue representation over simple queue representation, when arrays are used?

(d). Describe priority queues and explain the insertion and deletion operation in them through program.

(e). Explain tower of Hanoi problem and give the solution to the problem where the no. of disks is 4.

(f). Write the algorithm to convert the infix expression to postfix expression.

3. Attempt any two parts.
(a). What is a binary tree? How is it represented in the memory? Write an algorithm to delete and insert a nodes from threaded binary tree.

(b). Show that the maximum no. of nodes in a binary tree of height h is 2(h-1)+1.

(c). Describe Huffman algorithm and its application and draw tree for the following symbols frequency of occurrence in a message is stated along with the symbol below: A: 15, B: 6, C: 7,D: 12, E: 25,F: 4,H: 1,I: 15

(d).WAP to create and insert elements in a binary search tree.

4. Attempt any two parts.

(a). Discuss sdjacency list representation of graph. Explain DFS of the graph.

(b). Discuss Prim’s and Kruskal’s algorithm for finding the minimum cost spanning tree.Compare them and explain with example.

(c). Write the dijikstra algorithm for all pair shortest path. Explain with example.

5. Attempt any two parts.

(a). Define multi-way search tree. Define AVL tree. Show the steps to build an AVL tree for following :   A  Z  B  Y  C  X  D  U  E

(b). How the choice of pivot element affect the running time of quick sort. Write the algorithm for the heap sort. Sort the following using merge sort method. 75   10   70   80   90  100  40
  
(c).  
1.  Explain the term Garbage collection and compaction.
2. What is hashing? Discuss various collision resolution strategies foe hash table.






Wednesday, 14 December 2011

c program of Least Square method for curve fitting.


Implementation of Least-square method for curve fitting.

#include<stdio.h>
#include<conio.h>
#include<math.h>
 main()
{
  float x[10],y[10],a[10][10];
  int i,j,k,n,itr;
  printf("\n ENTER THE SIZE OF MATRIX n:");
  scanf("%d",&n);
  printf("\n ENTER MATRIX ELEMENTS AND RHS:\n");
  for(i=1;i<=n;i++)
  {
    for(j=1;j<=n+1;j++)
    scanf("%f",&a[i][j]);
  }
  for(i=1;i<=n;i++)
  {
    x[i]=0.0;
    y[j]=0.0;
  }
  itr=0.0;
  top:
  itr=itr+1;
  for(i=1;i<=n;i++)
  {
    x[i]=a[i][n+1];
    for(j=1;j<=n;j++)
    {
      if(i==j)
      continue;
     else
     x[i]=x[i]-a[i][j]*x[j];
    }
    x[i]=x[i]/a[i][j];
  }
  for(k=1;k<=n;k++)
  if(fabs(x[k]-y[k])>0.0001)
  {
    printf("\n ITERATION=%d}",itr);
    for(i=1;i<=n;i++)
    {
      y[i]=x[i];
      printf("\n x(%d)=%f",i,x[i]);
    }
    goto top;
    }
    else
    continue;
    return;

    }

c program of simpson's 1/3 rule.


Implementation of Simpson’s 1/3 Rule.

#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<process.h>
#include<string.h>
float fun(float);
void main()
{
  float result=1;
  float a,b;
  float h,sum;
  int i,j;
  int n;
  clrscr();
  printf("\n\n Enter the range-");
  printf("\n\n Lower Limit a-");
  scanf("%f",&a);
  printf("\n\n Lower Limit b-");
  scanf("%f",&b);
  printf("\n\n Enter number of subintervals -");
  scanf("%d",&n);
  h=(b-a)/n;
  sum=0;
  sum=fun(a)+4*fun(a+h)+fun(b);
  for(i=3;i<n;i++)
  {
    sum+=fun(a+(i-1)*h)+4*fun(a+i*h);
  }
  result=sum*h/3;
  printf("\n\n\n\n Value of the integral is %6.4f\t",result);
  printf("\n\n\n Press Enter to Exit");
  getch();
  }
  float fun(float x)
  {
    float temp;
    temp=1/(1+(x*x));
    return temp;
 }

c program of Gauss-seidel method.


Implementation of Gauss-Seidel Method.

#include<stdio.h>
#include<conio.h>
#include<math.h>
 main()
{
  float x[10],y[10],a[10][10];
  int i,j,k,n,itr;
  printf("\n ENTER THE SIZE OF MATRIX n:");
  scanf("%d",&n);
  printf("\n ENTER MATRIX ELEMENTS AND RHS:\n");
  for(i=1;i<=n;i++)
  {
    for(j=1;j<=n+1;j++)
    scanf("%f",&a[i][j]);
  }
  for(i=1;i<=n;i++)
  {
    x[i]=0.0;
    y[j]=0.0;
  }
  itr=0.0;
  top:
  itr=itr+1;
  for(i=1;i<=n;i++)
  {
    x[i]=a[i][n+1];
    for(j=1;j<=n;j++)
    {
      if(i==j)
      continue;
     else
     x[i]=x[i]-a[i][j]*x[j];
    }
    x[i]=x[i]/a[i][j];
  }
  for(k=1;k<=n;k++)
  if(fabs(x[k]-y[k])>0.0001)
  {
    printf("\n ITERATION=%d}",itr);
    for(i=1;i<=n;i++)
    {
      y[i]=x[i];
      printf("\n x(%d)=%f",i,x[i]);
    }
    goto top;
    }
    else
    continue;
    return;

    }