1-Format: opcode rs rt immediate J-Format: opcode Target address R-Format: opcode rs rt rd shamt funct Opcodes and funct
Posted: Mon May 09, 2022 5:56 am
1-Format: opcode rs rt immediate J-Format: opcode Target address R-Format: opcode rs rt rd shamt funct Opcodes and function fields if necessary: Add: opcode=0 funct=32 subu: opcode=0 funct=35 addi: opcode=8 lw: opcode=35 Register numbers/names: 0:$0.... 8: $t0,9$t1, ... 15:$t7 16: $so,... 23:$s7 Given the above information, which instruction has same representation as 32(base 10)? addi $0,$0,35 subu $0,$0,50 O lw $0.0($0) add $0,$0,50 subu $s0,$s0,$s1
Loop: beq addu addiu subu sub j $9,$0, End $ 8, 98, $10 $ 8, $8,-1 $8,$8, $16 $10,$0, $16 Loop End: Given the MIPS code above, what should be the Immediate value for 'beq' (an l-Format) instruction so that the CPU know to jump to the 'End' label if $9 and $0 are equal? 06 3
Given the following MIPS Code: sll $t1,$s3,2 #A addu $t1,$t1,$55 lw $t1,0($t1) # $t1 = A addu $51,$51,$t1 addu $s3,$s3,$54 bne $53,$s2, Loop #B which of the following best describes what is happening at locations A and B? O A: Register $t1 gets the contents of $s3 multiplied by 2. B: Branch to the 'Loop' label if contents of $s3 does not equal contents of $s2. OA: Register $t1 gets the contents of $s3 multiplied by 2. B: Branch to the 'Loop' label if contents of $s3 equals contents of $s2. A: Register $t1 gets the contents of $s3 multiplied by 4. B: Branch to the 'Loop' label if contents of $s3 equals contents of $52. O A: Register $t1 gets the contents of $s3 multiplied by 4. B: Branch to the 'Loop' label if contents of $s3 does not equal contents of $s2.
Using the mappings a: $50 = 0 b: $s1 = 4 C: $s2 = 4 x: $s3 - 5 y: $54 = 5 What will be saved into 'a' given the following MIPS? beq $53,$s4, Tru # sub $50,$51,$s2 # j Done Tru: add $50,$s1,$s2 # Done: #exit 0 14 O 10
Loop: beq addu addiu subu sub j $9,$0, End $ 8, 98, $10 $ 8, $8,-1 $8,$8, $16 $10,$0, $16 Loop End: Given the MIPS code above, what should be the Immediate value for 'beq' (an l-Format) instruction so that the CPU know to jump to the 'End' label if $9 and $0 are equal? 06 3
Given the following MIPS Code: sll $t1,$s3,2 #A addu $t1,$t1,$55 lw $t1,0($t1) # $t1 = A addu $51,$51,$t1 addu $s3,$s3,$54 bne $53,$s2, Loop #B which of the following best describes what is happening at locations A and B? O A: Register $t1 gets the contents of $s3 multiplied by 2. B: Branch to the 'Loop' label if contents of $s3 does not equal contents of $s2. OA: Register $t1 gets the contents of $s3 multiplied by 2. B: Branch to the 'Loop' label if contents of $s3 equals contents of $s2. A: Register $t1 gets the contents of $s3 multiplied by 4. B: Branch to the 'Loop' label if contents of $s3 equals contents of $52. O A: Register $t1 gets the contents of $s3 multiplied by 4. B: Branch to the 'Loop' label if contents of $s3 does not equal contents of $s2.
Using the mappings a: $50 = 0 b: $s1 = 4 C: $s2 = 4 x: $s3 - 5 y: $54 = 5 What will be saved into 'a' given the following MIPS? beq $53,$s4, Tru # sub $50,$51,$s2 # j Done Tru: add $50,$s1,$s2 # Done: #exit 0 14 O 10