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