02325 "Computer System Architecture" Self-examination Concept Questions: Chapters 1~4

Review the general catalog

  02325 "Computer System Architecture" self-examination review key list

1. Introduction to computer system structure

1.1 Multilevel Hierarchy of Computer Systems

(1) Multi-level hierarchical structure of computer systems (p1)
  M5: Applied language machine Applied language program → \to application packagetranslation → \to High-level language program
  M4: High-level language machine High-level language program→ \to Compilertranslation → \to Assembly language
  M3: assembly language machine assembly language program→ \to assemblertranslation → \to Machine language program
  M2: Operating system machineInterpretsjob control statementsInterpretsmachine instructions
  with microinstruction program   M0: Microprogramme machine Microinstructions are directly executed by hardware

1.2 Computer system structure, composition and implementation

(1) Definition and connotation (p3)
  Computer system structure : also called computer system architecture, it is only a part of the system structure, referring to the traditional machine-level system structure. The study of computer system structure is the function allocation between software and hardware and the determination of the traditional machine-level interface.
  Computer composition : the logical implementation of computer system structure , including the composition of data flow and control flow inside the machine level and logic design.
  Computer implementation : the physical realization of computer components, including the physical structure of processors, main memory and other components, the degree of integration and speed of devices, the division and connection of devices, modules, plug-ins, and backplanes, the design of special devices, micro-assembly technology, signal Transmission, power supply, cooling and machine assembly technology, etc.

(2) Example (p4)
Example 1:
  Computer system structure: determination of instruction system.
  Computer composition: the implementation of instructions, such as instruction fetching, instruction opcode decoding, calculation of operand address, number fetching, operation, and operation arrangement and sequencing of sending results.
  Computer implementation: the design and assembly technology of specific circuits and devices to realize the functions of these instructions.

Example 2:
  Computer system structure: determine whether to set up a multiplication instruction in the instruction system.
  Computer composition: Whether the multiplication instruction is realized by a special high-speed multiplier, or by using an adder and a shifter to control its addition and right shift through a series of timing signals.
  Computer implementation: physical implementation of multipliers and adder-shifters, such as device type, integration, quantity, price, determination and selection of micro-assembly technology.

Example 3:
  Computer system structure: determination of main memory capacity and addressing mode (access by bit, byte or word, etc.).
  Computer composition: In order to meet performance and price requirements, what is the speed of the main memory, and whether the logical structure adopts multi-body crossover.
  Computer implementation: the selection of main memory devices, logic design, and the use of micro-assembly technology.

1.3 Software and hardware trade-offs, performance evaluation and quantitative design principles of computer systems

(1) The law of locality of program access (p13)
  The locality of program access includes two localities in time and space .

(2) Computer system design method (p14)
  The computer system design method is best designed from the middle to both sides . (Determine the allocation of software and hardware functions in the middle, and then go to both sides)

1.4 The impact of software, applications, and devices on the system structure

(1) The technical approach and applicable environment for software transplantation. (p15~17, short answer questions)
  ① Unified high-level language: suitable for the transplantation of high-level language program application software
  between machines with completely the same or completely different structures; Transplantation of assembly language application software and some system software ; ③ Simulation and emulation: suitable for transplantation of machine language programs
  between machines with different structures .

(2) The concept of simulation and emulation and the difference between them (p17, short answer questions)
  Simulation : use machine language program to explain the method of software transplantation.
  Emulation : A method of directly interpreting another machine's instruction system with a microprogram.
  The main difference between simulation and emulation is the language used for interpretation and its storage location.
  Simulation is interpreted by machine language program , and its interpreter is stored in main memory ;
  simulation is interpreted by microprogram , and its interpreter is stored in control memory .

1.5 Development of Parallelism in System Architecture and Classification of Computer Systems

(1) Three ways to improve the parallelism technology of computer systems. (p24, short answer questions)
  ① Time overlap : Introduce the time factor into the concept of parallelism , so that multiple processing processes are staggered in time, and each part of the same hardware device is used in turns to overlap, so as to speed up hardware turnover to gain speed.
  ②Resource duplication : Introduce the space factor into the concept of parallelism , and improve reliability or performance by repeatedly setting hardware resources.
  ③Resource sharing : Use software methods to allow multiple users to use the same set of resources in turn according to a certain time sequence to improve resource utilization, thereby improving system performance.

(2)弗林提出按 指令流数据流 的多倍性对计算机系统进行分类。(p26)
  ① 单指令流单数据流 S I S D \mathrm{SISD} SISD:传统单处理器计算机;
  ② 单指令流多数据流 S I M D \mathrm{SIMD} SIMD:阵列处理机( I L L I C A   Ⅳ \mathrm{ILLICA\ Ⅳ} ILLICA 、分布式存储器阵列处理机);相联处理机;
  ③ 多指令流单数据流 M I S D \mathrm{MISD} MISD:处理机间的宏流水;脉动阵列流水机;
  ④ 多指令流多数据流 M I M D \mathrm{MIMD} MIMD:多处理机;

2. 数据表示、寻址方式与指令系统

2.1 数据表示

(1)标志符和数据描述符的差别(课后习题 2-2,p32~36,简答题)
  标志符是和每个数据相连的,合存在一个存储单元中,描述单个数据的类型特征
  数据描述符是与数据分开存放,用于描述所要访问的数据是整块的还是单个的,访问该数据块或数据元素所要的地址以及其他信息。

(2)尾基 r m r_m rm 的影响。(p42)
   r m r_m rm 越大,可表示数范围越大,可表示数的个数越多,数在数轴上的分布越稀疏,可表示的精度越低,运算中的精度损失越小,运算速度越快。

(3)浮点数尾数的下溢处理方法。(p44)
  ① 截断法:实现简单,不增加硬件,不需要处理时间。
  ② 舍入法:最大误差 0.5,统计平均误差趋于 0。
  ③ 恒置 “1” 法:平均误差趋于 0,最大误差最大。
  ④ 查表舍入法:平均误差可调节到 0,是最好的方法。

2.2 寻址方式

(1)指令中常用下列寻址方式来得到操作数:立即操作数、间接寻址、直接寻址、寄存器寻址、自相对寻址。请分别说明这些寻址方式的原理,并对它们在如下四个方面进行比较:(课后习题 2-8)
① 可表示操作数的范围大小;
② 除取指外,为获得操作数所需访主存的最少次数;
③ 为指明该操作数所占用指令中的信息位数多少;
④ 寻址复杂性程度。

立即寻址
  立即操作数的寻址原理是,操作数以常数形式直接存放在指令中操作码的后面。一旦指令被取出,操作数也被取得,立即可以使用。
① 立即操作数由于受机器指令字长的限制,可表示数的范围小,一般为 8 位或 16 位的二进制常数。
② 指令取出后,为获得操作数不需要再访存,即访存 0 次。
③ 操作数所占用指令中的信息位数是立即数在可表示最大值范围时所要占用的二进位位数。
④ 寻址的复杂性程度相对低。

间接寻址
  间接寻址可以有寄存器间接寻址和存储器间接寻址两种。其寻址原理是,在指令的操作数地址字段上只给出存放操作数在内存中物理地址的寄存器号或存储单元地址。先由指令操作数地址字段,从寄存器或存储单元中取出数在存储器中的地址。再按此地址访存,才能间接取得所要的操作数。
① 间接寻址访问到的操作数范围大,可以是主存中能访问到可表示数值范围最大的数。
② 除取指外,获得所需操作数所需访问主存的最少次数,对于寄存器间接寻址为一次,对于存储器间接寻址为两次。
③ 为指明该操作数所占用指令中的信息位数,对于寄存器间接寻址来说,只是为寄存器标号所占用的二进位位数,这种位数一般很短;而对于存储器间接寻址来说,需占访存逻辑地址所需的全部位数。
④ 间接寻址的复杂性一般最高。其中,寄存器间接寻址较存储器间接寻址简单,最复杂的是存储器多重间接寻址。

直接寻址
  直接寻址的原理是,由指令中操作数地址码字段给出存放操作数在内存中的有效地址或物理地址。
① 直接寻址可表示操作数值的范围大,可以是主存中能访问的可表示值范围最大的数。
② 除取指外,为获得所需操作数,需要再访问一次主存。
③ 为指明操作数所占用指令中的信息位数,是访存单元的有效地址或物理地址所需要的位数。
④ 直接寻址的复杂性较寄存器寻址的大,而它较寄存器间接寻址要简单些。

寄存器寻址
  寄存器寻址的原理是,指令的操作数地址码字段给出存放操作数所用的寄存器号。
① 可表示操作数的范围大小取决于存放操作数所用的寄存器的二进位位数。
② 除取指外,为获得操作数不用访存,即访存 0 次。
③ 为指明操作数所占用指令中的信息位数,只是寄存器编号所占的二进位位数,很短。
④ 寄存器寻址简单,其取数的时间要比访存的时间短得多。

自相对寻址
  自相对寻址方式主要用于转移指令形成转向目标地址,有的也用于访问存储器寻找操作数,以访问存储器操作数寻址为例,指令中操作数字段给出所访问操作数存放在主存中相对于指令计数器当前值的位移地址。
① 自相对寻址所寻址的操作数可表示范围大,可以是主存中能访问的可表示值范围最大的值。
② 除取指外,为获得操作数所需访问的次数为 1 次。
③ 为指明该操作数所占用指令中的信息位数取决于允许的最大相对位移量大小。
④ 寻址复杂性较直接寻址的略复杂些。

2.3 指令系统的设计和优化

2.4 指令系统的发展和改进

(1)在机器指令系统的设计、发展和改进上有两种不同的途径和方向,分别是 复杂指令系统计算机 (CISC)精简指令系统计算机 (RISC)。(p57)

(2)设计 RISC 的基本原则(p63,简答题)
  ① 确定指令系统时,只选择使用频度很高的指令,再增加少量能有效支持操作系统、高级语言实现及其他功能的指令;
  ② 减少指令系统所用寻址方式种类;
  ③ 让所有指令都在一个机器周期内完成;
  ④ 扩大通用寄存器数,尽量减少访存;
  ⑤ 大多数指令都用硬联控制实现,少数指令用微程序实现;
  ⑥ 通过精简指令和优化设计编译程序,简单有效地支持高级语言的实现。

(3)设计 RISC 结构的基本技术。(p64~66,简答题)
  ① 按照设计 RISC 的一般原则来设计;
  ② 逻辑实现采用硬联和微程序相结合;
  ③ 在 CPU 中设置大量工作寄存器并采用重叠寄存器窗口;
  ④ 指令用流水和延迟转移;
  ⑤ 采用高速缓冲存储器 Cache,设置指令 Cache 和数据 Cache 分别存放指令和数据;
  ⑥ 优化设计编译系统。

3. 存储、中断、总线与 I / O \mathrm{I/O} I/O 系统

3.1 存储系统的基本要求和并行主存系统

(1)并行主存系统是指能并行读出多个 CPU 字的 单体多字多体单字多体多字 的交叉访问主存系统。(p75)

(2)提高模 m m m 值,影响主存实际频宽的因素及结果。(p76,简答题)
  原因一:对模 m m m 交叉,若都是顺序取指,效率可提高到 m m m 倍。但实际程序中指令不总是顺序执行的,一旦出现转移,效率会下降。转移频率越高,并行主存系统效率下降越大。而数据的顺序性比指令要差,实际的频宽还可能要低一些。
  原因二:工程实现上由于模 m m m 越大,存储器数据总线越长,总线上并联的负载越重,有时还不得不增加门的级数,会使传输延迟增加。
  结果:提高模 m m m 值能提高主存系统的最大频宽,但主存的实际频宽并不随 m m m 值增大而线性提高,实际效率并不像所希望的那么高。

3.2 中断系统

(1)中断概念(p77,简答题)
  中断是指 CPU 中止正在执行的程序,转去处理随机提出的请求,待处理完后,再回到原先被打断的程序继续恢复执行的过程。

(2)中断的分类依据及分类的目的。(课后习题 3-3,p78,简答题)
  分类依据:将中断源性质相近、中断处理过程类似的归为一类;
  分类的目的:减少中断处理程序的入口,每一类给一个中断服务程序总入口,可以减少中断服务程序入口地址形成的硬件数量。

(3)中断分类(p78)
  中断可分为内部中断外部中断软件中断三类。内部中断由 CPU 内的异常引起,外部中断由中断信号引起,软件中断由自陷指令引起。
  IBM 370 把中断分为 6 类:
  ① 机器校验:设备故障(电源故障、运算电路误动作、主存出错通道动作故障、处理器硬件故障)
  ② 管理程序调用
  ③ 程序性:指令和数据的格式错误、程序执行中出现异常
  ④ 外部:来自机器外部(定时器中断、外部信号中断、中断键中断)
  ⑤ 输入 / 输出
  ⑥ 重新启动

(3)IBM 370 中断响应优先次序。(课后习题 3-4,p79)
  由高到低:紧急的机器校验、访管、管理程序调用和程序性、可抑制的机器校验、外部、输入 / 输出、重新启动

(4)中断系统采用软硬件结合的好处(p83,简答题)
  中断响应排队器硬件实现可以加快响应断点现场的保存;
  中断处理采用软的技术可以提供很大的灵活性

3.3 总线系统

(1)总线的分类(p84)
  总线按允许信息传送的方向可分为单向传输双向传输两种。
  总线按用法可分专用非专用两类。
   N N N 个部件用双向专用总线互连,要 N × ( N − 1 ) / 2 N\times (N-1)/2 N×(N1)/2 组总线。

(2)总线的控制方式(课后习题 3-7,p85,简答题)

总线控制方式 增加控制线数量 总线控制优先级可否由程序改变
集中式串行链接 3 3 3 优先级线固定,不能被程序改变,不灵活
集中式定时查询 2 + ⌈ l o g 2 N ⌉ 2+\left \lceil\mathrm{log_2}N\right \rceil 2+log2N 优先级可用程序改变,灵活
集中式独立请求 2 N + 1 2N+1 2N+1 优先级可用程序改变,灵活

(3)总线的各个控制方式优缺点(课后习题3-8,p85,简答题)
  ① 串行链接
  优点:选择算法简单,用于解决总线控制分配的控制线的线数少,只需要 3 根,且不取决于部件的数量;部件的增减容易,只需要简单地把它连到总线上或从总线上去掉即可,可扩充性好;逻辑简单,容易通过重复设置提高可靠性。
  缺点:对“总线可用”线及其有关电路的失效敏感;优先级是线连固定,不能由程序改变,不灵活;因“总线可用”信号必须顺序脉动地通过各个部件,所以限制了总线的分配速度;因受总线长度的限制,增减或移动部件也受到限制。
  ② 定时查询
  优点:因计数器初值、部件号均可由程序置定,优先次序可用程序控制,灵活性强;不会因某个部件失效而影响其他部件对总线的使用,可靠性强。
  缺点:控制线的线数较多,需 2 + ⌈ l o g 2 N ⌉ 2+\left \lceil\mathrm{log_2}N\right \rceil 2+log2N 根;可以共享总线的部件数受限于定时查询线的线数(编址能力),扩展性稍差;控制较为复杂;总线分配的速度取决于计数信号的频率和部件数,不能很高。
  ③ 独立请求
  优点:总线分配速度快,所有部件的总线请求同时送到总线控制器,不用查询;控制器可以使用程序可控的预定方式、自适应方式、循环方式或它们的混合方式灵活确定下一个使用总线的部件;能方便地隔离失效部件的请求。
  缺点:控制线数量过大,为控制 N N N 个设备必须有 2 N + 1 2N+1 2N+1 根控制线,且总线控制器要复杂很多。

3.4 输入 / 输出系统

(1)字节多路通道、数组多路通道、选择通道分别适用连接的设备及各通道的特点。(p94,简答题)
  字节多路通道:适用于连接大量的字符类低速设备传送一个字符 (字节) 的时间很短,但字符 (字节) 间的等待时间很长;
  数组多路通道:适用于连接多台高速设备, 设备的传送速率很高,但传送开始前的寻址辅助操作时间很长;
  选择通道:适用于连接优先级高的高速设备,在数据传送期内独占通道,只能执行一道通道程序。

(2)字节多路、数组多路和选择通道的数据传送方式。(习题 3-10,p94,简答题)
  字节多路通道每选择好一台设备后,设备与通道只传送一个字节就释放总线,通道以字节交叉的方式轮流为多台低速设备服务。某台设备要想传送 n n n 个字节,就需经 n n n 次申请使用通道总线才行。
  数组多路通道在每选择好一台设备后,要连续传送完固定 K K K 个字节的成组数据后,才释放总线,通道再去选择下一台设备,再传送该设备 K K K 个字节。如此,以成组方式轮流交叉地为多台高速设备服务。某台设备要想传送 n n n 个字节,就需要先后经 ⌈ n / K ⌉ \left \lceil n/K \right \rceil n/K 次申请使用通道总线才行。
  选择通道每选择一台设备,就让该设备独占通道,将 n n n 个字节全部传送完后,才释放通道总线,又去选择下一台设备,再传送它的全部字节数据。因此,每台设备为传送 n n n 个字节数据只需一次申请使用通道总线。

4. 存储体系

4.1 存储体系的概念

(1)提出虚拟存储器的原因。(p101,简答题)
  虚拟存储器是从主存容量满足不了要求而提出来的。

4.2 虚拟存储器

(1)虚拟存储器的存储管理方式按存储映像算法不同,有 段式页式段页式 等。(p104,简答题)

(2)页式虚拟存储器页面失效和实页冲突发生的原因及所确定替换算法的依据。(p112,简答题)
  当处理机要用到的指令或数据不在主存中时,会发生页面失效
  当主存已满且发生页面失效时,会发生实页冲突
  替换算法的确定主要看主存是否有高的命中率、是否便于实现辅助软硬件成本是否低。

(3)虚拟存储器的等效访问速度受主存命中率和访问主存时间影响。主存命中率受页地址流页面调度策略替换算法页面大小分配给程序的页数 (主存容量) 等因素影响。(p119)

4.3 高速缓冲存储器

(1)Cache 全相联映像的概念及其优缺点。(p126,简答题)
  Cache 全相联映像是主存中任意一块都可映像装入 Cache 中的任意一块位置的地址映像。
  优点:块冲突概率最低,只有当 Cache 全部装满才可能出现块冲突,Cache 的空间利用率最高;
  缺点:要构成容量为 2 n c b 2^{n_{cb}} 2ncb 项的相联存储器的代价太大; Cache 容量很大时,其查表速度很难提高。

(2)组相联映像 指的是各组之间是 直接 映像,而组内各块之间是 全相联 映像。(p129)

(3)Cache 的写策略主要包括 写回法 (抵触修改法)写直达法 (存直达法) 两种。

4.4 Cache — 主存 — 辅存三级层次

4.5 主存保护

Guess you like

Origin blog.csdn.net/weixin_43605641/article/details/124553874