四川大学计算机组成原理期末,四川大学《计算机组成原理》2017期末考试B卷答案.doc...

2017年计算机组成原理与汇编语言期末试题答案及评分标准——B卷

一、填空题(本大题共15空,每空2分,共30分)

1. B D A C

2. Lui $a0,0x1234 Ori $a0,0x5678 ($a0可为任意寄存器)

3. 81 41 1.98

4. -2047

slt $s1,$s2,$s3

6. A D B C

7. 1000010110(或534),或22)

二、简答题(本大题共4小题,每小题5分,共20分)。

1. CPI 每条指令的时钟周期数 (一个1分)

P2最好

P1执行的指令数是P1 (instructions/sec) = 3 × 109/1.5 = 2.0× 109

P1执行的指令数是P1 (instructions/sec) = 2.5×109/1.0 = 2.5 × 109

P1执行的指令数是P1 (instructions/sec) = 4 × 109/2.5 = 1.6 × 109

2. 1)不能,可能1位或3位错(2分)

奇偶校验只能发现错,不能找到哪位错。(1分)

不能,可能2位错或者正确。(2分)

3. 20ten = 10100two = 1.0100two ? 24

Sign = 1,

Significand = .0100

Single exponent = 4 + 127 = 131

单精度值:1 1000 011 010 0000 0000 0000 0000 0000 (每步1分)

4. 四个每个1分,其它描述1分

三、应用题(本大题共2小题,每小题10分,共20分)

1、add $t0, $zero, $zero # initialize running sum $t0 = 0

loop: beq $a1, $zero, finish # finished when $a1 is 0

add $t0, $t0, $a0 # compute running sum of $a0

sub $a1, $a1, 1 # compute this $a1 times

j loop # jump to loop

finish: add $v0, $t0, $zero # t0送给v0并return v0

程序功能是计算a*b

(每行1分,说出功能4分)

2. (每行2分)

十进制字地址

二进制字地址(30位)

TAG(26位)

INDEX

命中

6

0...0 0000 0110

0...0 0000

0110

214

0...0 1101 0110

0...0 1101

0110

175

0...0 1010 1111

0...0 1010

1111

214

0...0 1101 0110

0...0 1101

0110

6

0...0 0000 0110

0...0 0000

0110

四、数据通路分析与设计题(本大题共2小题,每小题15分,共30分)。提示:按照各小题要求做相应分析或设计,若分析或设计正确则给分,若分析或设计完全错误则无分,若分析或设计不准确或不全面,则酌情扣分。

1. 1). RegWrite = 1:Sw and beq should not write results to the register file.sw(beq) will overwrite a random register with either the store address (branch target) or random data from the memory data read port.

2). ALUop1 = 1:lw ,sw and beq will not work correctly.lw and sw will perform a random operation depending on the least significant bits of the address field

instead of addition operation necessary for address calculation.

3). Branch = 1: Instructions other than bran

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值