计算机组成原理-PKUSEI
计算机组成原理
王浩宇,北京邮电大学 计算机学院
haoyuwang@
本部教三楼 626
2017/3/2
BIG PICTURE
2 2017/3/2
计算思维VS. 系统思维
• 计算思维
– Computational Thinking (CT) is the thought processes
involved in formulating a problem and expressing its
solution(s) in such a way that a computer—human or
machine—can effectively carry out.
– 核心是抽象和自动化
• 从计算机学科中提炼
出来的一种普适思维
方式
From /wiki/
Computational_thinking
3 2017/3/2
Abstraction VS. Reality
• 计算机系统中提供不同层次的抽象,来隐藏实际实现
的复杂性
– 信息以二进制方式表示
• 通过抽象降低复杂度
– 抽象数据类型
• 数据结构
– 渐进分析(Asymptotic Analysis )
• 通过抽象来简化分析过程,忽略每个语句的实际开销
• 对运行时间的增长率感兴趣,只考虑运行时间表达式的最高次数项
– 算法模型
• 然而,要理解抽象的局限性
– 尤其是在需要处理bug的时候
– 为了保证程序的正确性和性能需要理解底层的实现
– 很多时候抽象的接口并不能提供所需要的控制和性能
4 2017/3/2
Great Reality #1
• There’s more to performance than asymptotic complexity
(性能比渐进复杂度更重要 )
• Constant factors matter too!
• And even exact op count does not predict performance
– Easily see 10:1 performance range depending on how code
written
– Must optimize at multiple levels: algorithm, data
representations, procedures, and loops
• Must understand system to optimize performance
– How programs compiled and executed
– How to measure program performance and identify
bottlenecks
– How to improve performance without destroying code
modularity and generality
5 2017/3/2
Great Reality #1
4.3ms