lec02b-Integers.pptVIP

  • 6
  • 0
  • 约 43页
  • 2017-05-10 发布于浙江
  • 举报
lec02b-Integers

Computer Systems: A Programmer’s Perspective 计算机系统详解 Lecture 2b March 11, 2011 Wu junmin (jmwu@ustc.edu.cn) Overview Numeric Encodings Unsigned Two’s complement Programming Implications C promotion rules Basic operations Addition, negation, multiplication Programming Implications Consequences of overflow Using shifts to perform power-of-2 multiply/divide C趣味习题 以前考试中的一些习题 假设机器为32位字长,整数采用二进制补码 对以下每个C表达式: 对所有可能的参数值证明其为真 或给出反例 整数编码 C short型数据 2字节长 符号位 对二进制补码, 最高有效位指明正负数。 0 表示正 1 表示负 编码举例 (Cont.) 数值范围 无符号数 UMin = 0 000…0 UMax = 2w – 1 111…1 二进制补码值 TMin = –2w–1 100…0 TMax = 2w–1 – 1 011…

文档评论(0)

1亿VIP精品文档

相关文档