ECE314sp08_HW2 - ECE/CS 314 Spring 2008 Homework 2 Due...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE/CS 314 Spring 2008 Homework 2 Due Tuesday, Feb 19, 2006 before 10:00pm EST Homework Submission Policies 1. Show your work where appropriate. 2. Homework Assignments are done individually without calculators . 3. Homework must be typed and submitted in plain text or PDF format. No scanned PDF (or scanned ANYTHING) allowed. 4. All homework should be submitted through CMS. Under no circumstances should a submission be made by sending the completed assignments to a course staff by email, unless explicitly requested. (Make sure you are signed up for the class on CMS BEFORE the submission deadline.) 5. In general, late submissions will not be graded. However, if CMS is down prior to a deadline, please contact the course staff BEFORE the deadline and make a submission when the system is back up (it will not be penalized). 6. Questions may be directed to the ECE/CS 314 consultants and the newsgroup (as always). Problem 1. Endian Representation (15 points) The following assembly code sequence is executed on two different machines, one of which is big-endian and the other little-endian. lw $6, 0($5) lh $7, 4($5) lhu $8, 6($5) lui $9, 0xFEED ori $9, $9, 0xBABE lb $10, 11($5) lbu $11, 14($5) ori $12,$12,0xBABE lui $12, 0xFEED lb $13, 6($5) The initial contents of memory are the same on both machines, as shown in below. 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Word Address Byte Offset 00 01 10 11 0x2000F000 0xDE 0xAD 0xC0 0xDE 0x2000F004 0xAB 0xC1 0x23 0xD0 0x2000F008 0xCA 0xFE 0xF0 0x0D 0x2000F00C 0xF1 0x23 0xFA 0xCE a) Contents of the registers on the big-endian machine after execution of all instructions (assume $6 to $13 are initially 0): $5 0x2000F000 $6 DEADCODE $7 FFFFABC1 $8 000023D0 $9 FEEDBABE $10 0000000D $11 000000FA $12 FEED0000 $13 00000023 b) Contents of the registers on the little-endian machine after execution of all instructions (assume $6 to $13 are initially 0): $5 0x2000F000 $6 DEADCODE $7 000023D0 $8 0000ABC1 $9 FEEDBABE $10 FFFFFFCA $11 00000023 $12 0000FEED $13 FFFFFFC1 2
Background image of page 2
Problem 2. Answer the following questions about the following MIPS function (15 points) foo: addiu $29,$29,(-72) sw $31,40($29) sw $s0,20($29) sw $s1,24($29) sw $s5,28($29) sw $s2,32($29) sw $s7,36($29) sw $a0,72($29) sw $a2,80($29) # … more instructions (X) …
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 8

ECE314sp08_HW2 - ECE/CS 314 Spring 2008 Homework 2 Due...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online