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

Implement single precision floating point addition in MIPS assembly language. Pr

ID: 3656532 • Letter: I

Question

Implement single precision floating point addition in MIPS assembly language. Prompt user to input two floating point (decimal) numbers and compute and display the sum.

Your program should be able to handle negative numbers as well.

You MUST NOT use the MIPS floating point instructions.

Example:

Enter a floating-point value: 1

Enter a floating-point value: 1

Sum: 2.000000000000000000

Enter a floating-point value: 2.2

Enter a floating-point value: 1.4

Sum: 3.599999904632568400

Enter a floating-point value: -1.34

Enter a floating-point value: 3.4

Sum: 2.059999942779541000

Enter a floating-point value: 10.5

Enter a floating-point value: 100.2

Explanation / Answer

Dear user, Here is the single precision floating point addition in MIPS assembly language: ###### Data segment ############ .data Prompt1:.asciiz "Enter a floating-point value:" Prompt2:.asciiz "Enter a floating-point value:" Pro_msg: .asciiz "product:" Sum_msg: .asciiz "Sum:" Error_msg:.asciiz "Input Zero" ######## Code segment ######## .text .globl main main: la $a0,prompt1 # display prompt string li $v0,4 syscall li $v0,5 # read 1st integer into $t0 syscall move $t0,$v0 la $a0,prompt2 #display prompt string li $v0,4 syscall li $v0,5 # read 1st integer into $t0 syscall move $t1,$v0 beqz $t2,else beqz $t1,else #calculate product add $t2,$t0,$t1 la $a0,Sum _msg # display prompt string li $v0,4 syscall move $a0,$t2 # output sum li $v0,1 syscall else: la $a0,Error_msg # display prompt string li $v0,4 syscall li $v0,10 # exit syscall