Sample Exam IT3280E TA - Huy
Sample Exam IT3280E TA - Huy
Sample Exam IT3280E TA - Huy
○ $at
○ $zero
○ $sp
○ $ra
○ pc
○ lo
○ Another answer
Question 2: What is the serial number of register $k1?
○5
○ 13
○ 21
○ 25
○ 26
○ 27
○ 30
○ Another answer
Question 3: When you inish executing a basic instruction and start
executing a new instruction, how much does the pc register increase?
○ 0x8
○ 0x2
○ 0x4
○ 0x1
○ 0x16
○ Another answer
What is the value of the $a0 register after executing the above code?
◻5
◻6
◻ 15
◻ 20
◻ 30
◻ 40
◻ 60
Question 6: Given the following code:
# DIGITTAL LAB SIM 7-SEGMENT LED SIMULATION
.text
main:
li $a0, 0x6F #Set value for right 7seg_led
jal SHOW_7SEG_RIGHT
li $a0, 0x66 #Set value for left 7seg_led
jal SHOW_7SEG_LEFT
exit:
li $v0, 10
syscall
endmain:
SHOW_7SEG_LEFT:
li $t0, SEVENSEG_LEFT
sb $a0, 0($t0)
jr $ra
SHOW_7SEG_RIGHT:
li $t0, SEVENSEG_RIGHT
sb $a0, 0($t0)
jr $ra
# END PROGRAM
Choose the correct statements:
◻ For the code to execute properly, you must connect to "Digital Lab Sim"
before running this code
◻ The 7-segment LED on the left shows the number 4
◻ The 7-segment LED on the right shows the number 9
◻ The 7-segment LED on the right shows the number 8
◻ The 7-segment LED on the left shows the number 6
◻ The 7-segment LED on the right shows the number 6
◻ When connecting "Digital Lab Sim" after running the code, the above code
can still run correctly
◻ The 2-digit number that appears in "Digital Lab Sim" after running the
code is a perfect square number
◻ The 2-digit number that appears in "Digital Lab Sim" after running the
code is a prime number
◻ The 2-digit number that appears in "Digital Lab Sim" after running the
code is an even number
◻ The dot in "Digital Lab Sim" does not appear after running the code
successfully
Question 7: Given the following code:
text
li $a1, 0
li $a2, 5
li $v0, 11
l1:
beq $a1, $a2, end
addi $a0, $a1, x
syscall
addi $a1, $a1, 1
j l1
end:
Let the code above print "mnopq" after execution, what is the value of x ?
(The value to ill in the box is a number, ex.: 2024)
Answer:
Question 8: In the R command format, what is the opcode value always?
(The value to ill in the box is a number, ex.: 2024)
Answer:
Question 9: Translate the following command into machine code (Written
in Hexa, with "0x" in front, ex.: 0x12345678): addi $t8, $t9, 2024
Answer: