计算机系统基础(一):程序的表示、转换与链接(第四周小测验)

2年前 (2022) 程序员胖胖胖虎阿
210 0 0

1.若在一个8位计算机中完成x+2y的运算,假定变量x和y的机器数用补码表示为[x]补=44H,[y]补= DCH,则x+2y的机器数及相应的溢出标志OF分别是( )。

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice1">A.32H、0<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice1">B.32H、1<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice1">C.FCH、1<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="radio" name="choice1">D.FCH、0<br> </div>

2.若在一个8位计算机中完成x-2y,假定变量x和y的机器数用补码表示为[x]补=44H,[y]补= DCH,则x-2y的机器数及相应的溢出标志OF分别是( )。

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice2">A.68H、0<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice2">B.68H、1<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="radio" name="choice2">C.8CH、1<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice2">D.8CH、0<br> </div>

3.若在一个8位计算机中完成x/2+2y,假定变量x和y的机器数用补码表示为[x]补=44H,[y]补= DCH,则x/2+2y的机器数及相应的溢出标志OF分别是( )。

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice3">A.CAH、1<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice3">B.DAH、1<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice3">C.CAH、0<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="radio" name="choice3">D.DAH、0<br> </div>

4.假定变量r1 和r2的机器数用8位补码表示为[r1]补=F5H,[r2]补=EEH。若将运算结果存放在一个8位寄存器中,则下列运算中会发生溢 出的是( )。

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice4">A.r1/r2<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice4">B.r1+ r2<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice4">C.r1- r2<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="radio" name="choice4">D.r1× r2<br> </div>

5.假定整数加法指令、整数减法指令和移位指令所需时钟周期(CPI)都为1,整数乘法指令所需时钟周期为10。若x为整型变量,为了使 计算64*x所用时钟周期数最少,编译器应选用的最佳指令序列为( )。

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice5">A.1条左移指令和1条加法指令<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice5">B.两条左移指令和两条加法指令<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice5">C.1条乘法指令<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="radio" name="choice5">D.1条左移指令<br> </div>

6.假定整数加法指令、整数减法指令和移位指令所需时钟周期(CPI)都为1,整数乘法指令所需时钟周期为10。若x为整型变量,为了使 计算54*x所用时钟周期数最少,编译器应选用的最佳指令序列为( )。

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="radio" name="choice6">A.3条左移指令和两条减法指令<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice6">B.两条左移指令和两条减法指令<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice6">C.1条乘法指令<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice6">D.4条左移指令和3条加法指令<br> </div>

7.假定整数加法指令、逻辑运算指令和移位指令所需时钟周期(CPI)都为1,整数除法指令所需时钟周期为32。若x为整型变量,为了使 计算x/64所用时钟周期数最少,编译器应选用的最佳指令序列为( )。

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice7">A.1条除法指令<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice7">B.1条加法指令、1条右移指令<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice7">C.1条右移指令<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="radio" name="choice7">D.两条右移指令、1条与操作指令、1条加法指令<br> </div>

8.已知float型变量用IEEE 754单精度浮点格式表示,float型变量x和y的机器数分别表示为x=40E8 0000H,y=C204 0000H,则在计算x+y 时,第一步对阶操作的结果[Ex-Ey]补为( )。

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="radio" name="choice8">A.1111 1101<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice8">B.0000 0111<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice8">C.1111 1011<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice8">D.0000 0011<br> </div>

9.对于IEEE 754单精度浮点数加减运算,只要对阶时得到的两个阶之差的绝对值|ΔE|大于等于( ),就无需继续进行后续处理,此 时,运算结果直接取阶大的那个数。

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice9">A.127<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice9">B.128<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="radio" name="choice9">C.23<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="radio" name="choice9">D.25<br> </div>

10.若float和double分别采用IEEE 754单精度和双精度浮点数格式,sizeof(int)=4,则对于任意int型变量x、y和z,以下哪个关系表达 式是永真的?

<div> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="checkbox" name="choice10">A.dx*dx &gt= 0 <br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="checkbox" name="choice10">B.dx*dy*dz == dz*dy*dx<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled checked type="checkbox" name="choice10">C.(dx+dy)+dz == dx+(dy+dz)<br> &nbsp;&nbsp;&nbsp;&nbsp;<input disabled type="checkbox" name="choice10">D.dx/dx == dy/dy<br> </div>

相关文章

暂无评论

暂无评论...