- 1
- 0
- 约9.88千字
- 约 38页
- 2017-07-07 发布于四川
- 举报
* * 计算机组成原理 Principles of Computer Organization 广义双语教学课程 09/skyclass25/ 青岛理工大学 校级精品课程 /ec/C84/ 第3章 运算方法和运算部件 ( 5 ) Floating-point computation in a computer can run into three kinds of problems: An operation can be mathematically illegal, such as division by zero. An operation can be legal in principle, but not supported by the specific format, for example, calculating the square root of ?1 or the inverse sine of 2 (both of which result in complex numbers). An operation can be legal in principle, but the result can be impossible to represent in the specified format, because the exponent is too large or too small to encode in the exponent field. Such an event is called an overflow (exponent too large) or underflow (exponent too small). §3.5 浮点数的运算方法 Floating-Point Arithmetic 浮点加减法运算 浮点乘法运算 Floating-Point Multiplication Floating-Point Addition Subtraction 浮点除法运算 Floating-Point Division 浮点运算 Floating-Point Arithmetic 浮点运算要把阶码和尾数分别处理。 阶码的运算是定点整数运算,对阶码的运算有四种:阶码加1,阶码减1,两阶码求和,两阶码求差。 尾数的运算是定点小数运算。 运算过程中一般取双符号位。 浮点运算器总是由处理阶码和处理尾数的两部分组成。 Floating-point representation is similar in concept to scientific notation. The way in which the significand, exponent and sign bits are internally stored on a computer is implementation-dependent. 浮点数的溢出 Overflow 当一个数的大小超出了浮点数的表示范围时,机器无法表示该数,就发生溢出。浮点数的溢出判断方法与定点数不同,是对规格化数的阶码Exponent进行判断。 当浮点数的阶码大于机器所能表示的最大阶码时(即阶码发生正溢出),称为溢出(Overflow)或上溢,此时机器应停止运算,进行出错中断处理。 当浮点数的阶码小于机器所能表示的最小阶码时(即阶码发生负溢出),称为下溢(Underflow)。这时一般规定把该浮点数的尾数强迫置零,作为零处理,机器可继续运行。 当一个浮点数的尾数为0,不论其阶码为何值,或者阶码的值小于等于它能表示的最小数值(下溢)时,不论其尾数为何值,计算机都把该浮点数看成零值,称为机器零。 浮点数的尾数运算的溢出可以通过右规消除。 不算溢出 浮点加减法运算Floating-Point Addition Subtraction 设有两个规格化浮点数 X=MX·2Ex , Y=MY·2Ey 若两数的阶码相等,即 EX=EY,有 X+Y = 将两浮点数的尾数相加,就可得到浮点形式的和。 一般情况下,EX≠EY,计算X+Y要用如下五个步骤来完成: ① 对阶 ② 尾数相加 ③ 规格化 ④ 舍入 ⑤ 检查阶码是否溢出。 1、浮点加法运算 Floating-Point Addition MX ·2Ex + MY ·2Ey =(MX + MY )·2Ex (1) 对阶 Alignment 两数相加,必须使小数点对齐。对于浮点数来说,就是使阶码相等。使阶码相等的过程称为对阶。 对阶的原则是:小的阶码向大阶码看齐。
您可能关注的文档
最近下载
- 枣庄市台儿庄区2025届公费医学毕业生定岗笔试参考题库附答案解析.docx VIP
- 高中英语2025届高考热点人工智能与科技伦理主题作文核心词汇解读.doc VIP
- 2026中考数学压轴题每日一题(120题)答案.pdf VIP
- 2025年03月山东临沂市公费医学生考试选聘笔试历年专业考点(难、易错点)附带答案详解 .doc
- 基于PLC技术的数据中心冷源自控系统设计与应用.pdf VIP
- 时间在哪里认识时间 课件 人教版数学二年级下册.pptx VIP
- 2024年浙江事业单位427统考《综合应用能力》模考大赛(第二季).docx VIP
- 永川年产 200 万把陶瓷水果刀生产线设计.docx VIP
- 2024年07月山东省公费医学生(定向淄博)统一选岗2人笔试历年专业考点(难、易错点荟萃)附带答案详解 .doc
- 常见氧疗方式及其选择ppt课件-----精品课件下载.ppt VIP
原创力文档

文档评论(0)