ECE243 - Final Exam 2007 (converted to NIOSII)

# ECE243 - Final Exam 2007 (converted to NIOSII) - UNIVERSITY...

This preview shows pages 1–5. Sign up to view the full content.

UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING FINAL EXAMINATION, APRIL 2006 Second Year ECE243H1 S – COMPUTER ORGANIZATION Exam Type: D Examiners – A. Moshovos, G. Steffan Instructions This is a type D exam. You are allowed to use the course textbook, the lab manual and one double-sided A4 (or 8.5”x11”) sheet with notes. Programmable calculators are not permitted. Last Name (Print): __________________ First Name: ________________________ Student Number: ___________________ ___________________________________________________________________________________________________ Question 1 Question 2 Question 3 Question 4 Total General Instructions: State your assumptions. Show your work. Comment your code. Solutions that are judged significantly inefficient will lose some marks. The exam is printed on two sides of the page. The last pages and the back of this one are blank and can be used for answers or calculations. Make your answers clear. There are 4 questions and a total of 100 marks. There are 7 pieces of paper in the exam, this one included, printed both sides. The page numbering is 1-14 .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Student # (use if pages get separated) ____________________________ ECE243 Computer Organization Pg 2 of 14 Spring 2006 Intentionally left blank.
Student # (use if pages get separated) ____________________________ ECE243 Computer Organization Pg 3 of 14 Spring 2006 1. Assembly Programming [30] A) [5] Write an equivalent C function for the following NIOS II code. Assume that all arguments are passed through the stack (first argument pushed last), the return value is placed into r2 and that “int” is a word (note that a << b in C means shift a by b bits to the left): jkl: addi sp, sp, -8 stw ra, 0(sp) slli r5, r5, 2 add r5, r5, r4 slli r4, r5, 1 stw r6, 4(sp) call qwe ldw r6, 4(sp) add r6, r6, r2 ldw ra, 0(sp) addi sp, sp, 8 ret Fill in the blanks: int jkl ( ) { } B) [5] Assume that r8= 0x12345678 and r9=0xF. Write the complete value of r9 after each of the following instructions is executed. Assume the instructions execute in sequence so that when you are determining the value of r9 at instruction 3, instructions 1 and 2 have already executed. “lala” is divisible by 4. BIG ENDIAN LITTLE ENDIAN add r9,r8,r9 r9 = ___________ ____________ movia r10, lala stw r8, 0(r10) r9 = ___________ ____________ ldw r9, 0(r10) r9 = ___________ ____________

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Student # (use if pages get separated) ____________________________ ECE243 Computer Organization
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 14

ECE243 - Final Exam 2007 (converted to NIOSII) - UNIVERSITY...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online