Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

Problem 1: Assume address in memory of 'A[0]', 'B[0]' and 'C[0]') are stored in Registers x27, x30, x31

Electrical Engineering Feb 02, 2021

Problem 1: Assume address in memory of 'A[0]', 'B[0]' and 'C[0]') are stored in Registers x27, x30, x31. Assume values of variables f, g, h, i, and j are assigned to registers x5, x6, x7, x28, x29 respectively.  Write down RISC V Instruction(s) to

(a) Load Register x5 with content of A[10]

(b) Store contents of Register x5 into A[17]

(c) add 2 operands: one in x5 - a register, the other in in Register x6. Assume result of operation to be stored in register x7

(d) copy contents at one memory location to another: C[g] = A[i+j+31]

(e) implement in RISC V these line of code in C:

(i) f = g - A[B[9]]

(ii) f = g - A[C[8] + B[4]]

(iii) A[i] = B[2i+1], C[i] = B[2i]

(iv) A[i] = 4B[i-1] + 4C[i+1]

(v) f = g - A[C[4] + B[12]]

Problem 2:

Assume the following register contents:

x5 = 0x00000000AAAAAAAA, x6 = 0x1234567812345678

a. For the register values shown above, what is the value of x7 for the following sequence of instructions?

srli x7, x5, 16

addi x7, x7, -128

srai x7, x7, 2

and x7, x7, x6

b. For the register values shown above, what is the value of x7 for the following sequence of instructions?

slli x7, x6, 4

c. For the register values shown above, what is the value of x7 for the following sequence of instructions?

srli x7, x5, 3

andi x7, x7, 0xFEF

Expert Solution

kindly see the pics by number wise i-e pc1,pc2,pc3,pc4

please use this google drive link to download the answer file.

https://drive.google.com/file/d/1UEkxOq8i2Uc8xMePv5U5oatIAJXE4BEp/view?usp=sharing

note: if you have any trouble in viewing/downloading the answer from the given link, please use this below guide to understand the whole process.

https://helpinhomework.org/blog/how-to-obtain-answer-through-googledrive-link

Archived Solution
Unlocked Solution

You have full access to this solution. To save a copy with all formatting and attachments, use the button below.

Already a member? Sign In
Important Note: This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.

For ready-to-submit work, please order a fresh solution below.

Or get 100% fresh solution
Get Custom Quote
Secure Payment