Fall2012_Exam3B_sol

# Fall2012_Exam3B_sol - CS/ECE 252 INTRODUCTION TO COMPUTER...

• Notes
• 9

This preview shows page 1 - 5 out of 9 pages.

- 1 - CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Gurindar Sohi TAs: Pradip Vallathol and Junaid Khalid Midterm Examination 3 In Class (50 minutes) Friday, November 9, 2012 Weight: 17.5% NO: BOOK(S), NOTE(S), OR CALCULATORS OF ANY SORT. The exam has nine pages. Circle your final answers . Plan your time carefully since some problems are longer than others. You must turn in the pages 1-7 . LAST NAME: ___________________________________________________________ FIRST NAME: ___________________________________________________________ ID# ___________________________________________________________
- 2 - Problem Maximum Points Points Earned 1 4 2 3 3 3 4 3 5 8 6 4 7 5 Total 30
- 3 - Problem 1: The following flowchart is being converted into a sequence of LC-3 instructions as represented in the table below. Fill in the missing instructions and comments. Comments represent a summary of what the instruction does. (4 Points) Address Instructions Comments 0x3000 0101 0000 0010 0000 Clear the contents of R0 0x3001 0101 0010 0110 0000 Clear the contents of R1 0x3002 0101 0100 1010 0000 Clear the contents of R2 0x3003 0001 0010 0110 0101 R1 = R1 + 5 0x3004 0101 0000 1000 0011 R0 = R2 AND R3 0x3005 0001 0110 1100 0100 R3 = R3 + R4 0x3006 0001 0010 0111 1100 R1 = R1 4 0x3007 0000 0011 1111 1100 If P, branch to x3004 0x3008 1111 0000 0010 0101 HALT
- 4 - Problem 2: Suppose you are not allowed to use the LC-3 LDI instruction. Write a sequence of LC-3 instructions (in hex) that would achieve the same result as the LC-3 LDI instruction 0xA60E. (3 Points) 0x260E ; LD R3, 12 0x66C0 ; LDR R3, R3, 0 Problem 3: List and briefly explain the three ways to partially run a program while debugging it. (3 Points) Single Stepping: Execute one instruction at a time. Breakpoints: Tell the simulator to stop executing at a specific instruction.

Want to read all 9 pages?

Want to read all 9 pages?

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

Want to read all 9 pages?

• Spring '08
• Wood
• SEPTA Regional Rail, Machine code, Jaguar Racing, Logic error

{[ snackBarMessage ]}

###### "Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

### 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