How To Exam?

a knowledge trading engine...


Birla Institute of Technology (BIT Mesra) 2004 MS Software Engineering Structured Programming - Question Paper

Saturday, 19 January 2013 04:15Web
(b) Processing Unit: Computation/Processing of info
(c) Input: Means of getting info into the computer. e.g. keyboard, mouse
(d) Output: Means of getting info out of the computer. e.g. printer, monitor
(e) Control Unit: Makes sure that all the other parts perform their tasks correctly and at the accurate time.

[0.5 mark per bit, and 0.5 if all correctly mentioned]

b. What are the two important things that the FETCH phase of an instruction cycle does? (2)

Answer: The 1st operation is loading instruction to be processed next into the IR. The 2nd operation is the loading of the address of the next instruction into the program counter.

[1 mark per bit]

ques. 5.
a. With a diagram, discuss data path relevant to the execution of LD R2, x1AF located at x4018. The opcode for LD is 0010. (3)

Answer: Refer Fig.5.6 of Textbook & the explanation for it.

[1.5 marks for diagram, and 1.5 for explanation].

b. How might 1 use a single LC-3 instruction to move the value in R2 into R3? (2)

Answer: 0001 011 010 one 00000 (ADD R3, R2, #0 )

[1 mark for concept, and one mark for giving instruction – assumptions OK].

ques. 6.
a. Explain your understanding of Debugging. elaborate the typical operations, which a good debugger should provide? (3)

Answer: Debugging is trying to obtain logical errors in program by tracing sequence of instructions and keeping track of outcomes. Typical operations should include depositing values in memory/register, executing instruction sequence, examining memory/register etc.

[1 for Debugging + two for operations]

b. Which of the 2 algorithms for multiplying 2 numbers is preferable and why? 88*3 = 88 + 88 + 88 OR three + three … +3 (2)

Answer: 88 + 88 + 88 requires fewer instructions to complete; it is faster and therefore preferable.

[1 for which one; and one for Why]

ques. 7. (5)
What does the subsequent program do?

.ORIG x3000
LD R2, ZERO
LD R0, M0
LD R1, M1
LOOP BRz DONE
ADD R2, R2, R0
ADD R1, R1, -1
BR LOOP
DONE ST R2, outcome
HALT
RESULT .FILL x0000
ZERO .FILL x0000
M0 .FILL x0004
M1 .FILL x0803
.END

What will be the value of outcome after the program runs to completion?

Answer: The program calculates the product of values at addresses M0 and M1. The product is stored at address outcome. mem[RESULT] = mem[M0] * mem[M1]. outcome will contain x200C.

[3 for what the program does; and two for value of result]

ques. 8.
a. What is the output of every printf statement in the code below? (3)

#define LETTER ‘1’
#define ZERO 0
#define NUMBER 123

printf (“%c”, ‘a’);
printf (“x%x”, 12288);
printf (“$%d. %c%d\n”, NUMBER, LETTER, ZERO);

Answer: ax3000$123. 10

[1 mark for every part]

b. What would be the value of x after execution of the subsequent statements? (2)

int x, y = 10;
char z = ‘a’;
x = y + z;

Answer: 107

[1 mark for specifying ascii is added, and one mark for final value of x]


*** --- ***





( 0 Votes )

Add comment


Security code
Refresh

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