网站大量收购独家精品文档,联系QQ:2885784924

第二章数据的机器级表示与处理讲解.ppt

  1. 1、本文档共65页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
第二章数据的机器级表示与处理讲解

数据的运算小结 C语言中涉及的运算 整数算术运算、浮点数算术运算 按位、逻辑、移位、位扩展和位截断 整数的加、减运算 计算机中的“算盘”:模运算系统(高位丢弃、用标志信息表示) 带符号整数和无符号数的加、减都在同一个“算盘”中 现实与计算机中的运算结果有差异(计算机是模运算系统) 整数的乘、除运算 无符号整数:逻辑左移k位等于乘2k、逻辑右移k位等于除2k 带符号整数乘:算术左移k位等于乘2k 带符号整数除:(x=0 ? x : x+2k-1)算术右移k位,等于x除以2k 浮点数运算 加减:对阶/尾数加减/规格化/舍入(就近舍入到偶数)(大数吃小数) 乘除:尾数相乘除,阶码相加减 作 业 自学第三章部分内容:IA-32指令系统,常用指令类型及操作,复杂数据类型的分配和访问。课本3.2,3.3,3.5节。(这段内容不讲) 存在问题 学生缺乏将机器级数据表示和程序设计及程序调试工作相互关联的意识。许多学生也许对机器级数据表示的基本原理和概念很了解,但在程序设计和调试工作中,往往不会运用所学知识解决实际问题,不会把高级语言中的类型定义、数值范围、数据类型转换等问题和本课程所学的知识联系起来,因而,所学知识没有起到真正的作用。 解决方法 为了增强学生对机器级数据表示的认识,可以让学生亲自编写相关的程序,通过程序的执行结果来理解本章所学的知识。 例如:确定float型变量和double型变量的精度;检查一些特殊表达式的运行结果,如一个非零整数除以0、一个非零实数除以0、0除以0、负数开平方等等;(3) 编程检查机器是大端还是小端方式,数据是对齐存放还是不对齐存放。 Besides detecting overflow, our ALU also needs to indicate if the result is zero. This is easy to do. All we need is a BIG NOR gate. Then if any of the Result bit is not zero, then the output of the NOR gate will be low. The only time the output of the NOR gate is high is when all the result bits are zeroes. +1 = 43 min. (Y:23) Supplement: why do we need to check if the result is zero? For instructions such as bne, beq, slt, … Besides detecting overflow, our ALU also needs to indicate if the result is zero. This is easy to do. All we need is a BIG NOR gate. Then if any of the Result bit is not zero, then the output of the NOR gate will be low. The only time the output of the NOR gate is high is when all the result bits are zeroes. +1 = 43 min. (Y:23) Supplement: why do we need to check if the result is zero? For instructions such as bne, beq, slt, … Besides detecting overflow, our ALU also needs to indicate if the result is zero. This is easy to do. All we need is a BIG NOR gate. Then if any of the Result bit is not zero, then the output of the NOR gate will be low. The only time the output of the NOR gate is high is when all the result bits are zeroes. +1 = 43 min. (Y:23) Supplement: why do we need to check if the result is zero? For instructions such as bne, beq, slt, … Besi

文档评论(0)

4477704 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档