Quiz1
Due No due date Points 10
Questions 4
Available Jan 13 at 3:45pm – Jan 13 at 4:45pm about 1 hour
Time Limit 60 Minutes
Instructions
You can take this quiz only once.
Once you start the quiz, you will need to complete it.
This quiz was locked Jan 13 at 4:45pm.
Attempt History
Attempt Time Score LATEST Attempt 1 35 minutes 10 out of 10
Score for this quiz: 10 out of 10 Submitted Jan 13 at 4:29pm This attempt took 35 minutes.
Question 1
Not yet graded / 1 pts
What binary number does this hexadecimal number represent: 7FDF A5FC hex ?
Question 2
Not yet graded / 1 pts
What hexadecimal number does this binary number represent: 1100 1010 1111 1110 1111 1010 1100 1110 two?
Your Answer: CAFEFACE
CAFE FACE
Your Answer: 01111111110111111010010111111100
0111 1111 1101 1111 1010 0101 1111 1100 two
Question 3
Not yet graded / 3 pts
Write MIPS assembly language code for the following, assuming that a, c, d, and e (they are integers) correspond to $s0, $s2, $s3, and $s4, respectively.
a = 3 + ((c – d) – e);
Your Answer: sub $t0,$s2,$s3 sub $t1,$ss0,$s4 addi $$s0,$t1,3
sub $t0, $s2, $s3 sub $t1, $t0, $s4 addi $s0, $t1, 3
#$t0 gets (c-d)
#$t1 gets (c-d)-e
#$s0 gets 3 + ((c – d) – e)
Question 4
Not yet graded / 5 pts
Write MIPS assembly language code for the following, assuming that the base address of array1 (an array of integers) is in $s0, and the value of the variable h (an integer) is in $s1.
array1[4] = array1[3] – h + array1[0];
Your Answer:
lw $t0, 0($s0) ; loading the value of array1[0] into $t0 lw $t1, 12($s0) ; loading the value of array1[3] into $t1 sub $t1, $t1, $1 ; $t1 = array1[3] – h
add $t1, $t1, $t0 ; $t1 = (array1[3] – h) + array1[0]
Quiz Score: 10 out of 10 This quiz score has been manually adjusted by +10.0 points.
sw $t1, 16($s0) ; store $t1 value into the array1[4] .end
lw
sub
lw
$t0, 12($s0) $t2, $t0, $s1
#$t0 gets array1[3] #$t2 gets array1[3]-h
#$t1 gets array1[0]
#$t3 gets (array1[3] – h) +
#array1[4] gets $t3
add array1[0]
$t1, 0($s0) $t3, $t2, $t1
sw $t3, 16($s0)