数电课件Lec04-Chap2.ppt.ppt

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

2.5 Representation of Negative Numbers Complement Number Systems(补码) Radix-Complement Representation(基数补码) The complement number system negates a number by taking its complement. 补码系统将一个数变负的方式是对其进行求补。P.35,Para. 3 The complement of an n-digit number is obtained by subtracting it from rn。P.35,Para. 6 求补的方式是从rn中减去该数。 * [-D]c= rn –D (注意D0) [-3]c=24 –3=10000 –0011=1101(二进制) 2.5 Representation of Negative Numbers If a number D is complemented twice, the result is D. 对一个数求两次补的结果等于其本身 [[3]] c =10000-(10000 –0011)=10000-1101=0011 ?taking complement and complement number are different. 对正数求补得到其相反数(即负数)的补码*。 * 2.5 Representation of Negative Numbers * Example 3. 试求-119的8位二进制补码。 解:+119的二进制原码:+119 则-119的补码可以通过下式算法得到: 28: 1 0 0 0 0 0 0 0 0 减去+119:? 0 1 1 1 0 1 1 1 -119的补码: 1 0 0 0 1 0 0 1 +119: 0 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 舍去MSB的进位 有没有更简便的方法求补码? * 2.5 Representation of Negative Numbers Complement Number Systems(补码) Diminished Radix-Complement(基数减1补码/反码) The Diminished Radix-Complement of an n-digit number is obtained by subtracting it from rn -1. [-D]反= rn-1–D (注意D0) Example :(-5)10的4位二进制反码应为 (1111)2–(0101)2=(1010) 2 (Tab. 2-6) * Example 4. 利用反码的定义求-119的8位二进制反码。 解:首先计算+119的原码:119 则其补码可以通过下式算法得到: 全1码: 1 1 1 1 1 1 1 1 减去+119: 0 1 1 1 0 1 1 1 -119的反码: 1 0 0 0 1 0 0 0 [-D]反= rn-1–D (注意D0) * 2.5 Representation of Negative Numbers Ones’–Complement Representation (二进制反码) 一个负数的二进制反码为: 其对应正数的原码每一位均按位取反 OR 符号位不变,其余位在本身原码基础上按位取反 Two’s-Complement Representation (二进制补码) Ones’–complement + 1 Only one representations of Zero (Why?) An n-bit two’s-complement range is –2n-1 ~ +(2n-1–1) Extra number, ?2n?1, doesn’t have a positive counterpart(Tab. 2-6) Expanding the sign bit ( 符号位扩展 ) 十进制 二进制原码 二进制反码 二进制补码 -8 —— —— 1000 -7 1111 1000 1001 -6 1110 1001 1010 -5 1101 1010 1011 -4 1100 1011 1100 -3 1011 1100 1101 -2 1010 1101 1110

文档评论(0)

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

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

1亿VIP精品文档

相关文档