Você está na página 1de 1

SCHOOL OF COMPUTING & IT

Department of IT/ CSE/ CCE


III Semester; First Sessional Examination, Sept. 2016
Course: B.Tech
OPEN BOOK EXAMINATION

Subject Code: CS1301 Subject Name: Computer Organization and Architecture


Max. Marks: 20 Duration: 1 hour
__________________________________________________________________________________________
Instructions: 1. All questions are compulsory
2. Missing data if any can be suitably assumed.
3. Numbers in [ ] indicates marks
Q1. Write a complete assembly language program (i.e. with assembler directives) to implement the following 'C'
language construct, assuming an 8-bit processor. The assembler must arrange array A starting at 2000H, array B
starting at 3000H, array C starting at 4000H, and the instruction block starting at 5000H. Assume the values for the
elements of array A and B.
for (i=0; i<5; i++) {
*(C + i) = *(A+i) + *(B+i); } [6]

Q2. Consider the byte registers R0 = ABH and R1 = ABH (H stands for Hexadecimal). What will be contents of
R0 and R1 after the execution of each of the following instructions? Use the given initial values of R0 and R1 in
each instruction.
(i) Compare R1, R0
(ii) And #$F, R0
(iii) AShiftR #3, R1
(iv) RotateL #3, R0 [4]

Q3. Consider the following assembly language program for adding one hundred 32-bit integers stored at memory
location starting from 4000 H on a 32-bit machine with byte addressable memory. Sum is stored at memory
location 5000H.
Move #$4000, R0
Clear R1
Move #100, R2
Loop Add (R0) +, R1
Decrement R2
Branch > 0 Loop
Move R1, $5000
Fetching and executing an instruction from the main memory or operand data access from the main memory
requires 20 time units. The processor contains a cache, if the instruction is found in the cache, consider that
fetching and executing it requires zero time. Also consider zero time for accessing operand data from registers.
Calculate the ratio of program execution time without the cache to execution time with the cache. Assume that
the cache is initially empty, and that the program starts with all instructions in the main memory. Finally, assume
that if an instruction is not found in the cache it must first be fetched from the main memory into the cache and
then fetched from the cache to be executed. [6]

Q4. Hexadecimal numbers FBH and ABH are 8-bit signed representation of two decimal numbers in sign-and-
magnitude format. Convert them to 8-bit, signed, 2s complement binary numbers and add them. State whether
or not overflow occurs. [4]

Você também pode gostar