100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CSE 230 exam 1 UPDATED ACTUAL Exam Questions and CORRECT Answers

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
19-08-2025
Written in
2025/2026

CSE 230 exam 1 UPDATED ACTUAL Exam Questions and CORRECT Answers For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables f, g, h, and i are given and could be considered 32-bit integers as declared in a C program. Use a minimal number of MIPS assembly instructions. f = g + (h − 5); - CORRECT ANSWER addi i ,h, -5 add f, g, i For the following MIPS assembly instructions above, what is a corresponding C statement? add f, g, h add f, i, f - CORRECT ANSWER add f,i,f add f,g,h

Show more Read less
Institution
CSE
Course
CSE









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CSE
Course
CSE

Document information

Uploaded on
August 19, 2025
Number of pages
5
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

CSE 230 exam 1 UPDATED ACTUAL
Exam Questions and CORRECT Answers
For the following C statement, what is the corresponding MIPS assembly code? Assume that the
variables f, g, h, and i are given and could be considered 32-bit integers as declared in a C
program. Use a minimal number of MIPS assembly instructions.

f = g + (h − 5); - CORRECT ANSWER addi i ,h, -5
add f, g, i


For the following MIPS assembly instructions above, what is a corresponding C statement?

add f, g, h add f, i, f - CORRECT ANSWER add f,g,h
add f,i,f


For the following C statement, what is the corresponding MIPS assembly code? Assume that the
variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively.
Assume that the base address of the arrays A and B are in registers $s6 and $s7, respectively.

B[8] = A[i−j]; - CORRECT ANSWER sub $s5, $s2, $s3
sll $s5,$s5,2
add $s5,$s6,$s5
lw $s6, 0($s5)
św $s6, 32 $(s7)


For the MIPS assembly instructions below, what is the corresponding C statement? Assume that
the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively.
Assume that the base address of the arrays A and B are in registers $s6 and $s7, respectively.
sll $t0, $s0, 2 # $t0 = f * 4
add $t0, $s6, $t0 # $t0 = &A[f]
sll $t1, $s1, 2 # $t1 = g * 4
add $t1, $s7, $t1 # $t1 = &B[g]
lw $s0, 0($t0) # f = A[f]

, addi $t2, $t0, 4
lw $t0, 0($t2)
add $t0, $t0, $s0

sw $t0, 0($t1) - CORRECT ANSWER B[g] = A[f] + A[1+f];


For the following C statement, write a minimal sequence of MIPS assembly instructions that
does the identical operation. Assume $t1 = A, $t2 = B, and $s1 is the base address of C.

A = C[0] << 4; - CORRECT ANSWER lw $t3, 0($s1)
sll $t1, $t3, 4


Assume $t0 holds the value 0x00101000. What is the value of $t2 after the following
instructions?


slt $t2, $0, $t0
bne $t2, $0, ELSE
j DONE
ELSE: addi $t2, $t2, 2

DONE: - CORRECT ANSWER $t2 = 3


What is 5ED4 - 07A4 when these values represent unsigned 16- bit hexadecimal numbers? The
result should be written in hexadecimal. Show your work. - CORRECT ANSWER 5730


Convert 5ED4 into a binary number. What makes base 16 (hexadecimal) an attractive numbering
system for representing values in computers? - CORRECT ANSWER 0101 1110 1101 0100


What is 4365 - 3412 when these values represent unsigned 12-bit octal numbers? The result
should be written in octal. Show your work. - CORRECT ANSWER 7777 = 111 111 111 111


Assume 185 and 122 are unsigned 8-bit decimal integers. Calculate 185 - 122. Is there overflow,
underflow, or neither? - CORRECT ANSWER 63, Neither.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MGRADES Stanford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
1078
Member since
1 year
Number of followers
102
Documents
68972
Last sold
23 hours ago
MGRADES (Stanford Top Brains)

Welcome to MGRADES Exams, practices and Study materials Just think of me as the plug you will refer to your friends Me and my team will always make sure you get the best value from the exams markets. I offer the best study and exam materials for a wide range of courses and units. Make your study sessions more efficient and effective. Dive in and discover all you need to excel in your academic journey!

3.8

171 reviews

5
73
4
30
3
46
2
8
1
14

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions