homework6

docx

School

North Park University *

*We aren’t endorsed by this school

Course

266

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by GrandLapwing1439

Report
ECE 266 – Introduction to Embedded Systems Spring 2024 Homework #6 1. [10] Textbook Chapter 5, Exercise 1 , regarding little-endianness and big-endianness. See the textbook, page 108, for the full text of the question. a. Little endian: r1 = 0DEB2C1A b. Big endian: r1 = 1A2CEB0D 2. [10] Textbook Chapter 5, Exercise 5 , regarding load instructions with extensions. See the textbook, page 109, for the full text of the question. (1) r1 = 0xFFFFFFC3 (2) r1 = 0xFFFFB2C3 (3) r1 = 0x000000C3 (4) r1 = 0x0000B2C3 3. [15] The following table shows the memory contents for addresses 0x20000000- 0x20000007. Memory Address Memory Content (Byte) 0x20000007 0x20 0x20000006 0x00 0x20000005 0x00 0x20000004 0x00 0x20000003 0x80 0x20000002 0x70 0x20000001 0x60 0x20000000 0x50 Assume the following register contents: r0 = 0x20000000 r1 = 0x00000004 r2 = 0x0000FFFF The following questions are independent. a. What is the result of LDRSH r3, [r0, #2] ”, i.e. change(s) to registers and memory? You may exclude the change to PC. r3 = 0x00008070 r0 = 0x20000002 (memory address)
b. What is the result of the following two instructions? LDR r3, [r0, #4]! LDR r4, [r3] r3 = 0x20000000 r0 = 0x20000004 (memory address) r4 = 0x20000000 c. What will happen if the CPU executes “ STRH r2, [r0, #3] ”? Can’t execute instruction because the half word can only be stored at an address that’s divisible by 2. 4. [10] Textbook Chapter 5, Exercise 3 , regarding store instructions with pre- and post-index. Suppose r0 = 0x20000000 and r1 = 0x12345678. All bytes in memory are initialized to 0x00. Suppose the following assembly program has run successfully. Draw a table to show the memory value if the processor uses little endian. STR r1, [r0], #4 STR r1, [r0, #4]! STR r1, [r0, #4] Use the following table. If a memory byte is not change, leave its content as blank. Memory Address Memory Content (Byte) 0x20000013 0x20000012 0x20000011 0x20000010 0x2000000F 0x2000000E 0x2000000D 0x2000000C 0x2000000B 0x12 0x2000000A 0x34 0x20000009 0x56 0x20000008 0x78 0x20000007 0x12 0x20000006 0x34 0x20000005 0x56 0x20000004 0x78 0x20000003 0x12 0x20000002 0x34 0x20000001 0x56 0x20000000 0x78
5. [10] Textbook, Ch. 5, Exercise 4. This question continues the previous question. W hat is the memory value if the processor uses big endian? Again, use the following table. If a memory byte is not change, leave its content as blank. Memory Address Memory Content (Byte) 0x20000013 0x20000012 0x20000011 0x20000010 0x2000000F 0x2000000E 0x2000000D 0x2000000C 0x2000000B 0x78 0x2000000A 0x56 0x20000009 0x34 0x20000008 0x12 0x20000007 0x78 0x20000006 0x56 0x20000005 0x34 0x20000004 0x12 0x20000003 0x78 0x20000002 0x56 0x20000001 0x34 0x20000000 0x12
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help