联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2018-10-24 10:00

AST10201 Computer Organization - Tutorial 7

Name:Student ID:



Submission deadline: 21 October 2018 for LB1, LB2 and LB3

                                                            22 October 2018 for LA1, LA2, LA4, LA5, LC1 and LC2

            22 October 2018 for LB4


1.Try to use different instructions to calculate the value of mySum = arrA[0]*arrB[0]+ arrA[1]*arrB[1]+ arrA[2]*arrB[2]+ arrA[3]*arrB[3]+ arrA[4]*arrB[4].

Complete the code in T7_1_v1.s and T7_1_v2.s.


2.Use the Loop instruction to calculate the value of mySum = sum(arrA[i]*arrB[i]), i from 0 to 4. Complete the code in T7_2.s. The following instructions may be used:

bne $s0, $s1, Lbl #go to Lbl if $s0=?$s1

beq $s0, $s1, Lbl #go to Lbl if $s0=$s1

j   Lbl           #jump to Lbl

slt $t0, $s0, $s1 # if $s0 < $s1 then  $t0 = 1  (set on less than)

                 #              else  $t0 = 0

slti $t0,$s0,25   # if $s0 < 25 then $t0 = 1 else $t0 = 0

blt  $s1,$s2,Lbl  #go to Lbl if $s1 < $s2 (less than)

ble  $s1,$s2,Lbl  #go to Lbl if $s1 ≤ $s2 (less than or equal to)

bgt  $s1,$s2,Lbl  #go to Lbl if $s1 > $s2 (greater than)

bge  $s1,$s2,Lbl  #go to Lbl if $s1 ≥ $s2 (greater than or equal to)


3.please write an assembly language program with procedure to calculate the value of xy. For example: x = 3, y = 5. The procedure’s name can be “power”. (See T7_3.s)


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp