Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

NVM You are tasked to calculate a specific algebraic expansion, i.e. compute the

ID: 3905494 • Letter: N

Question

NVM

You are tasked to calculate a specific algebraic expansion, i.e. compute the value of f and g for the expression: f (A4-4B3+3C2-2D) without using any intrinsic multiplication instructions, subroutines, and function calls. More formally, write MIPS assembly code that accepts four positive integers A, B, C, and D as input parameters. The code shall execute in MARS to prompt the user to enter four positive integers represented in decimal, rated by the e Enter key. The program shall calculate f- (A4-4B3+3C2-2D) and g(AB2 (A eac +C2D) using your own self-written multiplication routine. The program will then output f and g in decimal and binary, using syscall routines for each output. Note: To receive credit, no multiplication, no division, and no shift instructions shall be used. Namely none ofmul, mul.d, mul.s, mulo, mulou, mult, multu, mulu, div, divu, rem, sll, sllv, sra, srav, srl, srlv or else a zero score will result. Thus, it is necessary to compose your own multiplication technique. In addition, use of a loop is required for credit to realize the multiplication code. Use of Macro, Subroutines, or Functions results in a zero grade Hint: MARS supports output in binary format using the appropriate parameters with syscall. For the C- language prototype, there are many approaches to print a value in binary in C. Here is my favorite single- line-in-a-loop solution that you can use with any C-compiler to print x in binary, shown with x-9 as an examp main () le: or 1 by adding 1 for the ith bit to ASCII of 0 /put char with ASCII code for either putchar('0' + ((x>>i) & 1)) return (o) You can use the above in your C-code prototype or write your own binary output routine in C if you want. Sample output for Part A is: Enter 4 integers for A,B,C,D respectively: 15 9 21 3 f ten - 49026 f two 00000000000000001011111110000010 g ten13122 g_two00000000000000000011001101000010 The submitted program shall provide outputs in exactly the sequence and format shown above. To receive full credit, no additional superfluous outputs shall occur

Explanation / Answer

NVM stands for Non Volatile Memory.

NVM is a kind of computer memory which has capability to hold the saved data even when the power is turned off. Unlike the volatile memory, NVM doesn't need its data to be periodically refreshed. It is used for secondary storage or long-term consistent storage. Non volatile data storage is categorized into electrically addressed(ROM) and mechanically addressed system(like hard disk etc.). Examples of NVM include: Flash memory, hard disks, magnetic tapes etc.