Answer:
$8 will contain 5.
Explanation:
la $9, A #$9 will contain base address of array A
addi $10, $0, 5 #$10 = 0 + 5 = 5
sw $10, 8($9) #8($9) that is A[2] = $10 = 5 that is 15 would be replaced by 5
addi $9, $9, 8 #adding 8 to the base address of the array A that is $9 = A[2]
lw $8, 0($9) #$8 = base of $9 that is A[2] so would store 5
Please give thumbsup, or do comment in case of any query. Thanks.
4. What will be in $8 after execution? Assume $9 contains a valid RAM address. .data...
4. What will be in $8 after execution? Assume $9 contains a valid RAM address. .data A: 5 10 15 .text Main: la $9, A addi $10, $0, 5 sw $10, 8($9) addi $9, $9, 8 lw $8, 0($9)
3. What will be in $8 after execution? addi $8, $0,5 sil_$8, $8,2 // shifting $8 left twice (logical shift- assume no sign) 4. What will be in $8 after execution? Assume $9 contains a valid RAM address. .data A: 5 10 15 .text Main: la $9, A addi $10, $0,5 sw $10, 8($9) addi $9, $9,8 lw_$8, 0($9)
1. Consider the following java code. int x 5 X++ Give equivalent MIPS ISA. Assume compiler will keep x in $s0 ($16) 2. What will be in $8 after executing the following statements? addi $8, $0, 5 add $8, $8, $8 What will be in $8 after execution? 2. addi $8, $0, 5 sll $8, $8, 2 shifting $8 left twice (logical shift- assume no sign) 4. What will be in $8 after execution? Assume $9 contains a valid RAM...
Given following cache: Show the end result after requesting following data: Read data from RAM address 00010 Read data from RAM address 01000 Read data from RAM address 00110 Read data from RAM address 11010 Write data to RAM address 00010 Read data from RAM address 10110 Read data from RAM address 11010 Read data from RAM address 01000 Write data to RAM address 10110 If a read miss request ends up with a RAM load time of 100-ns and...
can someone explain how you get the answer to this
question?
1. Based on the following code segment what values are in the runtime stack immediately after the fourth time the instruction labeled Rec is executed .text li Sa0, 7 jai Fact #assume the address of this instruction is 2000 fother code not shown Fact: addi Ssp, Ssp, -8 sw Sra, 4(Ssp) sw Sa0, 0(Ssp) slti St0, Sa0, 1 beq St0, Szero, Rec li SvO, 1 addi $sp, Ssp, 8...
Question 4) (12 Marks) This question is based on the MIPS assembly code shown below. data the Array: space 160 main: li $t6, 1 li $17, 4. sw $17, the Array($0) sw $17, theArray($17) li $t0, 8 loop: addi $t3, $t0, -8 addi $t4, $t0, -4 lw 1, the Array($t3) lw $12, the Array(St4) add $15, $t1, $t2 sw $15, theArray($to) addi $t0, $t0, 4 blt $t0, 160, loop jr Sra. Question 4 Assembly code a) what is the contents...
.data prompt: .asciiz "Input an integer x:\n" result: .asciiz "Fact(x) = " .text main: # show prompt li $v0, 4 la $a0, prompt syscall # read x li $v0, 5 syscall # function call move $a0, $v0 jal factorial # jump factorial and save position to $ra move $t0, $v0 # $t0 = $v0 # show prompt li $v0, 4 la $a0, result syscall # print the result li $v0, 1 # system call #1 - print int move $a0,...
8- For this question, assume that there are no pipeline stalls and that the breakdown of executed instructions is as follows: (8 pts add 10% addi 15% not 0% beq 30% lw 30% SW 15% a- In what fraction of all cycles is the data memory used? b- In what fraction of all cycles is the input of the sign-extend circuit needed?
In this exercise, we examine how data dependences affect execution in the basic 5-stage pipeline described in Section 4.5. Problems in this exercise refer to th following sequence of instructions: addi $2,$2,22 SW $3,20($2) OR $4,$2,$3 Also, assume the following cycle times for each of the options related to forwarding: Without Forwarding With Full Forwarding 300ps With ALU-ALU Forwarding Only 250ps 290ps 4.9.1 [10] <4.5> Indicate dependences and their type. 4.9.2 [10] <S4.5> Assume there is no forwarding in this...
1. It is desired to load A[10] into $8, i.e., "lw $8, X($9)". Assume $9 contains the base address of array A. Address Memory content lw $8, X($9) 0x0001 0000 Ox0001 0004 0x0001 0008 Ox0001 000c 0x0001 00101 Ox0001 0014 0x0001 0018 Ox0001 001c 0x0001 00201 0x0001 0024 0x0001 0028 A[O] A[1] $9 contains the based address of array A (i.e., $9 = 0x0001 001c) (a) What is the memory address for A[10]? Answer in hexadecimal number. Hint: Remember that...