45 beqz $a0,zero 46 beg $a0,1,one 47 48 49 sub $ sp,$ sp,4 50 sw $ra,0($ sp) 51 52 sub $a0,$ a0,1 53 jal F 54 add $a0,$ a0,1 55 lw $ra,0($ sp) 56 57 add $sp,$ sp,4 58 59 60 sub $ sp,$ sp,4 61 sw...


Complete the following tableusing the codes attributed. Provide how many instructions of the given categories are executed while finding the F(6) and calculate the total clock cycles.






























Category

Instructions

CPI(Clock Cycle per Instruction)

Instruction Count
A: Arithmetic and Comparisonadd, addu, sub, slt, etc..1?
B: Memorylw, sw8?
D: Branch and Jumpbeq, bnq, j, jal2?

45 beqz $a0,zero<br>46 beg $a0,1,one<br>47<br>48<br>49<br>sub $ sp,$ sp,4<br>50<br>sw $ra,0($ sp)<br>51<br>52<br>sub $a0,$ a0,1<br>53<br>jal F<br>54<br>add $a0,$ a0,1<br>55<br>lw $ra,0($ sp)<br>56<br>57<br>add $sp,$ sp,4<br>58<br>59<br>60<br>sub $ sp,$ sp,4<br>61<br>sw $v0,0($sp)<br>62<br>sub $ sp,$ sp,4<br>sw $ra,0($ sp)<br>63<br>64<br>65<br>66<br>sub $a0,$ a0,2<br>67<br>jal F<br>68<br>add $a0,$ a0,2<br>69<br>70<br>lv $ra,0($ sp)<br>71<br>add $sp,$ sp,4<br>72<br>lv $s7,0($ sp)<br>add $ sp,$ sp,4<br>73<br>74<br>75<br>76<br>add $v0,$v0,$s7<br>77<br>jr $ra<br>78<br>79<br>zero:<br>80<br>li $v0,0<br>81<br>jr $ra<br>82<br>one:<br>83<br>li $v0,1<br>84<br>jr $ra<br>85<br>86<br>. data<br>87<br>prompt: . asciiz

Extracted text: 45 beqz $a0,zero 46 beg $a0,1,one 47 48 49 sub $ sp,$ sp,4 50 sw $ra,0($ sp) 51 52 sub $a0,$ a0,1 53 jal F 54 add $a0,$ a0,1 55 lw $ra,0($ sp) 56 57 add $sp,$ sp,4 58 59 60 sub $ sp,$ sp,4 61 sw $v0,0($sp) 62 sub $ sp,$ sp,4 sw $ra,0($ sp) 63 64 65 66 sub $a0,$ a0,2 67 jal F 68 add $a0,$ a0,2 69 70 lv $ra,0($ sp) 71 add $sp,$ sp,4 72 lv $s7,0($ sp) add $ sp,$ sp,4 73 74 75 76 add $v0,$v0,$s7 77 jr $ra 78 79 zero: 80 li $v0,0 81 jr $ra 82 one: 83 li $v0,1 84 jr $ra 85 86 . data 87 prompt: . asciiz " Program calculates the Fibonacci sequence using recursive functions. \n Enter a non-negative number: " 88 result: .asciiz "F " result2: . asciiz " asciiz "n". 89 endl:
.text<br>2<br>main:<br>4<br>la $a0,prompt<br>li $v0,4<br>syscall<br>7<br>li $v0,5<br>syscall<br>10<br>11<br>move $t2,$vo<br>12<br>13<br>14<br>move $a0,$t2<br>15<br>move $v0,$t2<br>16<br>jal F<br>17<br>move $t3,$vo<br>18<br>la $a0,result<br>li $v0,4<br>19<br>20<br>21<br>syscall<br>22<br>23<br>move $a0,$t2<br>24<br>li $v0,1<br>25<br>syscall<br>26<br>27<br>la şa0,result2<br>28<br>li $v0,4<br>29<br>syscall<br>30<br>31<br>move şa0,$t3<br>32<br>li $v0,1<br>33<br>syscall<br>34<br>la $a0,endl<br>li $v0,4<br>35<br>36<br>37<br>syscall<br>38<br>39<br>40<br>li $v0,10<br>41<br>syscall<br>42<br>43<br>F:<br>44<br>45 begz $a0,zero<br>

Extracted text: .text 2 main: 4 la $a0,prompt li $v0,4 syscall 7 li $v0,5 syscall 10 11 move $t2,$vo 12 13 14 move $a0,$t2 15 move $v0,$t2 16 jal F 17 move $t3,$vo 18 la $a0,result li $v0,4 19 20 21 syscall 22 23 move $a0,$t2 24 li $v0,1 25 syscall 26 27 la şa0,result2 28 li $v0,4 29 syscall 30 31 move şa0,$t3 32 li $v0,1 33 syscall 34 la $a0,endl li $v0,4 35 36 37 syscall 38 39 40 li $v0,10 41 syscall 42 43 F: 44 45 begz $a0,zero
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here