Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi ! I need help finding the error in my MIPS code. The error is shown in image four highlighted in yellow. I think it
Hi I need help finding the error in my MIPS code. The error is shown in image four highlighted in yellow. I think it might have to do with the concatnation code. Here is my code with explanation:
# Start step
lw $t$s #Store A in $t
lw $t$s #Store A in $t
# Start step
mult $t $t #Multiply A A
mflo $t
mfhi $t
sw $t$s #Store in A
sw $t$s #Store in A
# Start step
addi $t $zero,
div $t $t #Divide A by
mflo $t #Store the quotient in $t
mfhi $s #Store remainder as variable a this is step
sw $t$s #Store quotient in A
# Start step
srl $s $s #Shift $sa bits to the right and store in $sb
# Start step
andi $s $s #Perform bitwise AND of $sa and store result in $sc
# Start step
sll $s $s #Shift $sa bits to the left and store results in $sd
# Start step
or $s $s $s #Combine b$s and c$s
or $s $s $s #Combine with d$s
sw $s$s #Store result in A
# Write comments explaining your code and all the registers and memory used
# Step : Load A into $t and A into $t
# Step : Calculate A A A A
# Step : Calculate A A by storing constant $t
# Step : Caluclate a A where a will be $s
# Step : Calculate b a which is a right shift where b is $s
# Step : Calculate c a & where & bitwise and and c is $s
# Step : Calculate d a where left shift and d is $s
# Step : Calculate Ab c d where concatenation and b is $s c is $s and d is $s
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started