复旦大学:《计算机原理 Computer System》课程资源_2006年期中考试答案

Expression Decimal Representation Binary representation 14 110010 011110 UX 35 1000l1 3 l11000 TMax 011111 -TMin 100000 TMin+TMin 0 000000 Des B M E Minus zero 10000000 01101101 29/16 14.5 Smallest denormalized(negative)10001111 15/16 1564 Largest normalized(positive) 31/16 31/2 01100001 17/16 8.5 0x780x560x340x1 000x000x00 660x660x0a 这道题的答案随着操作系统以及编译选项的变化可能会有所不同。 4 int addo(int x, int y) ints=x+ y int over=((s x)&(s y))>>31 return over +1 int satAdd(int x, int y) int over=((x s)&(ys))>>31 int differ=s>>( over 31); return differ +( over <<31)
1. Expression Decimal Representation Binary Representation _ -14 110010 _ 30 011110 ux 35 100011 y -3 111101 x>>2 -8 111000 TMax 31 011111 -TMin -32 100000 TMin+TMin 0 000000 2. Description Binary M E V Minus zero 1 000 0000 0 -2 -0.0 — 0 110 1101 29/16 3 14.5 Smallest denormalized (negative) 1 000 1111 15/16 -2 -15/64 Largest normalized (positive) 0 110 1111 31/16 3 31/2 — 01100001 17/16 3 8.5 3. 0x78 0x56 0x34 0x12 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x66 0x66 0x66 0x0a 0xc0 0x00 0x00 0x80 0x3f 0xde 0xbc 0x00 0x00 这道题的答案随着操作系统以及编译选项的变化可能会有所不同。 4. int addOK(int x, int y) { int s = x + y; int over = ( ( s ^ x ) & ( s ^ y ) ) >> 31; return over + 1; } int satAdd(int x, int y){ int s = x + y; int over = ( ( x ^ s ) & ( y ^ s ) ) >> 31; int differ3 = s >> ( over & 31 ); return differ3 + ( over << 31 ); } 5

int dog(int x, int y) int i, resulti X=X+2 result result return result 6 int cat(int x, int y) Int l, reti while( ret ret+ #define M 10 (lpt #define n 12(lpts int arrl[M]in]i int arr2 [M][N]i int moo(int x) int 1 for(i=0; i< M; 1++ arr1[][0]=axr2[i][8]+4 return (1)Oxbffff60c-0x4=0xbfffi608 (2)0 xfffffffc(%ebp)=0xb04a的地址是0xmr610.b的地址是0xmb14; returen address (3)这段程序中没有 callee registers,,而用到了%eax,%edx两个 caller register,这两个 register 在调用的函数中可以直接覆盖它们的值 (4)画出栈示意图
int dog(int x, int y) { int i, result; result =1 ; for (i = x ; i<y ; x=x+2 ) result = result*x ; return result; } 6. int cat(int x, int y) { int i, ret; ret = 0 ; i = x ; while( --i != -1 ) { ret = ret + y * i ; } return ret; } 7. #define M __10__ (1pts) #define N __12__ (1pts) int arr1[M][N]; int arr2[M][N]; int moo(int x) { int i; for(i=0; i < M; i++ ){ arr1[i ][0 ] = arr2[i ][8 ]+4x; } return i ; } 8. (1) 0xbffff60c-0x4=0xbffff608 (2)0xfffffffc(%ebp)=0xbffff604 a 的地址是 0xffff610;b 的地址是 0xffffb14;returen address 0xbffff60c. (3)这段程序中没有 callee registers,而用到了%eax, %edx 两个 caller register,这两个 register 在调用的函数中可以直接覆盖它们的值。 (4)画出栈示意图

Oxbffff60c Return address Oxbffff608 Oxbffff628 Oxbffff600 Oxbffff5f8 Oxbffff5f4 0x80484d8 (5)没有利用的空间是4个字节
0xbffff614 *a 0xbffff610 *b 0xbffff60c Return address 0xbffff608 0xbffff628 %ebp 0xbffff604 temp 0xbffff600 0xbffff5fc *a(swapped) 0xbffff5f8 *b(swapped) 0xbffff5f4 0x80484d8 %esp (5)没有利用的空间是 4 个字节
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 复旦大学:《计算机原理 Computer System》课程资源_教学大纲.pdf
- 复旦大学:《计算机图形学》课后习题答案_7.docx
- 复旦大学:《计算机图形学》课后习题答案_6.docx
- 复旦大学:《计算机图形学》课后习题答案_5.docx
- 复旦大学:《计算机图形学》课后习题答案_4.docx
- 复旦大学:《计算机图形学》课后习题答案_3.docx
- 复旦大学:《计算机图形学》课后习题答案_2.docx
- 复旦大学:《计算机图形学》课后习题答案_1.docx
- 复旦大学:《电子商务》课程PPT课件_第十次课 社会化电子商务——Hold住社会化媒体营销.ppt
- 复旦大学:《电子商务》课程PPT课件_第六次课 电子商务运营与管理 Operating Your E-Business.ppt
- 复旦大学:《电子商务》课程PPT课件_第六次课 电子商务运营与管理 Getting Your E-Business Off The Ground.ppt
- 复旦大学:《电子商务》课程PPT课件_第八次课 电子商务模式与应用课程主题案例分析与展示——电子商务团购.ppt
- 复旦大学:《电子商务》课程PPT课件_第五次课 商业模式的概念与内涵(发现商业模式).ppt
- 复旦大学:《电子商务》课程PPT课件_第九次课 B2B电子商务(B2B行业平台).ppt
- 复旦大学:《电子商务》课程PPT课件_第七次课 B2C电子商务——网上零售.pptx
- 复旦大学:《电子商务》课程PPT课件_第四次课 电子商务商业计划书写作 Creating a Winning E-Business Second Edition.ppt
- 复旦大学:《电子商务》课程PPT课件_第三次课 电子商务过程及相关因素(电子商务创业).ppt
- 复旦大学:《电子商务》课程PPT课件_第一次课 引言(胥正川).ppt
- 复旦大学:《电子商务》课程PPT课件_第二次课 电子商务的商业模式与分类.ppt
- 复旦大学:《电子商务》课程资源_教学研究:Research On The Utility Of An Advanced ACA In Context-Aware Tour Planning System.pdf
- 复旦大学:《计算机原理 Computer System》课程资源_2006年期中考试题目.doc
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Introduction to Computer Systems; Information is Bits+Context; Information Storage.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Integer Representations.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Integer Operations; Floating Points.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Machine-Level Representation of Programs I.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Machine-Level Representation of Programs Ⅱ.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Procedure Call and Array.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Heterogeneous Data Structures & Alignment; Putting it Together; Floating Point.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Processor Architecture.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_09、10 Sequential CPU Implementation.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Pipelined Implementation Part I.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Pipelined Implementation Part II.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_12b Code Optimization(• Machine-Independent Optimization – Code motion – Memory optimization • Suggested reading).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_13 Code Optimization(• Optimizing Blockers • Understanding Modern Processor • More Code Optimization techniques • Performance Tuning).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Hardware Organization.ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Memory Hierarchy(• Random-Access Memory(RAM)• Nonvolatile Memory • Disk Storage • Locality • Memory hierarchy).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Cache Memory(• General concepts • 3 ways to organize cache memory • Issues with writes • Write cache friendly codes • Cache mountain).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Cache Memory(• Cache mountain • Matrix multiplication).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Virtual Memory(• Virtual Space• Address translation • Accelerating translation• Different points of view).ppt
- 复旦大学:《计算机原理 Computer System》课程PPT课件_Virtual Memory(• Multilevel page tables • Different points of view • Pentium/Linux Memory System • Memory Mapping).ppt