Table of contents
Explanation: This article is a compilation of some common questions after reading a series of interview-related materials. It is mainly aimed at professional questions and answers for the re-examination in the Computer Graduate Entrance Examination. Some of the answers are based on the Internet and combined with my own understanding. If there are any deficiencies, you are welcome to point them out , thank you! In the summary process, some answers did not mark the reference source. If you have any reference to your answer, please contact me, and I will make it up. Finally, I hope everyone can fight to become a master!
Retest content:
Computer graduate re-examination common interview questions - operating system_Sangongyanwu's Blog- CSDN
Blog Common Interview Questions - Data Structure
Computer Systems Overview
- Briefly describe the von Neumann machine
- It consists of five parts: arithmetic unit, memory, controller, input device and output device
- Instructions and data are stored in memory on an equal footing and are addressable by address
- Both instructions and data are represented in binary code
- Instructions consist of opcodes and address codes
- Instructions are stored sequentially in memory
- Early von Neumann machines were processor-centric (modern computers are memory-centric)
- MIPS、MFLOPS、GFLOPS和TFLOPS
MIPS (Million Instructions Per Second): How many millions of instructions are executed per second
MFLOPS (Mega Floating-point Operations Per Second): How many million floating-point operations are performed per second
GFLOPS: How many billion floating-point operations are performed per second
TFLOPS: How many trillion floating-point operations are performed per second
- Differences and connections among translators, assemblers, compilers, and interpreters
Translation program: translates high-level language source programs into machine language programs, including compilers and translation programs
Compiler: Translate all high-level language source programs into target programs at one time, and only need to execute the target program every time the program is executed.
Interpreter: Translate one of the source programs into the corresponding machine target code and execute it immediately, then translate the next source program statement and execute it.
Assembler: It is also a language translation program that translates an assembly language source program into a machine language program.
- The difference and connection between machine word length, instruction word length and storage word length
Machine word length: The number of bits of binary data that the computer can directly process is generally equal to the size of the internal register, which determines the accuracy of the operation
Instruction word length: the number of bits of binary code contained in an instruction word
Storage word length: the length of the binary code stored in a storage unit
Storage System
- The principle and difference between RAM and ROM (there is an essential difference in the basic storage unit)
RAM: random access memory, generally divided into bistable flip-flops (SRAM) and capacitors (DRAM)
SRAM DRAM store information trigger capacitance destructive readout No yes need to refresh don't want need Send row and column address Send at the same time send in two running speed fast (no need to rewrite) slow (needs to be rewritten) Integration Low high storage cost high Low The main purpose Cache cache host memory ROM: read-only-memory read-only memory, which supports random access. Once there is information in ROM, it cannot be easily changed. It is generally used to store fixed programs and store various constants and function tables. Even if the power is off, it will not be lost. It is only a memory for reading in the computer. It has the following characteristics:
1. The structure is simple, so the bit density is higher than that of the readable and writable memory
2. It is non-volatile, so it has high reliability
- Types of ROMs
Mask mode ROM: one-time program solidified by the manufacturer, not rewritable
Programmable ROM (PROM): It does not have a program itself, allowing the user to perform a one-time erasing and writing operation
Rewritable and programmable ROM: by ultraviolet erasing (EPROM), electrical erasing (EEPROM) and Yamamura FLASH
- What is temporal locality and what is spatial locality?
Temporal locality: refers to the information that will be used in the near future, and it is likely to be the information that is being used now.
Spatial locality: Refers to the information to be used in the near future, which is likely to be adjacent to the information currently in use in storage space.
- What is Cache, why is Cache used, and what is its principle?
Cache is a high-speed cache memory, and it is limited to improve the bandwidth of the main memory system solely by relying on the parallel main memory system. This requires changes in the system structure, so Cache is introduced. The high-speed and small-capacity memory between the central processing unit and the main memory has a small capacity, but the speed is much faster than the main memory, close to the speed of the CPU. Cache is composed of SRAM, using the principle of locality of program access to improve execution speed.
- Cache has several mapping methods
- direct mapping
- fully associative map
- set associative map
Main memory block replacement algorithm in Cache:
- random algorithm
- first in first out algorithm
- Least Recently Used Algorithm
- Least Frequently Used Algorithm
Cache write strategy:
Full write method: When the CPU writes a hit to the Cache, the data must be written to the Cache and main memory at the same time.
Write-back method: When the CPU writes a hit to the Cache, only the content of the Cache is modified, and not written to the main memory immediately, and only when the memory block is swapped out is it written to the main memory
command system
- Common Data Addressing Modes
addressing mode valid address Number of memory accesses implicit addressing program specific 0 address immediately A is the operand 0 direct addressing EA=A 1 an indirect addressing EA=(A) 2 register addressing EA=Ri 0 register indirect once addressing EA=(Ri) 1 relative addressing EA=(PC)+A 1 base addressing EA=(BR)+A 1 indexed addressing EA=(IX)+A 1
- Comparison between CISC and RISC
CISC RISC command system complex, huge simple, streamlined number of instructions Generally > 200 pieces Generally <100 pieces instruction word length not fixed Fixed length Accessible instructions no limit Only Load/Store instructions Execution time of various instructions big difference Most are completed in one cycle Number of general purpose registers less many Frequency of use of various commands A big difference are more commonly used object code Difficulty generating efficient object code programs Generated code is more efficient control method The vast majority are for microprogram control Most of them are combinatorial logic control instruction pipeline can be achieved in a certain way must be achieved
CPU
- Microprogrammed Controllers vs. Hardwired Controllers
microcontroller hardwired controller working principle The micro-operation control signal is stored in the control memory in the form of a micro-program , which can be read out when the instruction is executed The micro-operation control signal is generated instantly by the combinational logic circuit according to the current instruction code, state and timing execution speed slow quick regularity more regular Irregular, cumbersome Applications CISC CPU RISC CPU
易扩充性 易扩充修改 困难
- 南桥芯片、北桥芯片
南桥芯片和北桥芯片的统称就是芯片组
北桥芯片:负责与CPU的联系并控制内存,位置山离CPU近
南桥芯片:负责I/O总线之间的通信,位置上离CPU远
- 指令执行过程中指令周期都有哪些阶段
取值周期:根据PC中的内容去除指令代码并存放在IR中
间址周期:取操作数有效地址
执行周期:根据指令字的操作码和操作数执行相应操作
中断周期:处理中断处理
- 影响指令流水线的影响因素
结构相关:由于多条指令在同一时刻争用同一资源而形成的冲突
数据相关:必须等前一条指令执行完才能执行后一条指令的情况
控制相关:遇到转移指令和其他改变PC值的指令而造成断流
总线
- 总线仲裁方式
集中仲裁方式:包括链式查询方式、计数器定时查询方式、独立请求方式
分布式仲裁:不需要中央仲裁器,每个潜在主模块都有自己的仲裁号和仲裁器
- 串行接口,并行接口
串行:数据一位位地顺序传输,其特点是通信线路简单,只要一对传输线就可以实现双向通信,从而降低成本,特别适合远距离通信,但传输速率慢
常见协议:USB,SATA接口、PCI-Express等
并行:数据的各位同时传输,其特点是传输速率快,但当传输距离远,位数又多的时候,会导致通信线路复杂和提高成本。
常见协议:PCI、AGP、VESA等
输入/输出系统
- I/O控制方式
1.程序查询方式
2.程序中断方式
3.DMA方式
4.通道方式
5.I/O处理及
- 中断的概念
指当出现需要时,CPU停止当前程序的执行转而执行处理新情况的程序和执行过程。
有些不可屏蔽中断是可以打断其他中断的,比如说掉电、复位等
- 中断处理过程
关中断——保存断电——中断服务程序寻址——保存现场和屏蔽字——开中断——执行中断服务程序——关中断——恢复现场和屏蔽字——开中断——中断返回
- 什么是中断向量,中断向量地址
中断向量是中断服务程序的入口地址
中断向量地址是指中断服务程序的入口地址的地址
- DMA方式是什么
It is a control method in which group information transmission is completely performed by hardware. A "direct data path" is opened between peripherals and memory, and information transmission does not pass through the CPU, which reduces the CPU's overhead when transmitting data.
- The difference between DMA mode and interrupt mode
1. The interrupt mode is program switching, which needs to protect and restore the scene. In addition to pre-processing and post-processing, DMA does not occupy CPU resources at other times.
2. The response time to the interrupt request can only occur when each instruction is executed, while the DMA request can occur at the end of each machine cycle
3. The interrupt transfer process requires CPU intervention; and the DMA transfer process does not require CPU intervention, so it is suitable for high-speed peripheral group data transfer
4. DMA requests have higher priority than interrupts
5. The interrupt method has the ability to handle abnormal events, while the DMA method is limited to the I/O operation of transferring data blocks
6. From the point of view of the data transmission method, the interrupt method is transmitted by the program, while the DMA method is transmitted by the hardware.