Question: Need some help with this! Q1 : Study the code below. Show the contents of memory entries that have changed as well as the value

Need some help with this!

Q1 : Study the code below. Show the contents of memory entries that have changed as well as the value stored in x1, x2, x5, x6 after running this piece of code. Show the values in HEX.

Q2 : Start by assuming the machine is either Little or Big Endian. If you find that one type of Endianness or both lead at any point to wrong memory access and program termination you must document in which instruction this happens and why. Then, you should switch to the other Endianess type and restart. If both types lead to termination you are allowed to make a change in one instruction (not data) of the code that may produce the least significant impact (e.g., change offset or substitute the instruction with another) so that the program runs correctly. Report your changes.

Q3 Complete the missing part of the code under line B with your own real assembly instructions (e.g., lui, etc) so that the code produces the fewest possible assembly real instructions for the missing part (below line B).

Need some help with this! Q1 : Study the code below. Show

Assume machine encoding to be: a) Big Endian, b) Little Endian. REMARK 1: Assume that memory contexts/data are constantly RECYCLED every 8 memory single words, hence Mem[32] = Mem[0], Mem[36] = Mem[4], Mem[40] = Mem[8], ... Memory addresses start strictly from 0 and grow ONLY POSITIVE. If a negative address is calculated then the Operating System throws an exception and the program is TERMINATED. Also, the low address of memory is from THE LEFT SIDE (check scheme below). Mem Low Order Content Address (decimal) 28 17FD25EC 24 223101BA 20 18926163 16 7E1565A9 12 4701BAC6 8 00011110 4 01 BAC789 0 0100FACE EN NN OO 00 00 sd x20,0(x10) //write this to memory --- it is not placed in the scheme below... lb xll, 13(x9) // offset is in decimal number, careful: check how lb works addi x2, x11, 10 // Line A Write your code below, using the least costly REAL instructions: // Line B *** add number: 0x8F 47 6C B5 89 A7 38 2E to empty register x3 // Line C srai x1, x3, 4 Id x5, 12(x2) and x6, x5, x1 sh X6, -5(x2) // Line D x9 contains number 0x00011 (hexadecimal) and x4 contains number 0x000014 (hex). These represent byte addresses within the same double word memory tuple. What is the lowest byte address of the double word (memory tuple) that contains these byte numbers? x10 contains the lowest byte address of the next memory double word. What number is that? x20 contains number (in hex): 0x9A26A009DD2EBB84. (the illustration of memory does not contain this number. You must place it there at the start of your handling the code). Assume machine encoding to be: a) Big Endian, b) Little Endian. REMARK 1: Assume that memory contexts/data are constantly RECYCLED every 8 memory single words, hence Mem[32] = Mem[0], Mem[36] = Mem[4], Mem[40] = Mem[8], ... Memory addresses start strictly from 0 and grow ONLY POSITIVE. If a negative address is calculated then the Operating System throws an exception and the program is TERMINATED. Also, the low address of memory is from THE LEFT SIDE (check scheme below). Mem Low Order Content Address (decimal) 28 17FD25EC 24 223101BA 20 18926163 16 7E1565A9 12 4701BAC6 8 00011110 4 01 BAC789 0 0100FACE EN NN OO 00 00 sd x20,0(x10) //write this to memory --- it is not placed in the scheme below... lb xll, 13(x9) // offset is in decimal number, careful: check how lb works addi x2, x11, 10 // Line A Write your code below, using the least costly REAL instructions: // Line B *** add number: 0x8F 47 6C B5 89 A7 38 2E to empty register x3 // Line C srai x1, x3, 4 Id x5, 12(x2) and x6, x5, x1 sh X6, -5(x2) // Line D x9 contains number 0x00011 (hexadecimal) and x4 contains number 0x000014 (hex). These represent byte addresses within the same double word memory tuple. What is the lowest byte address of the double word (memory tuple) that contains these byte numbers? x10 contains the lowest byte address of the next memory double word. What number is that? x20 contains number (in hex): 0x9A26A009DD2EBB84. (the illustration of memory does not contain this number. You must place it there at the start of your handling the code)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!