How To Exam?

a knowledge trading engine...


Birla Institute of Technology (BIT Mesra) 2007 MS Software Engineering Structured programming - Question Paper

Saturday, 19 January 2013 03:10Web

Birla Institute of Technology and Science, Pilani
Distance Learning Programmes Division
MS Software Engineering in Collaboration with Wipro Technologies
Second Semester 2006 – 2007
Mid-semester exam
Regular
Course No. : SEWP ZC221
Course Name : Structured programming
Nature of examination : Closed Book Bangalore
Weightage : 40 %
Duration : two Hours No of pages : 2
Date : March 11, 2007 (AN) No. of questions : 5

Note: Attempt all ques.. begin every ans from a fresh page
1) The "Russian Peasant problem" is a method of multiplying 2 numbers together, using only division by 2, multiplication by 2, and addition. For example, if the numbers 17 and 19 are to be multiplied together, they are put at the head of 2 columns (write Dry Run) [ eight * one = 8]
17 19

The 1st number, 17 is divided by two (suing integer division) and the outcome is placed beneath the original number in the first
Column:
17 19
8

The 2nd number 19 is multiplied by 2:
17 19
eight 38

This process is continued until the number on the left decreases to 1
17 19
eight 38
four 76
two 152
one 304

All those numbers in the right hand column which lie to the right of even numbers on the left hand column are ignored:

17 19
eight 38 (ignore)
four 76 (ignore)
two 152 (ignore)
one 304

The remaining number in the right-hand column then are added together

19
304
----
325
---

The outcome is the solution to the issue 17 times 19. Write a pseudo code and dry run to implement Russian peasant method for multiplying any two positive numbers.

2) Write a pseudo code and dry run that examines all the numbers from one to 999, displaying all those for which the sum of the cubes of the digits equals the number itself. For example, provided the umber 563, 53 + 63 + 33 = 125 + 216 + 27 = 368, which is not equal to 563. On the other hand,
provided 371, 33 + 73 + 13 = 27 + 343 + one = 371 [ eight * one = 8]


3) Write pseudo code to generate the subsequent output. Do not write dry run . Do not use arrays. [ eight * one = 8]
Output:
Enter a string: ABCDEFGH
A B C D E F G H H G F E D C B A
A B C D E F G G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A


4) a) Draw a diagram of Von Neumann Model [2 m]
b) State the components of the Von Neumann Model [2 m]
c) For every component state its purpose and discuss [4 m]

5) discuss the subsequent assembly code line by line [ 16 * .5 = 8]
.ORIG x3000
LD R2, ZERO
LD R0, M0
LD R1, M0
LD R1, M1
LOOP BRZ DONE
ADD R2, R2, R0
ADD R1, R1, -1
BRnzp LOOP
DONE ST R2, outcome
HALT
RESULT .FILL X0000
ZERO .FILL X0000
M0 .FILL X0004
M1 .FILL X0803
.END
What value will be contained in RESUT after the program runs to completion?


*****************************


( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Birla Institute of Technology (BIT Mesra) 2007 MS Software Engineering Structured programming - Question Paper