Submitting your answers by the due date 19 August. Follow the requirements of header format.
Our TA's (Shing Gene) remarks and last year's comments. And further remarks.
main: li $2, 0x10000000 # (1) li $4, 1 # (2) sw $4, 0($2) # (3) li $4, 3 # (4) sw $4, 4($2) # (5) li $4, 5 # (6) sw $4, 8($2) # (7) lw $3, 0($2) # (8) lw $4, 4($2) # (9) add $3, $3, $4 # (10) lw $4, 8($2) # (11) add $3, $3, $4 # (12) sw $3, 12($2) # (13) lw $3, 0($2) # (14) lw $4, 4($2) # (15) mul $3, $3, $4 # (16) lw $4, 8($2) # (17) mul $3, $3, $4 # (18) sw $3, 16($2) # (19) j $31
1^4 + 2^4 + 3^4 + 4^4 + ... + n^4 = ( (1 + n)n(1 + 2n)(-1 + 3n + 3n^2) )/30,for the case of n=3. More precisely, you should compute
a = 1^4 + 2^4 + 3^4, b = ((1+3)*3*(1+2*3)(-1+3*3+3*3*3))/30and show that a-b = 0. You may use any registers from $8 to $25, but code should be carefully commented. What is the sum? Submit your assembly program and report your findings.