You are on page 1of 2

1.

Lw $t0,big($s2):
lui $t1, upper(big)
ori $t1, $t1, lower(big)
add $t1, $t1, $t2
lw $t5, 0($t1)
bge $s0,$s1,Label
slt $at, $t5, $t3
beq $at, $zero, L
beqz $t1,Label
beq $t1,$0,L
seq $s0,$s1,$s2 // Cu ni mo hiu lm, nn ko chc
beq $at,$s1,$s2
beq $at,$0,L
or $s0,$s0,$0
j Exit
L: nor $s0,$0,$02.
Exit:
2.
Tng s cycles lnh ca chng trnh:
300.10^6.5 +300.4.10^6 + 500.10^6.4+100.10^6.3 = 5.10^9 cycles
=>Execution time = clock cycle/ clock rate = 5.10^9/1,25.10^9 = 4s
3.
001010 10000 10001 0000000000000110
000000 00000 10010 10011 00100 000011
000001 00000 00001 1111111111111111
4.
000110 01000 00000 0000000000000001
101011 01111 11000 0000000000000000
100011 01000 00100 0000000000000100

000000 00100 00100 00101 00000 100000


Blez $t0,L
Sw $t8,0($t7)
L: lw $a0,4($t0)
Add $a1,$a0,$a0
5.
B=B?A:C[2]
a.B = 0x00004567
b.
beq $s1,$0,L1
add $s1,$s0,$0
beq $0,$0,L2
L1: lw $s1,8($s2)
L2:
c.
0x00000000 000100 10001 00000 0000000000000010
0x00000004 000000 10000 00000 10001 00000 100000
0x00000008 000100 00000 00000 0000000000000001
0x0000000c 100011 10010 10001 0000000000001000

You might also like