1/21 Computer Organization and Architecture

Computer Organization and Architecture 1.1 computer systems 1.1.1 computer hardware component
Category Computer Architecture 1.1.2
1.1.3 system with a complex instruction set RISC System
1.1.4 Bus
1.2 Memory System 1.2.1 Main memory
1.2.2 auxiliary memory
1.2.3 Cache memory
1.3 Pipeline 1.3.1 pipeline cycle
1.3.2 calculation pipeline execution time
1.3.3 pipeline throughput
1.3.4 Pipeline speedup

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  The system is built on hardware and operating system, if we do not have some knowledge of the principles underlying computer, can cause a range of security and performance issues.

 
1.1 computer systems
1.1.1 computer hardware component
  Figure 1-1 is a block diagram of the basic computer.

 

(1) controller.

(2) operator.

(3) a main memory.

(4) a secondary memory.

(5) an input device.

(6) an output device.

Category Computer Architecture 1.1.2

1. The concept of stored program

The concept of "stored program" is • von Neumann, who in June 1946 first proposed, it may be briefly summarized as follows:

(1) a computer (hardware means) should be the five basic components of computing unit, a memory, a controller, input devices and output devices.

Internal (2) to represent a binary computer instructions and data.

(3) The program programmed in advance and the original data stored in the memory, and then restart the computer work.

2. Flynn classification

(1) a single instruction stream single data stream (Single Instruction stream and Single Data stream, SISD).

(2) SIMD (Single Instruction stream and Multiple Data stream, SIMD).

(3) a single instruction stream multiple data stream (Multiple Instruction stream and Single Data stream, MISD).

(4) MIMD (Multiple Instruction stream and Multiple Data stream, MIMD).

1.1.3 Complex Instruction Set System (Complex Instruction Set Computer, CISC) and reduced instruction set system (Reduced Instruction Set Computer, RISC)

1.1.4 Bus

总线是一组能为多个部件分时共享的公共信息传送线路。

按总线相对于 CPU 或其他芯片的位置可分为内部总线和外部总线两种。

按总线功能来划分,又可分为地址总线、数据总线、控制总线三类。

 

1.2 存储器系统

  存储器是用来存放程序和数据的部件,它是一个记忆装置,也是计算机能够实现“存储程序控制”的基础。

  在计算机系统中,规模较大的存储器往往分成若干级,称为存储器系统。

 

存储器中数据常用的存取方式有顺序存取、直接存取、随机存取和相联存取四种。

1.2.1 主存储器

根据工艺和技术不同,主存可分为随机存取存储器和只读存储器。

1.随机存取存储器

随机存取存储器(Random Access Memory,RAM)既可以写入也可以读出,但断电后信息无法保存,因此只能用于暂存数据。

2.只读存储器

只读存储器(Read Only Memory,ROM)可以看作 RAM 的一种特殊形式,其特点是:存储器的内容只能随机读出而不能写入。

1.2.2 辅助存储器

1.磁带存储器

2.硬盘存储器

在硬盘中,信息分布呈以下层次:记录面、圆柱面、磁道和扇区,如图1-2 所示。

 

故磁盘访问时间为:

 磁盘访问时间(存取时间) = 寻道时间+旋转延迟时间

1.2.3 Cache存储器

Cache 通常采用相联存储器(ContentAddressable Memory,CAM)。

1.Cache 基本原理

    使用 Cache 改善系统性能的依据是程序的局部性原理。

2.映射机制

    当 CPU 发出访存请求后,存储器地址先被送到 Cache 控制器以确定所需数据是否已在 Cache 中,若命中则直接对 Cache 进行访问。这个过程称为 Cache 的地址映射(映像)。

常见的映射方法有直接映射、全相联映射和组相联映射。

3.替换算法

    当Cache产生了一次访问未命中之后,相应的数据应同时读入CPU和Cache。但是当Cache已存满数据后,新数据必须替换(淘汰)Cache中的某些旧数据。最常用的替换算法有以下三种:

(1)随机算法。

(2)先进先出(First In and First Out,FIFO)算法。

(3)近期最少使用(Least Recently Used,LRU)算法。

4.写操作

    因为需要保证缓存在 Cache 中的数据与内存中的内容一致,相对读操作而言,Cache 的写操作比较复杂,常用的有以下几种方法。

(1)写直达(write through)。

(2)写回(write back)。

(3)标记法。

 

1.3 流水线

  流水线技术把一个任务分解为若干顺序执行的子任务,不同的子任务由不同的执行机构负责执行,而这些机构可以同时并行工作。在任一时刻,任一任务只占用其中一个执行机构,这样就可以实现多个任务的重叠执行,以提高工作效率。

 

1.3.1 流水线周期

流水线应用过程中,会将需要处理的工作分为 N 个阶段,最耗时的那一段所消耗的时间为流水线周期。如:使用流水线技术执行100条指令,每条指令取指2ms,分析4ms,执行1ms,则流水线周期为4ms。

1.3.2 计算流水线执行时间

    延续上面的场景,将 1 个任务的执行过程可分成 N 个阶段,假设每个阶段完成时间为 t,则完成该任务所需的时间即为 Nt。若以传统的方式,则完成 k 个任务所需的时间是 kNt;而使用流水线技术执行,且花费的时间是Nt+(k-1)t。也就是说,除了第 1 个任务需要完整的时间外,其他都通过并行,节省下了大量的时间。所以流水线的执行时间可通俗的表达为:

    流水线执行时间=第1条指令的执行时间+(n-1)*流水线周期

    注:n 代表需要处理的任务数量。

1.3.3 流水线的吞吐率

    流水线的吞吐率(Though Put rate,TP)是指在单位时间内流水线所完成的任务数量或输出的结果数量。有些文献也称为平均吞吐率、实际吞吐率。

1.3.4 流水线的加速比

    完成同样一批任务,不使用流水线所用的时间与使用流水线所用的时间之比称为流水线的加速比(speedup ratio)。

 

 

 

Guess you like

Origin www.cnblogs.com/shining1874/p/12431796.html