- 1、本文档共9页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
ppt课件-1。我istring integerto s c(1. integerto a s c i istring)
1. Integer to ASCII string For example, if $a0 = 0000002A, which is 101010two=42ten, then $a1 = addi $t0, $zero, 10 div $a0, $t0 # $a0/10 mflo $a1 # $a1 = quotient addi $a1, $a1, 0x30 # convert to ASCII mfhi $t0 # $t0 = remainder addi $t0, $t0, 0x30 # convert to ASCII sll $t0, $t0, 8 or $a1, $a1, $t0 2. Integer Division 3. MIPS Instruction addi $a1, $zero, 32 loop: addi $a1, $a1, -4 lw $a0, 8($a1) beq $a1, $zero, exit j loop exit 4. Floating-Point 1100 0000 0010 1100 0000 0000 0000 0000 ?1*8513-511*0.011=?64*(1/4+1/8)=?24 Smallest number 8-512*2-22 10-600 Why no hidden bit? For base 2, we can always normalize to 1.M*2e. For example, (0.1)two = (1.0)two*2?1, (0.01)two= (1.0)two*2?2, (0.001)two = (1.0)two*2?3 For base 8, it is not always possible to normalize to 1.M*8e. For example, (0.1)two=(0.1)two*80=(100.0)two*8, (0.01)two=(0.01)two*80=(10.0)two*8?1 For any base other than 2, there can not be any hidden bit. 5. Questions Booths algorithm: See 00, 11 do nothing See 01, addition See 10, subtraction Best if 11111111111…, 1 add, 1 sub Worst if 101010101…, 16 add, 16 sub Speedup 2 hours from CLL to AUS 4 hours from AUS to LAX, 1200 miles Total 6 hours Speedup 2, meaning 3 hours Alternative answer (assume perm between AUS and LAX) 1 hour from AUS to LAX = 1200/hour Total 4 hours 2 hours from AUS to LAX = 600/hour b) MIPS Convert beq $a0, 0x1234abcd, exit Answer: lui $at, 0x1234 ori $at, $at, 0xabcd beq $a0, $at, exit e) Floating-Point Associative Operation ? is associative if a?(b?c) = (a?b)?c For example, + and * is associate What about division? 3/(4/5)=(3/4)/5? No! FP addition: a+(b+c)=(a+b)+c? 10^1000+(-10^1000+1)=0 (10^1000-10^1000)+1=1 Example: Avoid FP error To compute the average age for all people in USA Method 1: Add age of all people into total Compute total/295,000,000 Method 2: Compute average age for each group of 1,000 people Compute the average of every 1,000 groups Compute the average of the 295 averages Which met
您可能关注的文档
- ppt课件-飲料調製實習報告930.ppt
- ppt课件-政府安全生产监管职责.ppt
- ppt课件-职业形象与商务礼仪.ppt
- ppt课件-中药分离原理及应用.ppt
- ppt课件-€获取文档-自由问u l +自由问u l +(a€ fetch document- lib q u a l+- lib q u a l+).ppt
- ppt课件-1 .人类( the originof humans).ppt
- ppt课件-1 -犹太机构(1- the jewish agency).ppt
- ppt课件-3 - d医学扫描仪——罗德岛大学(3- d medical scanner- universityof rhode island).ppt
- ppt课件-3 m peltor o r t c - ear战术通信耳机(3 m peltor o r a t a c in- ear tactical communications headset).ppt
- ppt课件-5 pseudo -健康foods-and5比你想象的更健康(5 pseudo- healthy foods—and5 that are healthier than you think).ppt
文档评论(0)