Question: Please read carefully, will thumbs up Must have the same output as the sample output as shown below You are tasked to calculate a specific
Please read carefully, will thumbs up
Must have the same output as the sample output as shown below

You are tasked to calculate a specific algebraic expansion, i.e. compute the value of f and g for the expression 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, each separated by the Enter key. The program shall calculate (A-4B3+3c2-2D) and g (AB +caD) 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 of{mul, mul.d, mul.s, mulo, mulou, mult, multu, mulu, div, divu, rem, sll, sl1v, 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 example main () int i,x=9; for (i=31 ; i>-0 ;i--) / put char with ASCII code for either 0 or 1 by adding 1 for the ith bit to ASCII of 0' / putchar ('0' + ( (x>>?) & 1)); return (0); 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: 9 21 3 f ten 49026 f two -00000000000000001011111110000010 gten 13122 g two00000000000000000011001101000010 You are tasked to calculate a specific algebraic expansion, i.e. compute the value of f and g for the expression 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, each separated by the Enter key. The program shall calculate (A-4B3+3c2-2D) and g (AB +caD) 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 of{mul, mul.d, mul.s, mulo, mulou, mult, multu, mulu, div, divu, rem, sll, sl1v, 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 example main () int i,x=9; for (i=31 ; i>-0 ;i--) / put char with ASCII code for either 0 or 1 by adding 1 for the ith bit to ASCII of 0' / putchar ('0' + ( (x>>?) & 1)); return (0); 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: 9 21 3 f ten 49026 f two -00000000000000001011111110000010 gten 13122 g two00000000000000000011001101000010
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
