1 of 3

CSC/EEE230 Assignment #5

(post:9/15) (due:9/26)

Late:9/27 12:01 am – 9/28 11:59 pm

Game over: after 9/28 11:59pm : 0 point

Individual Report

First Name Last Name

______________________________________________

Instruction:

To edit, you don't need to "request access", do: File/Download/Microsoft PowerPoint(.pptx), save to your local drive; then you can edit your local file.

File name: Save this file as: 230-assign-05-FirstName-LastName

Email report directly to ui.luu@gccaz.edu, (Note: submit this assignment using your "maricopa.edu" email to get direct response for any feedback) (Your personal email address may get filtered into my SPAM folder)

Scores:

(1 point) Correct PowerPoint file name including YOUR name (pdf file = 0 point)

(1 point) Your Name (on this page)

(14 points) content of this PowerPoint (next page)

(2 points) submit report on time

_____________________________________

2 of 3

# EX14-mult-SP2021

# Objective: experiment with:

# multiply: mult

# Description:

# mult $s2, $s3

# When $S2(32-bit) x $S3(32-bit) the result is 64 bits

# MIPS processor places:

# * the most significant 32 bits in Register: Hi

# * the least significant 32 bits in Register: Lo

main:

# Case 1: positive x positive = positive:

addi $s2, $zero,2 # $s2 = 0 + 2 = 2

addi $s3, $zero,3 # $s3 = 0 + 3 = 3

mult $s2, $s3 # (2 points) verify with MARS: Hi = 0x _________ ; Lo = 0x ___________

# Case 2: positive x negative = negative:

addi $s2, $zero,2 # $s2 = 2

addi $s3, $zero,-3 # $s3 = -3 (= ffff fffd) (2's complement)

mult $s2, $s3 # (2 points) verify with MARS: Hi = 0x _________ ; Lo = 0x ___________

# Case 3: negative x negative = positive:

addi $s2, $zero,-2 # $s2 = -2 (= ffff fffe) (2's complement)

addi $s3, $zero,-3 # $s3 = -3 (= ffff fffd) (2's complement)

mult $s2, $s3 # (2 points) verify with MARS: Hi = 0x _________ ; Lo = 0x ___________

wait: j wait # wait

3 of 3

# EX15-div-REVA

# Objective: experiment with:

# divide: div $s2, $s3

# Result: Lo = $s2 / $s3 (quotent)

# Hi = $s2 mod $s3 (remainder)

# Description:

# div $s2, $s3

# When $S2(32-bit) / $S3(32-bit) the result has 2 parts: Quotient & Remainder

# MIPS processor places:

# * 32 bits Quotient in Register Lo

# * 32 bits Remainder in Register: Hi

main:

# Case 1: positive / positive:

addi $s2, $zero,18 # $s2 = 18 = 0x12

addi $s3, $zero,4 # $s3 = 4

div $s2, $s3 # (2 points) verify with MARS: : Hi(Remainder) = 0x____________ ; Lo(Quotient) = 0x_______________

#============================

# Case 2: positive / negative:

addi $s2, $zero,18 # $s2 = 18

addi $s3, $zero,-4 # $s3 = -4 (= 0xffff fffc)

div $s2, $s3 # (2 points) verify with MARS: : Hi(Remainder) = 0x____________ ; Lo(Quotient) = 0x_______________

#============================

# Case 3: negative / negative:

addi $s2, $zero,-18 # $s2 = -18 (= 0xffff ffee)

addi $s3, $zero,-4 # $s3 = -4 (= 0xffff fffc)

div $s2, $s3 # (2 points) verify with MARS: : Hi(Remainder) = 0x____________ ; Lo(Quotient) = 0x_______________

#============================

# Case 4: negative / positive:

addi $s2, $zero,-18 # $s2 = -18 (= 0xffff ffee)

addi $s3, $zero,4 # $s3 = 4

div $s2, $s3 # (2 points) verify with MARS: : Hi(Remainder) = 0x____________ ; Lo(Quotient) =0x _______________

wait: j wait # waiting