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

Addition and subtraction are performed on 32 bit integer numbers held in the gen

ID: 3870801 • Letter: A

Question

Addition and subtraction are performed on 32 bit integer numbers held in the general purpose registers (32 bit-wide each) inside the register file. The result is a 32 bit number itself. Two kinds of instructions are included in the MIPS instruction set to do integer addition and subtraction [5] Instructions for signed arithmetic: the 32 bit numbers are considered to be represented in 2's complement. The execution of the instruction (addition or subtraction) may generate an overflow, such as for add, addi, or an underflow for sub Instructions for unsigned arithmetic: the 32 bit numbers are considered to be in standard binary representation. Executing the instruction will never generate an overflow error even if there is an actual overflow (the result cannot be represented with only 32 bits), such as, addiu, addu, subu. Some basic arithmetic operations includoe: · Instructions Operation add Sd, Ss, St addi St, Ss, imm sub Sd, Ss, St div Ss, St mult Ss, St Sd=Ss-St SLC) = Ss / St:SHI = $s % $t $LO = $s * $t

Explanation / Answer

Answer:

For following c code

main()
{
int a,b,i,j;
int D[50];
for(i=0; i<a; i++)
for(j=0; j<b; j++)
    D[2*j] = i + 2*j;
}

The Assembly code is following

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote