Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this Assume that memory contexts/data are constantly RECYCLED every 8 memory single words, hence Mem[32] = Mem[0], Mem[36] = Mem[4], Mem[40] =

Need help with this

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 lanes start from LEFT to RIGHT side (check below).

General question for guidance: 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 below. Show the values in HEX.

Task 2 : x20 contains number (in hex): 09A008C09DD9E8084. Memory illustration below does not contain this number. You must place it there at the start of your handling the code. Consider the Type of Endianness.

Task 3: At the line of code indicated, you must add number 0x5F 34 6E B9 89 22 29 A1 to register x3, using only real RISC-V instructions (no pseudo instructions allowed).

Task 4: Start by assuming the machine is: 1) Little Endian, 2) Big Endian. If you find that one type of Endianness or both lead at any point to negative memory access, document where this happens. Then, switch to the other Endianness type and recalculate those instructions and tasks that are affected. One of the two types of Endianness will lead to the programs completion. .

image text in transcribed

sd x20, 7(x4) /write this to memory --- it is not placed in the scheme below... // TASK 2: change the memory content by executing the instruction above - write to memory lh x11, 24(89) // offset is in decimal number, careful: check how lh works // must distinguish between LE and BE addi X2, x11,6 // Line A // TASK 3: Write your code below, using the least costly REAL instructions: // Line B *** add number: 0x5F 34 6E B9 89 22 29 A1 to register x3 - same for LE-BE srai x1, x3,8 ld x5, 6(x2) // Line C -- must distinguish between LE and BE xor x6, x5, x1 sh x6,-3(x2) // Line D -- must distinguish between LE and BE Mem Low Order Content Address (decimal) 28 12FF0120 24 21004204 20 18926163 16 7E1565A9 83E5CFC6 8 D4CB3F59 4 7C32018E 0 F3B946EC 12

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Auditing And Other Assurance Services

Authors: Ray Whittington, Kurt Pany

17th Edition

0073379654, 9780073379654

More Books

Students also viewed these Accounting questions

Question

Identify the job expectancy rights of employees.

Answered: 1 week ago