Question: Without using STACK !! 1. Write MIPS assembly code for the following C function. Assume that A contains integer O's and 1's representing the individual
Without using STACK !!

1. Write MIPS assembly code for the following C function. Assume that A contains integer O's and 1's representing the individual bits of a binary number. Do not use pseudo- instructions. int binToDec (int A[], int begin, int end) // precondition: A contains integer O's and 1's { int k; int powofTwo = 1; int decimal = 0; for(k = end; k >= begin; k--) { if ( A[k] == 1 ) decimal += powofTwo; powofTwo *= 2; } decimal; } By the way, C has shift-left and shift-right operators, >. So, powOf Two *= 2; could have been written as powOf Two
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
