hello
can somebody please help me convert these into a risc-v instructions?
We need at least 9 more requests to produce the answer.
1 / 10 have requested this problem solution
The more requests, the faster the answer.
please help Exercise 2: RISC-V functions 1. Write a function penta in RISC-V that, when given an integer , returns 5x. Exercise 2: RISC-V functions 1. Write a function penta in RISC-V that, when given an integer , returns 5x.
IN RISC-V a) Consider the RISC-V code below. Indicate what is the value in register x20 after the code below is executed, and explain why; ori x18 x0 16 addi x20 x18 0 beq x20, x18, HERE add x20 x20, x20 b) Assume that the code above is part of a procedure called by main. What happens with the stack pointer during the procedure execution and why? Draw and explain. c) Add instructions to the above code to implement your...
Please help. Thanks 3. Provide a minimal set of RISC-V instructions that may be used to implement nor X5, X6, x7, x8, x9---- -(3 credits) Ans:
please code using risc-v language and make it as simple as possible Problem 1: (20 marks) Part 1: (15 points) Compile the RISC-V assembly code for the following C code. Assume that n and k are passed in x3 and x4 respectively. Values n and k are initialized to 14 and 14. Assume that result returned in register fl and that double precision numbers are used. After you are done store the result in address: 12(x3). Are you allowed to?...
Problem 1 (15 points) Translate the C code below into RISC-V, knowing that the values of i and j are in registers x28 and x29, respectively. The base address of array B is in register x30, and the base address of array C is in register x31.
The following 32-bit hexadecimal number describes a RISC-V machine instruction. Decode this instruction into a RISC-V assembly language statement (like `add x0, x1, x2`). To receive partial credit, you should show your steps including converting to binary format and identifying opcode, funct3, rs1, etc. 0x00C1F963
Write the following sequence of code into RISC-V assembler. Assume that x, y, and z are stored in registers x18, x19, and x20 respectively. z = z + y - x - 4;
What is the RISC-V assembly code to load hexadecimal number 3D0500hexas a 64-bit constant into register x19?
Problem 4 (30 points) a) Consider the RISC-V code below. Indicate what is the value in register x20 after the code below is executed, and explain why; х18 х0 16 ori addi x20 х18 0 beg x20, х18, НERE x20 х20, х20 add HERE Problem 4 (30 points) a) Consider the RISC-V code below. Indicate what is the value in register x20 after the code below is executed, and explain why; х18 х0 16 ori addi x20 х18 0 beg...
Translate the following C code into RISC-V Assembly. (no need to implement the prints just use ecall) int a[] = {2,2,5,3,4,8,3}; int b[] = {1,4,2,0,-1,5,4}; int z[7]; void multiply(int* a, int* b, int* c, int d) { for (int i=0; i < d; i++) { c[i] = a[i] * b[i]; } } int main() { int n = 7; multiply(a,b,z,n); printf("%s", "res: "); for (int i = 0; i < z; i++) { printf("%d", d[i]); } printf("\n"); return 0; }