首页 > 其他分享 >计算机体系结构第一章习题存档

计算机体系结构第一章习题存档

时间:2023-02-09 18:14:46浏览次数:44  
标签:CPI enhancements 0.25 time enhancement 存档 习题 CPU 体系结构

课本:Computer Architecture: A Quantitative Approach  Author: John L. Hennessy and David A. Patterson

1 Fundamentals of Computer Architecture

1.1 Layers of Computer System

Application Language Machine -- High-Level Language Machine -- Assembly Language Machine M3 -- 

Operating System Machine M2 -- Conventional Machine --Microprogram Machine

1.2 Defining Computer Architecture

What needs to be taken into consideration.

1.3 Measuring and Reporting Performance

Define X is n times faster than Y:Execution time Y/Execution time X = n

To measure performance: CPU time = User CPU time + System CPU time, and thus we can calculate a percentage.

Reporting results:

To calculate the execution time based on mutiple tests:

1. Arithmetic mean

2. Weighted arithmetic mean

Methods above are bad.

3. Geometic mean

Example: 

1.4 Quantitative Principles of Computer Design

Make the common case fast

Amdahl's law:

The performance improvement to be gained from using some faster mode of execution is limited by the fraction of the time the faster mode can be used.

加速某一部分对性能的提升取决于这部分在整体中所占的百分比

speedup: 加速后性能 / 没加速的性能

I can hardly stand the fucking results.

Example:

Suppose that we are considering an enhancement that runs 10 times faster than the original machine, but is only usable 40% of the time. What is the overall speedup gained by incorporating the enhancement?

1/((1-0.4)+0.4/10) = 1.56

CPU performance Equation:

CPU time: CPU clock cycles *  Clock cycle time = CPU clock cycles / Clock rate

CPI(Clock cycles per instruction 一条指令用几个周期) = CPU clock cycles / IC(instrcution count)

According to above, CPU time = CPI * IC / Clock rate, that's the data format we may use in exams.

Example:

Suppose we have the following measurements:

* Frequency of FP operations = 25%

* Average CPI of FP operations = 4.0

* Average CPI of other instructions = 1.33

* Frequency of FPSQR= 2%

* CPI of FPSQR = 20

Assume that the two design alternatives are to reduce the CPI of FPSQR to 2 or to reduce the average CPI of all FP operations to 2. Compare these two design alternatives using the CPU performance equation.

Original CPI: 0.25*4+0.75*1.33=2

1. 2-0.02*(20-2)=1.64

2. 2-0.25*(4-2)=1.5

Choose the second scheme.

More Examples:

  • 1.1 Three enhancements with the following speedups are proposed for a new architecture :

Speedup1=30 Speedup2=20 Speedup3=15

Only one enhancement is usable at a time.

A. If enhancements 1 and 2 are each usable for 25% of the time, what fraction of the time must enhancement 3 be used to achieve an overall speedup of 10? 

  Ans: 1/[(1-0.25-0.25-x)+0.25/30+0.25/20+x/15]=10, x=0.45

B. Assume the enhancements can be used 25%, 35% and 10% of the time for enhancements 1,2,and 3,respectively. For what fraction of the reduced execution time is no enhancement in use? 

  Ans: (1-0.25-0.35-0.1)/[(1-0.25-0.35-0.1)+0.25/30+0.35/20+0.1/15]=90.2%

C. Assume, for some benchmark, the possible fraction of use is 15% for each of enhancements 1 and 2 and 70% for enhancement 3. We want to maximize performance. If only one enhancement can be implemented, which should it be ? If two enhancements can be implemented, which should be chosen? 可

  List all the possible choices and compare.

  • 1.3 In many practical applications that demand a real-time response, the computational workload W is often fixed. As the number of processors increases in a parallel computer, the fixed workload is distributed to more processors for parallel execution. Assume 20 percent of W must be executed sequentially, and 80 percent can be executed by 4 nodes simultaneously. What is a fixed-load speedup? 

Ans: 1/(0.2+0.8/4)=2.5

 

标签:CPI,enhancements,0.25,time,enhancement,存档,习题,CPU,体系结构
From: https://www.cnblogs.com/capterlliar/p/17106580.html

相关文章

  • 计算机网络体系结构
    计算机网络所划分的层次以及各层协议的集合即为计算机网络体系结构。常见的三种划分方法:1.OSI参考模型国际标准化组织:开放系统互连(OpenSystemInterconnection,OSI)参考模......
  • 开学考前练习题的一点小思路
    大概是因为比较笨,刚看到王老师发的参考练习题时我是没有看懂的。原本本着熟悉一下流程的想法试了试,结果除了实现登陆外就没有什么太大的进展。后来又研究了研究,有了一点......
  • ARM体系结构与汇编
    ARM体系结构在ARM处理器中,除了用户模式是普通模式,剩下的几种工作模式都属于特权模式。应用程序如果要读写磁盘上的音频数据,驱动声卡播放音乐,往屏幕写数据显示歌词,......
  • 动态树习题
    维护连通性P2147[SDOI2008]洞穴勘测[]本篇参考大佬的题单......
  • csci 体系结构设计怎么写
    ComputerSoftwareConfigurationItem 计算机软件配置项  参考文献:计算机软件配置项csci-百度文库(baidu.com)说人话:软件产品的各个组成部分,细分到xx模块 ......
  • 24-组合逻辑电路习题课
    组合逻辑电路的习题课三态门从三态门的使能端进行分析CMOS三态门和TTL三态门区别,TTL可以悬空,CMOS不能,需要加一个电阻可以在总线上挂载模块,通过控制开关,控制传输数据的......
  • 20-逻辑门电路习题
    逻辑门电路习题1.输入和输出之间电压的关系前一级的输出作为后一级的输入,满足的输出电压和出入电压之间的关系。2.多余门电路端子处理3.扇出系数计算高电平--扇出......
  • Java程序设计基础复习题
    Java程序设计基础1-6一、Java语言概述1.Java语言有哪些特点?简单易学。Java去掉了C/C++语言支持的单个不易理解和掌握的数据类型(指针pointer、联合体unions、结构体stru......
  • 【RUST程序设计语言】第八章 常见集合练习题 Pig Latin
    题目摘录:给定一系列数字,使用vector并返回这个列表的中位数(排列数组后位于中间的值)和众数(mode,出现次数最多的值;这里哈希map会很有帮助)。将字符串转换为PigLatin,也......
  • 概率论与数理统计部分习题
    概率论答案0。利用协方差性质不相关,不独立。参照易错辨析:相关与不独立0.0062数理统计......