Saturday, 28 May 2016

Microprocessor lab Programs

MICROPROCESSORS LABORATORY
(Common to CSE & ISE)
Subject Code : 10CSL48 I.A. Marks : 25
Hours/Week : 03 Exam Hours: 03
Total Hours : 42 Exam Marks: 50
1. a) Search a key element in a list of ‘n’ 16-bit numbers using the Binary search algorithm. 
b) Read the status of eight input bits from the Logic Controller Interface and display ‘FF’ if it is the parity of the input read is even; otherwise display 00.

2. a) Write two ALP modules stored in two different files; one module is to read a character from the keyboard and the other one is to display a character. Use the above two modules to read a string of characters from the keyboard terminated by the carriage return and print the string on the display in the next line.
 b) Implement a BCD Up-Down Counter on the Logic Controller Interface.

3. a) Sort a given set of ‘n’ numbers in ascending order using the Bubble Sort algorithm. 
b) Read the status of two 8-bit inputs (X & Y) from the Logic Controller Interface and display X*Y.

4. a) Read an alphanumeric character and display its equivalent ASCII code at the center of the screen. 
b) Display messages FIRE and HELP alternately with flickering effects on a 7-segment display interface for a suitable period of time. Ensure a flashing rate that makes it easy to read both the messages (Examiner does not specify these delay values nor is it necessary for the student to compute these values).

5. a) Reverse a given string and check whether it is a palindrome or not. 
b) Assume any suitable message of 12 characters length and display it in the rolling fashion on a 7-segment display interface for a 30 suitable period of time. Ensure a flashing rate that makes it easy to read both the messages. (Examiner does not specify these delay values nor is it necessary for the student to compute these values).

6. a) Read two strings, store them in locations STR1 and STR2. Check whether they are equal or not and display appropriate messages. Also display the length of the stored strings.
 b) Convert a 16-bit binary value (assumed to be an unsigned integer) to BCD and display it from left to right and right to left for specified number of times on a 7-segment display interface

7. a) Read your name from the keyboard and display it at a specified location on the screen after the message “What is your name?” You must clear the entire screen before display.
 b) Scan a 8 x 3 keypad for key closure and to store the code of the key pressed in a memory location or display on screen. Also display row and column numbers of the key pressed.

8. a) Compute nCr using recursive procedure. Assume that ‘n’ and ‘r’ are non-negative integers.
 b) Drive a Stepper Motor interface to rotate the motor in specified direction (clockwise or counter-clockwise) by N steps (Direction and N are specified by the examiner). Introduce suitable delay between successive steps. (Any arbitrary value for the delay may be assumed by the student).

9. a) Read the current time from the system and display it in the standard format on the screen.
 b) Generate the Sine Wave using DAC interface (The output of the DAC is to be displayed on the CRO).

10. a) Write a program to simulate a Decimal Up-counter to display 00- 99. 
b) Generate a Half Rectified Sine wave form using the DAC interface. (The output of the DAC is to be displayed on the CRO).

11. a) Read a pair of input co-ordinates in BCD and move the cursor to the specified location on the screen.
 b) Generate a Fully Rectified Sine waveform using the DAC interface. (The output of the DAC is to be displayed on the CRO).

12. a) Write a program to create a file (input file) and to delete an existing file. 
 b) Drive an elevator interface in the following way: i. Initially the elevator should be in the ground floor, with all requests in OFF state. ii. When a request is made from a floor, the elevator should move to that floor, wait there for a couple of seconds (approximately), and then come down to ground floor and stop. If some requests occur during going up or coming down they should be ignored

ADA lab programs

DESIGN AND ANALYSIS OF ALGORITHMS LABORATORY
(Common to CSE & ISE)
Subject Code: 10CSL47                                                                      I.A. Marks : 25
Hours/Week : 03                                                                                  Exam Hours: 03
Total Hours : 42                                                                                    Exam Marks: 50

Design, develop and implement the specified algorithms for the
following problems using C/C++ Language in LINUX /
Windows environment.

CLICK ON THE LINKS TO GET THE PROGRAMS



1. Sort a given set of elements using the Quicksort method and determine the time required to sort the elements. Repeat the experiment for different values of n, the number of elements in the list to be sorted and plot a graph of the time taken versus n. The elements can be read from a file or can be generated using the random number generator.
2. Using OpenMP, implement a parallelized Merge Sort algorithm to sort a given set of elements and determine the time required to sort the elements. Repeat the experiment for different values of n, the number of elements in the list to be sorted and plot a graph of the time taken versus n. The elements can be read from a file or can be generated using the random number generator.
3. a. Obtain the Topological ordering of vertices in a given digraph.
b. Compute the transitive closure of a given directed graph using Warshall's algorithm
4. Implement 0/1 Knapsack problem using Dynamic Programming.
5. From a given vertex in a weighted connected graph, find shortest paths to other vertices using Dijkstra's algorithm.
6. Find Minimum Cost Spanning Tree of a given undirected graph using Kruskal's algorithm.
7. a. Print all the nodes reachable from a given starting node in a digraph using BFS method.
b. Check whether a given graph is connected or not using DFS method.
8. Find a subset of a given set S = {sl, s2,.....,sn} of n positive integers whose sum is equal to a given positive integer d. For example, if S= {1, 2, 5, 6, 8} and d = 9 there are two solutions{1,2,6}and{1,8}.A suitable message is to be displayed if the given problem instance doesn't have a solution.
9. Implement any scheme to find the optimal solution for the Traveling Salesperson problem and then solve the same problem instance using any approximation algorithm and determine the error in the approximation.
10. Find Minimum Cost Spanning Tree of a given undirected graph using Prim’s algorithm.
11. Implement All-Pairs Shortest Paths Problem using Floyd's algorithm. Parallelize this algorithm, implement it using OpenMP and determine the speed-up achieved.
12. Implement N Queen's problem using Back Tracking.
Note: In the examination each student picks one question from
the lot of all 12 questions.