深入理解计算机系统lec01-intro.docxVIP

  • 13
  • 0
  • 约7.65千字
  • 约 17页
  • 2021-10-16 发布于山东
  • 举报
— PAGE \* Arabic 1 — 深入理解计算机系统lec01-intro Computer Systems: A Programmer’s Perspective 计算机系统详解 Lecture 1 Intro February 25, 2011 Wu junmin (jmwu@http://./doc/2edf862658fb770bf78a5596.html ) Outline °Course Theme °Five great realities of computer systems °Administrative Matters °Lecture topics and assignments 课程出发点 ° Abstract vs. Reality °抽象是必须的,但也应该考虑问题的实现! °其他计算机课程通常强调抽象的地方: ?抽象数据类型 ?渐进分析法 °这些抽象往往是受限的: ?特别是当计算机系统中存在一些小的缺陷 ?有必要去深入了解计算机系统中一些底层的实现 °通过了解具体的实现有助于: ?成为更有效率的程序员 -能够更有效的找出并且消除bug -能够更好的进行程序性能调优 ?为以后的计算机类“系统”级课程做好准备 -编译, 操作系统, 网络, 计算机体系结构, 嵌入式系统等等 Great Reality #1 °Int ’s 不是整数, Float ’s 不是实数°举例 ? x 2 ≥ 0? -Float ’s: 是! -Int ’s: – 40000 * 40000 -- 1600000000 – 50000 * 50000 -- ?? ? (x + y) + z = x + (y + z)? -Unsigned Signed Int ’s: 是! -Float ’s: – (1e20 + -1e20) + 3.14 -- 3.14 – 1e20 + (-1e20 + 3.14) -- ?? -1794967296 0 Computer Arithmetic °Does not generate random values ?Arithmetic operations have important mathematical properties °Cannot assume “usual” properties ?Due to finiteness of representations ?Integer operations satisfy “ring” properties -Commutativity, associativity, distributivity ?Floating point operations satisfy “ordering” properties -Monotonicity, values of signs °Observation ?Need to understand which abstractions apply in which contexts ?Important issues for compiler writers and serious application programmers 计算机运算规则 °不会产生随机值 ?每种运算操作都有很重要的数学含义和性质 °但不能假设具有某些“通常”性质 ?由于数字表达精度的有限 ?整数运算操作满足“环”性质 -交换性,结合性, 分配性 ?浮点运算操作满足“有序性”性质 -单调性, 正负符号的不变性 °可见: ?需要结合上下文环境来理解某些“抽象” ?对于编译器设计者或者关键应用的程序员,这是都是很重要的问题 Great Reality #2 °你应该了解一些汇编语言 °幸运的是,你永远也不会用汇编语言来写程序?编译器比你做的更好并且也更有耐心 °但理解汇编语言是认识机器级执行模型的关键?存在bug时的程序行为 -此时高级语言执行模型失效

文档评论(0)

1亿VIP精品文档

相关文档