- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
* 2.10 Binary Codes for Decimal Numbers(十进制数的二进制编码) 8421BCD 2421BCD Excess-3 Biquinary(二五混合码) 1-out-of -10(10中取1码) Weighted code(有权码) Self-complementing code(自反码) * 作 业 2.11 2.12 2.18 2.19 2.25 * Chapter 2 Number Systems and Codes(数字系统和编码) numeric quantities(数值) nonnumeric data, events, and conditions(非数值) —— binary number —— code Signed-magnitude code (S-M code): Signed number Two’s complement code : Change the sign means change every bit, and add 1 at LSB Signed number Converting rules for signed numbers From unsigned to signed: Its MSB is changed to sign bit. The number must be a positive ! Beware the overflow ! Key point: A positive signed number with any code must be the same ! Its MSB is “0” ! From one code to another Step 1: Check the MSB (sign-bit) ; For positive number (MSB =0) : no changes ! Step 2: For negative number (MSB =1) : first change its sign by the former code way; then change its sign by the next code way ! Examples : From one code to another * 二进制的原码、反码、补码 正数的原码、反码、补码表示相同 负数的原码表示:符号位为 1 负数的反码表示: 符号位不变,其余在原码基础上按位取反 在 |D| 的原码基础上按位取反(包括符号位) 负数的补码表示:反码 + 1 MSB的权是-2n?1 Signed number * Write the 8-bit signed-magnitude, two’s-complement, and ones’-complement representations of +11910 ,-1710. signed-magnitude Two’s complement Ones’- complement +1191001110111-171011101111正数的原码、反码、补码相同 Signed number * Sign extension(符号扩展) 4-bit number +610 0110 8-bit number- 610 1010 Given an n-bit two’s complement number X, the m-bit two’s-complement representation of X, where mn, can be obtained by appending m-n copies of X’s sign bit to the left of the n-bit representation of X. Why? Signed number * Write the signed-magnitude, two’s-complement, and ones’-complement representations: 1、( – 1101 )2 2、( – 0 . 1101 )2 [ [ D ]反 ]反 = D [ [ D ]补 ]补 = D 5-bit representations: S-M ones’ two’s 1 1101 1 0010
文档评论(0)