...
STQC-NIELIT SC-B 2021
December 1, 2023
Database-Management-System
December 1, 2023
STQC-NIELIT SC-B 2021
December 1, 2023
Database-Management-System
December 1, 2023

Computer-Organization

Question 3
 Consider the following instruction sequence where registers R1, R2 and R3 are general purpose and MEMORY[X] denotes the content at the memory location X.

Assume that the content of the memory location 5000 is 10, and the content of the register R3 is 3000. The content of each of the memory locations from 3000 to 3010 is 50. The instruction sequence starts from the memory location 1000. All the numbers are in decimal format. Assume that the memory is byte addressable.
After the execution of the program, the content of memory location 3010 is _______
A
50
Question 3 Explanation: 

Register R1 will get value 10 from location 5000. So the loop in the given program will run for 10 times as the loop condition is based on ‘Dec R1’. When R1 is 0 then the loop terminates.

 

In these 10 iterations of the loop contents of memory locations 3000 to 3009 are changed as initial value of R3 is 3000 and in each iteration we update M[R3] ← R2 and the value of R3 is incremented to the next location 3001, 3002 etc.

 

But the value in location 3010 is unchanged and it will be the same as the initial value which is 50.

Correct Answer: A
Question 3 Explanation: 

Register R1 will get value 10 from location 5000. So the loop in the given program will run for 10 times as the loop condition is based on ‘Dec R1’. When R1 is 0 then the loop terminates.

 

In these 10 iterations of the loop contents of memory locations 3000 to 3009 are changed as initial value of R3 is 3000 and in each iteration we update M[R3] ← R2 and the value of R3 is incremented to the next location 3001, 3002 etc.

 

But the value in location 3010 is unchanged and it will be the same as the initial value which is 50.

Leave a Reply

Your email address will not be published. Required fields are marked *