sp11-sl-e1 - ECE 3035 4 problems 7 pages Computing Mechanisms Exam One Spring 2011 23 February 2011 Instructions This is a closed book closed note exam

# sp11-sl-e1 - ECE 3035 4 problems 7 pages Computing...

This preview shows page 1 - 3 out of 7 pages.

ECE 3035 Computing Mechanisms Spring 2011 4 problems, 7 pages Exam One 23 February 2011 Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate the pages of the exam. For maximum credit, show your work. Good Luck! Your Name ( please print ) ________________________________________________ 1 2 3 4 total 28 22 20 30 100 1
ECE 3035 Computing Mechanisms Spring 2011 4 problems, 7 pages Exam One 23 February 2011 Problem 1 (3 parts, 28 points) Pointers and Arrays The following variables are allocated in memory beginning at address 5000. Part A (10 points) Complete the memory map below with the variable names at each word or byte in memory. Do not include the variable’s value. int A[] = {11, 22, 33}; int B = 99; int *P = &(A[1]); char X[] = “Star”; char Y[] = “Shine”; char *R = Y; 5000 5004 5008 5012 5016 5020 5024 5028 5032 5036 5040 Part B (12 points) Using the variables in part A, give the values of each expression. Assume expressions are non-cumulative (i.e., they follow the declarations). Answers may be characters. A B P *P X[1] *(Y+2) R R[-2] Part C (6 points) Extract the array information from the code below. This code fragment accesses an array B[ k ][ j ][ i ] where i is in \$4, j is in \$5, and k is in \$6. The array has 480 entries. The effective address for this access is computed in \$1. addi \$1, \$0, 96 mult \$6, \$1 mflo \$1 sll \$2, \$5, 5 add \$1, \$1, \$2 add \$1, \$1, \$4 sll \$1, \$1, 2 add \$1, \$1, \$3 lw \$2, 0(\$1) What is the most likely type of array B? What are the three defined dimensions? B[ ] [ ] [ ]; What register has the base address of B?

#### You've reached the end of your free preview.

Want to read all 7 pages?

• Fall '08
• Staff
• Assembly Language, Subroutine, Arithmetic shift, Logical shift

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern