Computer Basics - An Overview of Computers

1. The history of computer development

1.1. The first generation of computers

   The first generation of computers - electronic tube computers (1945~1957).

   When it comes to tube computers, one has to mention the birth of diodes. When we were in junior high or high school, we were exposed to relevant knowledge such as current, voltage, and resistance. Before understanding diodes, we first understand a few basic concepts.

1.1.1, current, voltage, resistance

   In other words, Newton discovered gravitation a long time ago, which was first proposed in the book "Mathematical Principles of Natural Philosophy" published in 1687. However, the cause of gravity is never mentioned in his works.

    Gravity is produced by matter with mass, and matter is composed of atoms, which are the basic units of all elements of matter, and atoms are composed of nuclei (protons, neutrons) and electrons (negatively charged) that revolve around them at high speed.

   Current is generated by the directional movement of charges (positive/negative particles, opposites attract, same repel) . The energy field generated by the movement of charges is called the Coulomb electric field (the one generated by the changing magnetic field is called the induced electric field). Just like the batteries in our daily life, a large number of positive and negative charges have accumulated at both ends of the battery (positive (high potential) -> negative (low potential), this potential difference, also known as voltage), their electric field (potential difference) is the mysterious force that drives the charge to move . The electrons in the substance in this electric field will form an electric current.

   So why do different substances conduct electricity differently? Such as metal and wood, this is because the atomic nuclei of different substances bind differently to the electrons outside the nucleus. As long as a slight electric field force is applied at both ends of the metal, the electrons will easily break free from the constraints of the atomic nucleus to form a stable current. The resistance of atomic nuclei to electric current is what we call resistance .

   Ampere's Law : It is an electromagnetic law, which expresses the relationship between the current and the direction of the magnetic induction line of the magnetic field excited by the current, also known as the right-hand spiral rule.

   Ohm's law : German physicist George Simon Ohm published in April 1826 the paper "Determination of the Law of Metal Conduction". In the same circuit, the current passing through a conductor is proportional to the voltage across the conductor and inversely proportional to the resistance of the conductor (I=\frac{U}{R} ).

   Joule's Law : The heat generated by the current passing through the conductor is proportional to the square of the current, proportional to the resistance of the conductor, and proportional to the electrification time (Q={I^2Rt}). This is also the reason why a short circuit will generate heat or even catch fire. The greater the current, the more obvious the heat.

1.1.2, the birth of electron tube

   In 1877, after Edison invented the carbon filament electric lamp, the service life of the carbon filament lamp was not long because the carbon filament was difficult to withstand the high temperature of the electric fire. Edison tried every means to improve it. In 1883, he had a whim: placing a copper sheet in the vacuum bulb may prevent the carbon filament from evaporating and prolong the life of the bulb. However, he found a very strange phenomenon, the copper sheet was not directly connected to the circuit but generated current. This is an incredible thing. Sensitive Edison affirmed that this was a new discovery, and thought that it might be possible to make practical electrical appliances such as ammeters and voltmeters based on this discovery. For this reason, he applied for a patent, named it " Edison Effect ", and did not conduct in-depth research.

   In 1884, Edison showed the "Edison effect" to a British physicist Fleming, but all of this was seen by Fleming.

   In 1896, the Marconi Wireless Telegraph Company was established, and Fleming was hired as a consultant. When researching and improving wireless telegraph receivers, the Edison effect appeared. He took Edison's baton and carefully studied this phenomenon. He found that the Edison effect is actually very simple. After the bulb is powered on, the filament emits heat and enters an incandescent state.

   If the metal piece is negatively charged (opposites repel), the electrons are blocked and no current flows. When alternating current is passed through the device, it is converted to direct current (only one-way flow). Fleming called this tube with two electrodes a vacuum diode, so the world's first diode was born. And on November 16, 1904, it was patented in the UK.

   再后来也就是“无线电之父”——李·德弗雷斯特,将Z型导线装入真空管内之后,只要把一个微弱的变化电压加在它的身上,就能在金属屏板上接收到更大的变化电流,其变化的规律完全一致——德弗雷斯特发现的正是电子管的“放大”作用。

   接着,他又把导线改用像栅栏形式的金属网,于是,他的电子管就有了三个“极”——丝极、屏极和栅级,其中那个栅极承担着控制放大电信号的任务,无线电就能实现更远距离的传输。1907年,德弗雷斯特向美国专利局申报了真空三极管(电子管)的发明专利。

   二战期间,美国和德国都需要精密的计算工具来计算弹道和破解电报获取情报,但是这个计算非常复杂,耗时又耗力,在战争期间,时间就是胜利,在当时的大环境下以及美军的资助下,宾夕法尼亚大学的William Mauchley和他的学生J.Presper Eckert建造了ENIAC,1946年2月,世界上第一台通用电子数字计算机“埃尼阿克”(ENIAC)在美国研制成功。将计算弹道的时间缩短至30秒内,它由17468个电子个电子管组成,是一台又大又笨重的机器,体重达30多吨,占地有两三间教室般大。ENIAC是通过用真空三极管让计算机通过控制栅极电流,效率是机电计算机的上千倍。

  第一代电子管计算机(真空电子管计算机),主要用于军事研究和科学计算,但存在很多的毛病,但凡有一个真空管烧坏了机器就不能运行,必须人为的把烧坏的真空管找出来,所以制造、维护、使用都非常困难。

1.2、第二代计算机

   第二代计算机——晶体管和大型机(1958年~1963年)。

   由于电子管体型较大,且功耗极高,电子管容易烧毁而失效。终不能适应微电子信息化发展,于是就出现了晶体管。

   In 1945, Shockley began using semiconductors to develop a new electronic amplifier. Semiconductor materials are not conductive enough to be a conductor, but not insulating enough to be an insulator (silicon, germanium, and gallium nitride [a new generation of semiconductor materials other than silicon] have four outermost electrons). The clever but indifferent Shockley chose to work from home, leaving colleagues Walter Bratton and John Bardeen free to conduct experiments at Bell Laboratories in New Jersey.

   In 1946, the famous computer pioneer Grace Heber used the word in an interesting way in the log. When the operator used the MarkII and MarkIII computers, an error occurred because a moth got stuck in the relay, so he used it.

   In November 1947, an accidental discovery by Bratton gave theoretical physicist Bardeen a crucial new understanding of the behavior of electric currents on the surface of semiconductors. Bratton cobbled together an amplifier out of plastic, gold leaf, and the semiconductor germanium, and tested it. The amplifier was successful, able to control huge currents with very small input voltages. This is the first transistor in history.

   But it wasn't until Shockley improved the design in 1951 that people realized its importance, and later the triode NPN appeared.

   In 1954, Bell Laboratories in the United States developed the first computer using transistor circuits, named "TRADIC", which was equipped with 800 transistors.

   More transistor computers followed in the 1950s and 1960s. A key advantage of transistor computers is their small size, which makes them more compact than vacuum tube computers.

   In 1956, Shockley, Bardeen and Bratton shared the Nobel Prize in Physics.

   In 1958, IBM made the RCA501, the first computer that used all transistors . The second generation of computers has officially entered the stage. Compared with electronic tubes, transistors are smaller in size, and have a very low operating voltage, longer life, and higher efficiency.

   Second-generation computers are mainly used for scientific and engineering calculations, such as solving partial calculus equations, mostly using FORTRAN language, assembly language and IBSYS system.

1.3, the third generation computer

   The third generation of computers - integrated circuits (IC) and minicomputers (1964~1970).

   In 1958, Texas Instruments and Fairchild successively developed the integrated circuit IC, which used a certain process technology to interconnect (package) the transistors, diodes, resistors, capacitors, inductors and other components required in a circuit together (packaging).

   With the invention of semiconductor microchips (that is, silicon wafers) and the rapid development of integrated circuits , the birth of the third generation of electronic computers has also been promoted.

   In 1964, IBM Corporation of the United States launched the IBM-360 computer using integrated circuits, marking the advent of the third generation of computers. The third generation of electronic computers manufactured with medium and small-scale integrated circuits began to appear.

    Although the earliest integrated circuits used in third-generation computers integrated dozens of triodes, resistors and other components, even LSI (large-scale integrated circuits) could only integrate about 1,000. Compared with the printed circuit boards of about 10 cm in second-generation computers, the same function can be achieved by only 1 mm.

   In 1965, in order to allow more people to use computers, MIT, Bell Labs and General Electric jointly developed the time-sharing multitasking operating system Multics (the predecessor of UNIX). Later, because Multics was too difficult, the project progressed slowly.

1.4, the fourth generation computer

   The fourth generation of computers - personal computers and mobile terminals (VLSI-Very Large Scale Integrated Circuits, 1971~present).

   In 1971, Intel developed the MCS-4 microcomputer, a four-bit computer with a CPU of 4040. Subsequently, Intel launched the MCS-80 type-an eight-bit computer with a CPU of 8080.

   From 1978 to 1983, sixteen-bit microcomputers began to flourish. The peak products of this period were Apple's Macintosh and IBM's PC/AT286 microcomputers.

   After Goug Engelbart invented the graphical user interface, Apple discovered the potential value of GUI, so it designed an Apple computer with GUI, but due to Apple's closed market strategy, it was not compatible with other PCs. This makes Apple miss a good opportunity to dominate the global PC.

   1981年,IBM设计了IBM PC找到Bill Gates,希望Bill Gates能提供操作系统(Bill Gates购买了DOS系统),IBM PC配合Intel CPU和DOS在市场中得到广泛应用。

   1985年,微软推出了第一版的Microsoft Windows;

   1995年,发布了Windows 95,是一个混合的16位/32位Windows系统。

   1998年,Windows 98发行,底层仍大量使用16位的Intel汇编语言。

   2000年,Windows NT和Windows 2000的失败让微软发布了Windows 98的另一个版本,名为Windows Me。

   2001年,微软发布了Windows 2000的一个升级版称为Windows XP,基本替代了Windows所有的原先版本。

   2007年,Windows Vista于1月30日正式发行,这是Windows版本历史上间隔时间最久的一次发布。

   2009年,Windows 7发布,该操作系统就受到了外界的一致好评。

   2012年,Windows 8正式推出,然而,由于Windows 8的用户界面过于复杂受到了外界不少的批评。

   2015年,微软发布Windows 10正式版。

   2021年,6月24日,微软发布了Windows 11,并且在10月5日正式发行;

2、计算机的体系结构

2.1、冯·诺伊曼体系结构

2.1.1、冯·诺伊曼精彩的一生

   冯·诺依曼,计算机科学家、物理学家,20世纪最重要的数学家之一。他在现代计算机、博弈论、核武器和生化武器等领域内的科学全才之一,被后人称为“现代计算机之父”、“博弈论之父”。

   他从小就在数学领域有着惊人的天赋。六岁时,就能心算做八位数除法,八岁时掌握微积分。十二岁就读懂领会了波莱尔的大作《函数论》要义。在17岁那年,他发表了第一篇数学论文。

   但是,他的父母觉得研究数学,并不赚钱,于是希望冯·诺依曼放弃数学(因为那个时候,化学领域比较挣钱,当时的诺贝尔家族便是如此)。后来冯·诺依曼与父母达成了一个协议,就是同时注册三所大学,完成三所大学的学业。于是他开始在苏黎世联邦理工学院学习化学工程,同时每天晚上还完成柏林大学数学专业的作业。

   1926年,年仅22岁的他获得苏黎世联邦工业大学化学学位,还通过了布达佩斯大学大卫-希尔伯特坐镇的数学博士答辩。

   1927-1929年冯·诺依曼相继在柏林大学和汉堡大学担任数学讲师,从此到美国定居,期间运用数学知识为量子力学提供数学模型,又使他在理论物理学领域占据了突出的地位;

   1930年接受了普林斯顿大学客座教授的职位;

   1931年,他成为普林斯顿大学终身教授;

   1933年,转入普林斯顿高等研究院,和爱因斯坦、数学家维布伦、数学家亚历山大一起成了高等研究院最初任命的四位教授(冯·诺依曼是教授里最年轻的一位),并在这里工作了一生。

   后来有个人叫图灵,他想象着一种虚构的“图灵机”来证明希尔伯特的第三个命题。他的导师推荐图灵去普林斯顿大学,做阿隆佐·邱奇的博士生。

   1936年9月,图灵应邀来到普林斯顿高等研究院学习。图灵的论文一发表,敏锐的冯·诺伊曼已经嗅到了图灵机广阔的远景。后来他的研究重点有两项,一是“精细内存”,二是“二进制”。他把存储程序当成数学来对待。

   1944年,戈德斯坦偶遇冯·诺依曼,并向他透露摩尔工程学院电子计算机课题及研究进展。

   在ENIAC(电子数字积分和计算机)尚未投入运行前,冯·诺依曼被ENIAC项目吸引,意识到了大幅提高计算能力的必要性,就已开始准备对这台电子计算机进行脱胎换的改造。在短短10个月里,冯·诺依曼迅速把概念变成了方案。新机器方案命名为“离散变量自动电子计算机”,英文缩写EDVAC。

   In June 1945, von Neumann, Goldstein, Birx and others jointly published a 101-page report, which is the famous "101-page report" in the history of computers. This is the famous "Draft Report on EDVAC (Discrete Variable Automatic Electronic Computer)". This report is a landmark document in the history of modern computer science. It clearly stipulates that binary is used to replace decimal operations. The report mentions the advantages of binary and predicts that the use of binary will greatly simplify the logic circuit of the machine. And divide the computer into five major components (calculator, logic control device, memory, input and output devices), this excellent idea laid the foundation for the logical structure design of electronic computers.

   Here you may ask, why use binary? Is it non-binary?

   It's not that non-binary, different voltages can indeed represent different numbers. As the number of times a device is used increases, and it is affected by external noise and other environments, the accuracy of voltage storage will deteriorate, and ambiguous voltages may appear, causing deviations in results. In binary, there are only two results, on and off, which determine the advantages of binary in terms of stability and complexity.

   On February 14, 1946, the world's first general-purpose computer ENIAC (decimal system, a computer with separate programs and calculations, developed by Mauchly and Eckert of the Moore School of Engineering, University of Pennsylvania) was officially announced at the University of Pennsylvania.

   Its successor, EDVAC, was designed with binary and von Neumann structured computers. (EDVAC was delivered to the Ballistic Research Laboratory in August 1949, and EDVAC did not start operation until 1951. The reason for the delay was that Mauchly and Eckert left from the University of Pennsylvania, began to form an electronic computer company and took away most of the senior engineers. EDVAC efficiency is hundreds of times higher than ENIAC. It only uses 3563 electron tubes and 10,000 crystal diodes, and 1024 mercury delay lines to store programs and data. The power consumption and floor space are only ENIA one-third of C.)

   Later, many computers with von Neumann structure appeared, including MANIAC (Mathematical Analysis Numerical Integral Computer) developed by Los Alamos National Laboratory, ILLAC manufactured by the University of Illinois, and so on.

   And von Neumann was hired as a scientific consultant of IBM Corporation, helping the company to give birth to the first stored-program computer, IBM 701, which was officially released in 1952. It was IBM's first commercial scientific computer.

2.1.2. Overview of Von Neumann Architecture

   The von Neumann architecture reimagines the computer as three independent systems, a memory for storing data and instructions, a central processing unit for decoding and executing instructions, and a set of input and output interfaces, including five major components: arithmetic unit, controller, memory, input and output devices .

1) Input device: receive the original data and program input by the user, and convert it into binary and store it in the memory; (I: input)  

2) Memory: mainly used to store data and programs; (M: memory)

3) Output device: convert the data stored in the memory into an easily understandable form of expression; (O: output)

4) Calculator: arithmetic operation + logic operation; (ALU: Arithmetic And Logic Unit)

5) Controller: The command center of the computer. (CU: Control Unit)

   Von Neumann's architecture separates the unit that processes information (CPU) from the unit that stores information (ie, memory), and allows data and instructions to be stored and addressed in the same way in memory .

   The architecture also introduces the concept of an instruction cycle: the sum of the time it takes for the CPU to fetch an instruction from memory and execute it . The reciprocal of the cycle time - the number of jobs that can be performed in 1 second is called the clock frequency. The reason why the computer can automatically complete the work is because the CPU can repeatedly fetch and execute instructions from the memory to form a closed loop (fetching instructions, decoding instructions, executing instructions, and fetching the next instruction).

   In the instruction fetching stage, the instruction is placed in the register. In fact, the process of fetching the instruction through the PC register and the instruction register is operated by the controller, and the decoding process of the instruction is also operated by the controller. Once it comes to the stage of executing instructions, whether it is R-type instructions for arithmetic operations and logical operations, or I-type instructions for data transmission and conditional branches, they are all operated by the arithmetic logic unit, that is, processed by the arithmetic unit.

   With the continuous development of computer technology, modern computers have many improvements in structure compared with early von Neumann computers, but current computers are mainly designed based on von Neumann architecture. (About computer structure system and Harvard structure)

3. Computer system overview

3.1. Overview of the composition of the computer system

   We know that a computer system consists of two major parts: a hardware system and a software system ;

   Hardware system: refers to the physical objects that can be touched by hands. For example: the necessary hardware of a computer includes: motherboard, CPU, memory stick, graphics card, power supply, important hardware includes: CPU radiator, hard disk, etc.;

   Software system: software composed of programs with various special functions (the interface between the user and the hardware). The software system is further divided into system software and application software;

   1) System software: a system that controls and coordinates computers and external devices, and supports the development and operation of application software. The main function is to schedule, monitor and maintain computer systems.

   2) Application software: software developed for a specific purpose.

3.2、CPU

3.2.1. What is a CPU

   CPU (Central Processing Unit), that is, the central processing unit, consists of an arithmetic unit and a controller (of course, including several registers, cache memory, and the data, control, and state bus that realize the connection between them). It is the final execution unit of information processing and program operation, and controls and manages other hardware to a certain extent. Simply put, it is to operate according to our instructions or programming, and process the data in the computer software by analyzing computer instructions.

   Among them, the function of the controller is responsible for coordinating and controlling the instruction sequence of each component of the computer to execute the program, including fetching instructions, analyzing instructions and executing instructions; the function of the arithmetic unit is to process data.

3.2.2, the origin of CPU

   In January 1971, Intel's engineer Hoff invented the world's first commercial computer microprocessor 4004, making Intel a microprocessor company. Although this 4-bit microprocessor has only 45 instructions, it can only execute 50,000 instructions per second, and the frequency is only 108KHz, which is not even comparable to the world's first computer ENIAC. But its integration level is much higher, with 2,300 integrated transistors, and a piece of 4004 weighs less than a cup (28.350 grams). After using the 4004 chip, it is equipped with a program memory, data memory, shift register, plus a keyboard and digital tube to form a complete microcomputer. But the response of this chip is not very great, probably because of the limited processing power.

   In 1972, Intel launched the 8008 microprocessor. Intel also adopted the processor instruction technology for the first time on this microprocessor, making the performance of the 8008 twice that of the 4004, but the frequency is still conservatively set between 200-800KHz. The performance of the 8008 manufactured using a 10-micron process did not impress consumers.

   In 1974, the 8080 processor was released, and the 8080 had the honor of becoming the brain of the first personal computer Altair. Within a few months, the sales volume of Altair reached tens of thousands.

   In 1978, Intel launched the first 16-bit microprocessor-the 8086, which is the originator of the x86 architecture. In the same year, the 8088 processor with better performance was launched. The success of the 8088 made Intel rank among the Fortune 500.

   In 1982, the 80286 processor was released. Its address bus was extended to 24 bits, and it was also Intel's last 16-bit processor.

   In 1985, Intel released the first 32-bit X86 processor 80386, which integrated 275,000 transistors. The most critical feature was the use of a 32-bit address bus to support a maximum of 4GB of memory.

   In 1989, Intel released the 80486 processor, which integrated 1.25 million transistors, and the initial frequency of 80486 was 50MHz. The first level of cache appeared on the 80486. The early 80486 packaged an 8KB cache and used a 1000nm process. Intel has also integrated the FPU (Floating Point Unit).

    In 1993, Intel released the Pentium (Pentium) CPU. Pentium adopted the P5 architecture. Although it surpassed the 80486 in an all-round way, the most prominent progress was the improvement of the FPU. The size of the first-level cache is increased to 16KB.

   In 1995, Intel released the Pentium Pro (Pentium Pro).

   In 1997, Intel released the Pentium II (Pentium II). AMD and Cyrix also launched AMD K6-2 and Cyrix MII processors of the same grade.

   In 1999, Intel released the Celeron (Celeron) processor (initial) and the Pentium III (Pentium III) processor.

   In 2000, AMD took the lead in launching the 1GHz Athlon (Athlon K7) microprocessor, whose performance surpassed that of Pentium III. In November, Intel released the Pentium 4 processor, which uses a new Socket 423 architecture.

   In 2003, Intel released the Pentium M processor. And AMD released the desktop 64-bit Athlon 64 processor (K8 architecture)

   In 2004, AMD launched the Sempron (Sempron) processor, using Socket A interface.

   In 2005, Intel lost its mobile phone business, released a desktop 64-bit processor, and named it the 6XX series, namely Pentium 4 6XX. In April of the same year, the dual-core processor Pentium D (not supporting hyper-threading technology) and Pentium E (supporting hyper-threading technology) were released . AMD also released the dual-core Athlon 64 X2.

   In July 2006, Intel released a new generation of new micro-architecture desktop processor Core 2 duo (Core 2 Duo), its energy efficiency is 40% higher than the best Intel Pentium processor, and its power consumption is reduced by 40%.

   In November 2007, AMD released the Phenom processor series based on the new K10 architecture.

   2008-2009年,还是酷睿一代时期,Core i7 920作为第一代经典产品;2009年,Intel推出了采用LGA1156接口的i7/i5/i3处理器 ,开始首次将GPU与CPU封装进同一颗芯片之中,比如:i3-530。而AMD则发布双核(Sermpron)闪龙,在锐龙发布前这段时间,AMD始终在追赶Intel;

   2011年,Intel使用32nm工艺采用了i3、i5和i7的产品分级架构,其中i3主攻低端市场,采用双核处理器架构,约2MB二级缓存,i5处理器主攻主流市场,采用四核处理器架构,4MB二级缓存,i7主攻高端市场,采用四核八线程或六核十二线程架构,二级缓存不少于8MB,此时核芯显卡进入市场。而amd 发布基于Fusion(融聚)架构的APU(CPU+GPU)产品,A4,A6,A8(俗称推土机)。

   2012年,Intel发布了第三代Core i系列处理器,内部包含了图形核心、内存控制器、图形通道控制器和输入输出总线控制器,此时北桥也被集成到芯片,主板只有南桥,没有北桥。

   2013年,Intel进入第四代智能酷睿处理器,此时内存还是使用的DDR3;

   2015年,Intel进入第五代智能酷睿处理器、第六代酷睿桌面处理器,此时DDR4上市;

   2016年-第七代酷睿桌面处理器,开始了挤牙膏之旅,主要是对主频、核心数及线程数的提升;

   2017年-第八代酷睿桌面处理器;AMD发布了自己的锐龙系列;

   2018年-第九代酷睿桌面处理器;

   2020年-第十代酷睿桌面处理器;直到10月,AMD发布了锐龙5000系列,才逐渐扳回一点局面;

   2021年-第十一代酷睿桌面处理器;直到11月发布十二代酷睿桌面处理器有了较大的改善,支持DDR5;

3.1.3、CPU的组成概述

   当布尔代数在数字逻辑电路的分析和设计中得到了广泛的运用时,所有的电子元件被设计成只有两种状态开(1)、关(0),这大大简化了电路的设计。

   We said earlier that the birth of the transistor was the invention of this little thing that allowed three people (John Bardeen, William Shockley, and Walter Bratton) to win the Nobel Prize in Physics. With transistors, there are also switches, that is, logic gates (AND, OR, NOT) circuits can be designed. In discrete mathematics, there is a complete set of logic.

   The entire chip design is a process of turning parts into wholes. First, many transistors form logic gates, several logic gates form registers and combinational circuits, and many registers and combinational circuits form arithmetic circuits, control circuits, storage circuits, etc., and then many of these circuits form communication and computing modules, and these modules finally form a CPU chip .

   In the late 1990s, electronic science and technology achieved rapid development, especially with the widespread application of electronic computers and integrated circuits. The size of CPUs became smaller and smaller. The more transistors integrated on a CPU, the faster its processing efficiency and computing speed. From the 4004 processor released by Intel in 1971, which integrated 2,300 transistors, the number of transistors in the M-series chip (M1 Max) launched by Apple today has reached 57 billion.

   The main function of the CPU is to complete the functions of fetching instructions and executing instructions. These operations are mainly undertaken by arithmetic units and controllers .

   Of course, the CPU implementations of different manufacturers in different periods will be different. The main differences are reflected in the instruction set architecture, data path, and the implementation of the corresponding CPU controller. However, their design is not just pursuing the ultimate in performance, but a compromise and trade-off in performance and cost.

3.1.4. Composition of CPU - Arithmetic Unit

   The arithmetic unit is the processing center of the computer, mainly composed of arithmetic logic unit (ALU)/floating point operation unit (FPU) + general register group (ACC-accumulator, MQ is the multiplication quotient register, X is the operand register) + special register (PSW-status register). 

  • Arithmetic Logic Unit (ALU)

    It is based on a full adder, supplemented by a circuit composed of a shift register and corresponding control logic. Under the action of a control signal, it can complete fixed-point arithmetic operations (addition, subtraction, multiplication, division), logic operations (AND, NOR, XOR) and various displacement operations of binary data.

  • Floating Point Unit (FPU)

   Mainly responsible for floating-point operations and high-precision integer operations.

  • general purpose register

   It is used to save the operands participating in the operation and the intermediate results of the operation.

   ACC (Accumulator, accumulator): It is a general-purpose register that provides a work area for the ALU and can temporarily save an operand or operation result for the ALU.

   MQ (Multiplier-Quotient Register) is a multiplier-quotient register;

   X is the operand register;

  • Status Register (PSW)

   There may be different regulations in different machines. PSW is usually used to store two types of information, one is various state information of the current instruction execution result, such as whether there is a carry (CF bit), whether there is overflow (OF bit), the result is positive or negative (SF bit), whether the result is zero (ZF bit), parity flag (PF bit), etc.; the other is to store control information, such as enable interrupt (IF bit), trace flag (TF bit), etc.

3.1.5. Composition of CPU - Controller

   The controller is the command and control center of the entire CPU, which determines the automation of the computer calculation process. It must not only ensure the correct execution of the program, but also be able to handle abnormal events. The controller generally includes a program counter (PC), an instruction register (IR), an instruction decoder (ID), a timing controller, a bus controller, and an interrupt controller.

  • Program Counter (PC)

   The program counter (Program Counter, PC) is used to point out the address of the next instruction in the main memory. When executing an instruction, the processor first needs to fetch the address of the instruction in the memory from the PC, and obtain it through address bus addressing. When executing an instruction, the CPU can automatically increment the content of the PC. If it is a single-word instruction, then (PC)+1, if it is a double-word instruction, then (PC)+2.

  • Instruction Register (IR)

   The instruction register (Instruction Register, IR) is used to save an instruction currently being executed.

  • Instruction Decoder (ID)

   The instruction decoder (Instruction Decoder, ID) is to decode the operation code part of the instruction register to generate the control potential of the operation required by the instruction, and send it to the micro-operation control circuit, under the action of the timing signal of the sequential component, a specific operation control signal is generated.

  • command controller

   It mainly completes the operations of fetching instructions, analyzing instructions and executing instructions.

  • Timing controller

   The timing controller is mainly to provide the proper control signal for each instruction in time sequence.

   The timing controller includes a clock generator and a frequency multiplication definition unit. Among them, the clock generator sends a stable pulse signal from the quartz crystal oscillator, that is, the main frequency of the CPU; and the frequency multiplication definition unit defines how many times the main frequency of the CPU is the memory frequency (or bus frequency). In the early days, CPU and memory speeds were not much different, so CPU cycles were usually the same as memory access cycles. Later, with the development of the CPU, the speed is much higher than that of the memory, so the CPU cycle is often defined as a fraction of the memory access cycle.

  • bus controller

   The bus controller is to manage the use of the bus, including the management of the devices on the bus and the process management of the devices using the bus. As far as the CPU is concerned, it is generally divided into an internal bus and an external bus for the CPU to communicate with the outside world. External bus is also called system bus, including address bus, data bus, control bus, etc.

  • interrupt controller

   Due to abnormal events or random events that need to be handled immediately, the computer temporarily stops the current execution, turns to another service program to process the current event, and returns to the original program after processing.

Note: Interrupts generated inside the machine are called traps (internal interrupts), and interrupts caused by external devices are called external interrupts.

3.1.6. Composition of CPU - registers

   In addition to the accumulation register (ACC), status register (PSW), program counter (PC), and instruction register (IR) introduced earlier, there are also address registers (AR) and data registers (DR).

  • Address Register (AR)

   The address register (Address Register, AR) is used to save the address of the main memory unit currently accessed by the CPU.

   Since there is a difference in operating speed between the main memory and the CPU, address registers must be used to temporarily save the address information of the main memory until the access operation of the main memory is completed.

  • Data Register (DR)

   The data register (Data Register, DR), also known as the data buffer register, is used to temporarily store an instruction or a data word read from the main memory; conversely, when an instruction or a data word is stored in the main memory, they are also temporarily stored in the data register.

   Its main function is to serve as a transfer station for information transmission between the CPU, main memory, and peripherals to make up for the difference in operating speed between the CPU, main memory, and peripherals.

   Note: You need to understand the overall operating process of the CPU, and there are still many things to learn, such as the composition of instructions (CISC and RISC instruction systems), addressing methods of instructions and data, instruction cycles, instruction pipelines, assembly language and other knowledge.

3.1.7. Composition of CPU - bus

   The bus is actually a group of wires, which are information transmission lines connecting various components, and are used as a common path for information transmission of various components of the computer.

3.1.7.1, bus classification

   According to its location and function, the bus can be divided into: 

1) On-chip bus

   It is a bus between the unit circuits inside the chip, and serves as an information channel between these unit circuits. Such as the bus between components such as the CPU's internal ALU, register set, and controller.

   Common on-chip buses include: AMBA bus-(Advanced Microcontroller Bus Architecture-Advanced Microcontroller Bus Architecture), IBM's CoreConnect bus, etc.

2) System bus

   Also called the board-level bus, it refers to the information transmission line between the components of the CPU, main memory, and I/O devices (through the I/O interface). The computer bus we often refer to refers to the system bus. The system bus is an information channel connecting various plug-in boards in a multi-processor system and a high-performance supercomputer system, and is used to support parallel processing of multiple CPUs. The system bus can be divided into functions: data bus, address bus, and control bus.

   Data bus: used to transmit data information;

   Address bus: used to transmit address information issued by the CPU;

   Control bus: transmit control signals, timing signals and status information, etc.

3) Local bus

   The local bus refers to the common path connecting each main module of the motherboard on the printed circuit board. There are multiple slots arranged side by side on the motherboard of the computer system, which is the local bus expansion slot.

   The currently implemented local buses can be divided into dedicated local buses, VESA local buses and PCI local buses.

4) External bus

   Also known as the communication bus, it is used for communication between computer systems and systems; computer systems and external devices, such as printers, disk devices; computer systems and instruments.

   The common ones are USB (Universal Serial Bus-Universal Serial Bus), SATA (Serial Advanced Technology Attachment-Serial Advanced Technology Attachment), SPI (Serial Peripheral Interface-Serial Peripheral Interface), I2C (Inter-Integrated Circuit-two-wire serial bus), UART (Universal Asynchronous Receiver/Transmitter-Universal Asynchronous Receiver Transmitter).

3.1.7.2, bus performance index

   Before understanding the performance indicators of the bus, let's first understand what is called clock frequency, clock cycle, machine cycle and instruction cycle.

  • Clock frequency

   Contemporary computers usually use a quartz crystal oscillator (referred to as a crystal oscillator, usually determined by the motherboard) to convert our alternating current into a precise and stable clock signal, and our clock frequency is the number of times the crystal oscillator oscillates in one second, usually in MHz or GHz .

  • clock cycle

   The clock cycle is the reciprocal of the main frequency, sometimes called a beat (pulse), that is, one pulse represents one clock cycle. It is the most basic and smallest unit of time in a computer , and the computer can only complete one "micro-operation" or several compatible micro-operations in one clock cycle.

   For example: the clock period of 1GHz is f=1/1GHz=1ns, then the turbo frequency is 3.2GHz, and the clock period is 0.3125ns.

  • machine cycle

   In a computer, in order to facilitate management, the execution process of an instruction is often divided into several stages (such as fetching, decoding, executing, etc.), and each stage completes a basic operation. The time required to complete a basic operation is called a machine cycle. In general, a machine cycle is composed of several clock cycles (the machine cycle is artificially specified, and is actually the division of an instruction execution process stage).

  • instruction cycle

   The total time required to execute an instruction.

1) The transmission cycle of the bus

   The time required for a bus operation, and this time may be N clock cycles.

2) The operating frequency of the bus

   The operating frequency of the bus is the reciprocal of the bus cycle. That is, the working frequency of the bus = clock frequency/N.

3) Bus width

   The bus width, also known as the bit width of the bus, is the number of data bits that can be transmitted on the bus at the same time, that is, the number of so-called 8-bit, 16-bit, 32-bit or 64-bit data signals.

4) Bus bandwidth

   Bus bandwidth refers to the data transmission rate of the bus, that is, the number of bits of data that can be transmitted on the bus per unit time, usually measured by the number of bytes of information transmitted per second, and the unit can be expressed in (B/s). Bus bandwidth = bus operating frequency × (bus width/8) .

Note: The reason for dividing by 8 is because the unit of bandwidth is represented by (B/s), "B" stands for Byte-byte, 1Byte=8bit.

For example: Assuming that a system bus transmits 4 bytes of information in parallel in one bus cycle, one bus cycle takes up 2 clock cycles, and the bus clock frequency is 20MHz, what is the bus bandwidth?

The transmission cycle of the bus =\frac{1}{20MHz}*2=0.1μs=10^{-7}s

Bus bandwidth = bus operating frequency × (bus width/8) =\frac{4B}{10^{-7}s}=40MB/s

3.3 Main board

3.3.1. What is a motherboard

   The motherboard is one of the most basic and important components of a computer. The motherboard is generally a rectangular PCB printed circuit board, on which are installed the main circuit systems that make up the computer. Generally, there are BIOS chips, I/O control chips, (keyboard, COM, USB, MIDI, IDE, SATA, etc.) interfaces, indicator light connectors, expansion slots (memory slots, PCI slots, AGP slots) and other components.

   The core of the motherboard is the motherboard chipset, which determines the specifications, performance and general functions of the motherboard.

   Intel chipsets: H-series (low-end entry-level motherboards), B-series (mid-range), Z-series (high-end);

   AMD chipsets: A-series (low-end), B-series (mid-range), X-series (high-end), TRX40 (top-end);

3.3.2. Introduction to Chipset Structure - Origin of Chipset

   Earlier we learned about the development history of the CPU. In the early 4004 processor era, the functions of the processor were relatively simple, mainly to expand the basic computing functions of the processor;

   In 1972, Intel launched the 8008 microprocessor. Intel equipped this microprocessor with a very rich chip, including a series of chipsets such as the 8228/8238 system controller, 8257 programmable DMA controller, and 8259 interrupt controller. It also adopted the processor's instruction technology for the first time;

   In 1978, Intel launched the first 16-bit microprocessor - 8086, which is the originator of the x86 architecture; later, in the 80186 processor, Intel integrated the DMA controller inside the processor;

   In 1982, the 80286 processor was released, and its address bus was extended to 24 bits;

   In 1985, Intel released the first 32-bit X86 processor 80386, the most critical feature of which is the use of a 32-bit address bus to support a maximum of 4GB of memory;

   In 1989, Intel released the 80486 processor. The chip set and the processor have undergone great changes in hardware design logic; the first level of cache appeared on the 80486, and Intel also integrated the FPU (floating point unit);

   With the opening of the 486 era, Intel began to enter the field of chipsets and released the first chipset in Intel's history, namely the Intel 420 series. Its first product is called 420TX, and it is also the first chipset provided by Intel to support PCI technology. The bus connected to the processor is FSB (front-side bus), and the frequency is 33MHz. Support FPM (Fast Page Mode, fast page mode) memory, the maximum supported capacity is 128MB. The South Bridge chip that matches it is SIO (Super I/O), which provides more ports for the motherboard. At this time, a complete "North Bridge" structure has not yet been formally formed. Until 1993, when Intel Pentium was born, Intel realized that although the performance of the processor was very strong, it would not work without a good chipset. It was precisely because of this that a generation of legendary chipsets was born: 430 series chipsets .

   In the 430 series chipset, the first bridge chip has become two, namely 82349HX North Bridge and 82371SB South Bridge . At this point, the chipset officially has the concept of north and south bridges . The north bridge is mainly responsible for high-speed data transmission between the main memory, CPU, and graphics card; while the south bridge is responsible for data transmission between low-speed devices such as disks, USB, and PCI .

3.3.3. Introduction to Chipset Structure - Evolution of North-South Bridge Architecture

   In 1997, Intel released the Pentium II (Pentium II), and equipped it with the Intel 440 series chipset, and the north and south bridge chips had to be standardized a lot.

   In 1999, in the era of Pentium III, Intel also officially released the Intel 810 chipset, which installed the Intel i752 integrated graphics card into the north bridge for the first time, and also integrated the network card and AC97 sound card module in the south bridge for the first time.

   In 2000, the Pentium 4 south bridge chip was upgraded to ICH4, and the memory controller of the north bridge also supported DDR memory; in the later period of Pentium 4, the ICH6 series south bridge chip supported SATA technology;

   In 2006, after Intel launched the Core 2 series processors, Intel officially abandoned DDR memory and made it only support DDR2 memory. At this time, the memory controller of Intel processors was still in the north bridge chip; this is also the popular graphics card slot standard during this period, which allows graphics cards to have faster data transmission speeds;

   In 2008, Intel launched the X48 chipset. The front-side bus officially supports a rate of 1600MT/s, and the memory support can also reach DDR3 1600. The chipset of this generation of Southbridge is upgraded to ICH10 again, supporting 6 SATA 3Gb/s interfaces and 12 USB 2.0 interfaces. This can also be regarded as the final version of the ICH series Southbridge chips;

   In 2009, the Core i series processors came out, and the north bridge was also integrated into the CPU. The original south bridge was also renamed PCH (platform controller).

3.4, memory

3.4.1, what is memory

   Memory is used to store computer information.

   Memory is divided according to the way it works: it can be divided into read-only memory (ROM) and random access memory (RAM).

   The memory is divided according to its function: it can be divided into internal memory and external memory ;

3.4.2. ROM-Introduction

   The early ROM is a solid-state semiconductor memory that can only read out the data stored in advance. Because the technology is immature, it cannot be erased and written. After leaving the factory, it can only read the data, so it is called a read-only memory . Most read-only memories are made of metal-oxide-semiconductor MOS (floating gate field) effect transistors, which can retain electrons for a long time even when the power is turned off, theoretically up to ten years or more. It is often used for booting in computers (when the computer is turned on, the CPU gets power and starts to execute instructions, but because it has just been turned on, the RAM is still empty, and there are no instructions that need to be executed, so it is necessary to save a small instruction set called BIOS in the ROM, which tells the operating system how to access the disk drive).

   In the early days, our main storage media were magnetic storage , that is, magnetic disks, which were divided into floppy disks, optical disks (laser irradiated the aluminum film on the optical disk to etch) and (mechanical) hard disks. They all store information in a different state, for example: whether the hard disk has a magnetic field, or whether the optical disc has etched marks to record 0 and 1.

   Floppy Disk (Floppy Disk) : It is the earliest mobile media used in personal computers (PC). The reading and writing of floppy disks is done through floppy disk drives. This is why the operating systems we see now all use the C drive as the beginning of the hard disk partition.

   Optical disc (Optical disc) : Invented by American inventor James Russell in 1965, it can store multimedia digital information such as various texts, sounds, graphics, images and animations. Divided into non-rewritable discs, such as CD-ROM, DVD-ROM, etc.; and rewritable discs, such as CD-RW, DVD-RAM, etc. A 12cm disc can store about 680MB of data.

   (Mechanical) Hard Disk Drive (HDD for short) : The full name is Winchester hard disk, which consists of one or more aluminum or glass discs covered with ferromagnetic materials.

   Early ROMs, according to different writing methods, mainly include:

   a) Mask mode ROM: it is an early read-only memory, which is written directly during the production process of the chip and cannot be modified later;

   b) PROM (one-time programmable ROM): There is one and only one writing opportunity, once written, it cannot be modified;

   Later, with the development of technology, new semiconductor storage media appeared on the basis of ROM, such as:

   c) EPROM (Erasable Programmable ROM): It can be read or written. The erasing methods include UVEPROM (ultraviolet erasing) and E2PROM (electrical erasing);

   d) Flash memory (Flash Memory): a flash memory. At present, the motherboards of most microcomputers use flash memories to store BIOS programs . Our common solid-state drives (SSD), SD cards, U disks, etc.

   Both EPROM and flash memory can be erased, which does not conform to the naming of ROM, but because it is derived from the technology of ROM, part of the original name is continued.

3.4.3 The difference between mechanical hard disk and solid state hard disk

       Mechanical hard drives are not flash memory, they use magnetic discs to store data. Just like the records used on the old-fashioned gramophone we saw in TV dramas, except that the phonograph has only one magnetic head, while the hard disk has two upper and lower magnetic heads, and the platter rotates at high speed between the two magnetic heads. Solid state drives use flash memory particles for data storage.

  • mechanical hard drive

   The hard disk was developed by IBM in the early days. In 1980, two former IBM employees founded the company and developed a 5.25-inch 5MB hard disk. This company is Seagate.

  The mechanical hard disk is mainly composed of disk platters, magnetic heads, spindles and drive shafts, etc., and data is stored in the disk platters.

   Disk side (Side) : The disk is composed of a stack of disks. Each disk consists of two disks. There will be a magnetic head on the upper and lower disks for reading and writing;

   Tracks (Track) : Each disk will be divided into multiple concentric circles around the center of the circle. These concentric circles are called tracks; the tracks are numbered sequentially from 0 from the outside to the inside, and each disk of the hard disk has 300 to 1 024 tracks.

   Cylinders : A three-dimensional cylinder composed of tracks at the same position on all platters is called a cylinder, so the number of cylinders is equal to the number of tracks.

   Sector : Each concentric circle on the disk is a track, and each track is divided into several arc segments, and each arc segment is a sector. The size of each sector is fixed at 512Byte. A sector is also the smallest storage unit of a disk.

   Cluster (Cluster) : Several physically adjacent sectors are called a cluster. The basic unit of operating system to read and write disk is sector, and the basic unit of file system is cluster. Clusters generally have these types of sizes 4K, 8K, 16K, 32K, 64K, etc. The larger the cluster, the better the storage performance, but the space is seriously wasted. The size of the file system cluster in NTFS format is 4K.

   For example: the actual size of the following file is 8.75KB, and the occupied space is 12.0KB, that is, three clusters.

The calculation formula of disk capacity: capacity = number of disks × number of sectors (cylinders) × number of bytes in a sector (512 bytes);

Disk /dev/sda: 299.0 GB, 298999349248 bytes
255 heads, 63 sectors/track, 36351 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
注:255 heads(磁头)就有255个盘面
容量=255*36351*63*512=36351*8225280=298999349248,即299GB

The mechanical hard disk is connected to the computer motherboard through the interface. The common mechanical hard disk interfaces are:

1) IDE interface (Integrated Drive Electronics, electronic integrated drive)

   The IDE hard disk interface, also known as "ATA hard disk" or "PATA hard disk", is the main interface of early mechanical hard disks. ATA itself supports serial and parallel. The theoretical speed that the fastest parallel ATA/133 can achieve is 133MB/s. However, there are almost no hard disks with this interface on the market now, and the speed is slow and does not support hot swapping.

2) SATA connector (Serial ATA, serial ATA)

   The SATA speed is faster than the IDE interface. SATA does not depend on the bandwidth of the system bus, but has a built-in clock frequency and supports hot plugging. The theoretical transmission bandwidth of SATA3.0 interface is 6Gbps. At present, most mechanical hard disk interfaces on the market are SATA.

3) SCSI interface (Small Computer System Interface, small computer system interface)

   SCSI is widely used in servers, and has the advantages of wide application range, multi-tasking, large bandwidth, low CPU usage and hot swap, etc., and the theoretical transmission speed reaches 320MB/s.

4) SAS interface (Serial Attached SCSI, serial SCSI)

   SAS is a new generation of SCSI technology. It is the same as the popular Serial ATA (SATA) hard disk. It uses serial technology to obtain higher transmission speed.

  • SSD

   Solid State Disk (Solid State Disk) is a hard disk made of solid-state electronic storage chip arrays. There are two types of storage media for solid-state hard disks. One uses flash memory (FLASH chips) as the storage medium, and the other uses DRAM as the storage medium. At present, the solid-state hard disk that uses flash memory as the storage medium is mainly used more.

   The speed of ordinary SATA3.0 solid-state drives is about 500MB/S, while the read performance of mechanical hard drives at this stage mostly hovers between 100MB/S-200MB/S, while the maximum read performance of M.2 solid-state drives using the NVMe protocol can reach more than 3000MB/S.

Note: U disk, full name USB flash drive, English name "USB flash disk".

   The name of the U disk originated from a new type of storage device produced by Netac Technology, named "U disk", which is connected with a USB interface. Since Netac has registered patents for equipment with similar technologies produced later, they can no longer be called "USB disks", but are renamed "U disks" with homophonic sounds.

   Then some people will have doubts, why does our usual U disk feel slower than the mechanical hard disk? Although the U disk uses flash memory particles, there are often only two flash memory channels, and there is still a gap in the data throughput of the U disk interface.

3.4.4. RAM - Introduction

   Random access memory RAM: refers to random access memory (random access memory, RAM), which directly exchanges data with the internal memory of the CPU. It can be read and written at any time, and the speed is very fast. It is usually used as a short-term temporary data storage medium for operating systems or other running programs. The computer first loads the program or document requested by the user into memory from the hard disk, and then accesses the information from memory. Random access memory accesses data according to addresses, rather than sequentially accessing data, mainly to solve the problem of mismatching CPU and hard disk speeds.

   Random access memory can be divided into bipolar RAM and MOS RAM according to the manufacturing process.

Note: MOS tubes will be touched in logic circuits, and MOS tubes are more practical for low-power devices than triodes. The triode is controlled by current and can withstand high voltage and high current, while the MOS tube is controlled by voltage and has low power consumption. Common circuits of bipolar RAM: TTL logic, ECL logic, I2L logic.

  • Static RAM (SRAM)

   SRAM : Static RAM uses a flip-flop composed of 6 MOS transistors as the basic circuit. It has moderate integration, moderate power consumption, and fast speed. It does not need to refresh the circuit, and the information will be lost only when the power is turned off;

  • Dynamic RAM (DRAM)

   DRAM : Dynamic RAM stores information by whether the gate capacitance of the MOS transistor is charged. The basic unit circuit is generally composed of four transistors, three transistors, and a single transistor. Three transistors and a single transistor are more commonly used. However, due to the leakage current in this circuit, the charge on the gate capacitor will be released after a certain period of time, so the circuit needs to be refreshed (regular charging every 1ms-3ms), but its integration is high, power consumption is low, and the cost is lower than SRAM. Usually used to make memory chips in memory sticks.

   DRAM mainly has the following types:

   1) Synchronous DRAM (SDRAM): The frequency of DRAM is synchronized with the frequency of the CPU bus, which greatly improves the efficiency of data transmission, so it is called synchronous DRAM.

   SDRAM memory has the following types: PC66/100/133150/166, the core frequency (or equivalent frequency) is 66MHz, 100Mz, 133MHz, 150MHz, 166MHz.

   The maximum data transmission bandwidth of a single SDRAM memory is 166MHz × 64bit ÷ 8 = 1.3GB/s.

   2) Rambus DRAM (RDRAM): Provides very high data transfer rates using various acceleration mechanisms on the narrow CPU memory bus. RDRAM runs on a serial circuit, which means that all memory slots must be filled with circuits to close and access memory.

   3) Double data rate SDRAM (DDR SDRAM) : SDRAM performs read/write functions on the rising edge of each system clock, while double rate synchronous dynamic random access memory (Double data rate SDRAM, referred to as DDR memory) performs read/write functions on each rising and falling edge of the system clock, thus effectively doubling the memory performance and greatly improving the overall performance .

   When it comes to memory technology, we will first mention DDR, which is a mainstream memory technology widely used in desktops, notebooks, servers and other systems. The current mainstream DDR memory is: DDR3 and DDR4.

   4) Cache DRAM (CDRAM): A special DRAM memory with on-chip cache memory (SRAM) and a high-speed buffer of DRAM, which is what we often call Cache DRAM . When the CPU writes or reads data into memory, this data is also stored in cache memory. When the CPU needs the data again, the CPU reads the data from the cache instead of accessing slower memory.

   Cache DRAM: Level 1 cache (L1 Cache), Level 2 cache (L2 Cache), Level 3 cache (L3 Cache).  

   Cache: It is a buffer for data exchange. When a piece of hardware wants to read data, it will first search for the required data from the cache. If it finds it, it will execute it directly. If it cannot find it, it will find it from the memory. Cache runs much faster than memory, mainly to solve the problem of speed mismatch between CPU and main memory.

   Cache memory is currently divided into: L1 cache, L2 cache, and L3 cache. The speed of each layer decreases by orders of magnitude, and the capacity is getting larger and larger.

   Each core has its own L1 cache. There are two types of L1 cache: L1 instruction cache (L1-icache) and L1 data cache (L1-dcache). The L1 instruction cache is used to store decoded instructions, and the L1 data cache is used to store very frequently accessed data;

   The L2 cache is used to store recently used memory data. More strictly speaking, it stores data that is likely to be used by the CPU in the future;

   Each core of most multi-core CPUs has its own L2 cache, but there are also designs in which multiple cores share the L2 cache. In any case, L1 is private to each core (but shared by multiple threads within a core).

3.4.5. Development history of DDR memory

   In 1961, IBM established the semiconductor-oriented Thomas Watson Research Center in New York State. Fairchild was IBM's semiconductor device supplier at the time. Gordon Moore of Fairchild predicted that the number of transistors that can be accommodated on an integrated circuit will double every 18 months, and its performance will also double. This is the famous Moore's Law;

   In 1966, at the IBM Thomas Watson Research Center, Dr. Robert Dennard, who was 34 years old at the time, proposed the idea of ​​using metal oxide semiconductor (MOS) transistors to make memory chips. The principle is to use whether the capacitor stores charge to store information, and only one transistor and one capacitor are needed for each 1 bit, and this practice has been used until now;

   With the rapid rise of semiconductor companies such as Texas Instruments and Motorola, Fairchild Semiconductor was founded by Robert Noyce in 1957. Due to various reasons, its status was gradually replaced by Texas Instruments;

   Until August 1968, the fairy boy Robert Noyce pulled Gordon Moore, the head of the R&D department, to resign and set up a new company. At first, he named the company "Moore-Noyce Electronics Company", but felt awkward, so he changed the name to Intel (Intel).

   In April 1969, Intel launched the C3101, a static random access memory (SRAM) chip with a capacity of 64 bits, which could only store 8 English letters.

   Soon, Jerry Sanders, one of the directors of Fairchild, also left the company and founded AMD (Advanced Micro Devices, AMD) with 7 other people. And LJ Sevin (MOS field effect transistor expert), chief engineer of Texas Instruments Semiconductor Center, pulled a group of colleagues to resign and established Mostek (Mostek).

   In July 1969, Intel Corporation launched the 256-bit SRAM chip C1101, which is the world's first large-capacity SRAM memory.

   In October 1970, the first dynamic random access memory (DRAM) chip C1103 was launched, with a capacity of only 1Kb;

   In 1973, Mostek developed the 16-pin MK4096 chip, which increased the capacity to 4K. At that time, the memory manufactured by Texas Instruments, Intel and Motorola was 22 pins;

   Although Intel occupied 82.9% of the global DRAM market share in 1974, it was quickly overtaken by Mostek. At this time, Intel focused on the development of the 8080 processor and achieved great success in the microcomputer market;

   In 1978, four Mostek's former employees founded Micron in a dark basement;

   In 1980, the "VLSI" project jointly established by Fujitsu, Hitachi, Mitsubishi, NEC, and Toshiba made a breakthrough. Various types of plate-making copying devices and dry etching devices using ultraviolet rays, X-rays, and electron beams have achieved mass production of DRAM. Due to the massive dumping of cheap DRAMs in Japan, Micron was forced to lay off employees, and even Intel suffered huge losses and was forced to announce its withdrawal from the DRAM market;

   In 1982, Japan became the world's largest DRAM producer; at this moment, the US semiconductor market was defeated by Japan. In the end, Micron licensed the 64K DRAM technology to South Korea's Samsung; then Texas Instruments signed an OEM agreement with South Korea's Hyundai in order to reduce manufacturing costs, and Texas Instruments provided the 64K DRAM process flow;

   In 1990, Samsung established 26 R&D centers. Two years later, Samsung took the lead in breaking through technical barriers and launched the world's first 64M DRAM product;

   In 1996, Samsung developed the world's first 1GB DRAM and ranked first in the world, while Hyundai Electronics ranked third;

   In 1999, South Korea's Hyundai Semiconductor, which ranked third, merged with LG; in the same year, Infineon Technologies was formally established in Munich, Germany, and its predecessor was the semiconductor department of Siemens Group;

   In 2001, Hyundai Group completed the split and changed the company name to Hynix Semiconductor Inc. In the same year, Micron completed the acquisition of Texas Instruments’ DRAM business; at this time, South Korea’s Samsung, the United States’ Micron, South Korea’s Hynix and Germany’s Infineon accounted for more than 80% of the DRAM market; in the same year, South Korea’s Samsung Electronics developed DDR2 memory;

   In 2004, DDR2 memory sticks began to be mass-produced and gradually entered everyone's field of vision;

   In 2005, South Korea's Samsung Electronics announced that it had developed the world's first DDR3 memory;

   In 2006, DDR3 memory sticks were launched;

   In 2008, Infineon also withdrew from the DRAM market due to the global financial crisis; at this time, the three major suppliers of Samsung, Micron, and Hynix almost took the vast majority of the global DRAM market;

   In January 2011, South Korea's Samsung Electronics announced the completion of the manufacture and testing of DDR4 DRAM modules;

   In 2012, SK Group, South Korea's third largest chaebol, announced the acquisition of 21.05% of Hynix's shares and changed Hynix's name to SK Hynix (SK Hynix);

   In 2014, DDR4 began to enter the market;

   In 2017, a new gallium nitride (GaN) and silicon carbide (SiC) subcommittee was established;

   In July 2020, the JEDEC Association officially announced the DDR5 standard; in October of the same year, SK hynix announced that it officially released the world's first DDR5 memory;

   In 2021, Samsung's DRAM market share will be 43.6%, SK Hynix's market share will be 27.7%, and Micron's market share will be 22.8%. Only the three giants will occupy 96.1% of the global DRAM market.

   In 2022, DDR5 will gradually enter the market.

3.4.6 Introduction to DDR Series Memory

   The picture below shows the parameters of the notebook memory stick I bought when I was in college in 2012, and it is still a powerful fighter.

   Before understanding the DDR memory stick, let's first understand a few related concepts:

  • DDR core frequency

   The DDR core frequency is the refresh frequency of the memory Cell Array (Memory Cell Array, that is, the internal capacitor), which is the real operating frequency of the memory. Limited by the limit of physical materials, the core frequency has been hovering between 133-200MHz.

  • DDR operating frequency

   Since DDR memory can transmit data on both the rising and falling edges of the pulse, the operating frequency of DDR is double the core frequency.

The core frequency is the refresh frequency of the memory Cell Array (Memory Cell Array, that is, the internal capacitor), which is the real operating frequency of the memory; the clock frequency is the transmission frequency of the I/O Buffer (input/output buffer); and the effective data transmission frequency refers to the frequency of data transmission (that is, the equivalent frequency)

  • Equivalent frequency of DDR

   Equivalent frequency and nominal frequency are a concept. Due to the application of prefetch technology, data transmission is performed on both rising and falling edges. In the case of equivalent to single-edge transmission, equivalent frequency (nominal frequency) = core frequency × multiplication factor.

   The naming of the memory sticks we usually see is based on the nominal frequency of DDR.

NOTE: The multiplication factor will be explained later.

  • memory timing

   1) CL-memory column addressing pulse response time (delay time);

   2) tRCD-delay time for transferring memory row address to column address;

   3) tRP-the time required for precharging the memory row address strobe pulse;

   4) tRAS-memory row address strobe delay;

for example:

   Let's calculate the CL delay time of DDR1~4:

   DDR-400 3-3-3-8:3*2/400=15 ns

   DDR2-800 6-6-6-18:6*2/800=15 ns

   DDR3-1333 9-9-9-24:9*2/1333=13.5 ns

   DDR4-2133 15-15-15-35:15*2/2133=14 ns

   Note: The reason for multiplying by 2 is that the DDR memory transmits data twice in one clock cycle, and a delay time for each clock cycle can be obtained.

   Addressing a row and a column must have an intersection, which can uniquely determine a memory address. Generally, at the same frequency, the smaller the CL value, the better the performance of the memory module (the easier it is to overclock), and the higher the memory frequency at different frequencies, the better the performance.

  • dual channel

   Before introducing dual channels, let's look at how to calculate memory bandwidth. Memory bandwidth calculation formula:

   Memory bandwidth = memory core frequency × multiplication factor × (number of memory bus bits / 8 ) = nominal frequency × bit width.

   As we mentioned earlier, DDR uses the rising and falling edges of the clock pulse to transmit data once. This technology is called prefetching (Prefech, 2 bits per transmission), so that one clock signal can transmit twice the data of SDRAM, so it is also called double-rate SDRAM, and its multiplication factor is 2. DDR2 doubles the expected mechanism again, prefetching 4 bits, so the multiplication factor of DDR2 is 2X2=4; DDR3 is an upgraded version of DDR2, this time the prefetch is increased to 8bit, and its multiplication factor is 2X2X2=8.

   According to the formula of memory bandwidth, we found that if the nominal frequency is fixed, if the bit width can be increased, that is to say, the data transmission capacity of the memory can be improved. So Intel invented dual channels to increase the bit width.

   Ordinary single-channel memory systems have a memory controller, while dual-channel memory is to design two memory controllers in the chip (with the disappearance of the north bridge, Intel integrated the memory controller-MCH into the CPU). These two memory controllers can work independently of each other. Each controller controls a memory channel, and the CPU of the two memory channels can address and read data separately. In dual-channel mode, it has a memory bit width of 128 bits, which theoretically doubles the memory bandwidth.

1) DDR memory

   DDR standard developed by JEDEC (Solid State Technology Association is the leading standards body for the microelectronics industry)

Specification Number of pins (single side) Voltage core frequency I/O frequency Equivalent frequency Prefect bandwidth
SDR-133 168(84) 3.3V 133 MHz 133 MHz 133 MHz 1 bit 1.0 GB/S
DDR-200 184(92) 2.5V 100 MHz 100 MHz 200 MHz 2 bit 1.6 GB/S
DDR-266 184(92) 2.5V 133 MHz 133 MHz 266 MHz 2 bit 2.1 GB/s
DDR-333 184(92) 2.5V 166 MHz 166 MHz 333 MHz 2 bit 2.6 GB/s
DDR-400 184(92) 2.5V 200 MHz 200 MHz 400 MHz 2 bit 3.2 GB/s

   The notebook has a pin count of 180. In fact, there are DDR-500, DDR-600, and DDR-700 in the first-generation DDR enhanced by manufacturers, and their equivalent frequencies are 500 MHz, 600 MHz, and 700 MHz respectively.

   The maximum data transmission bandwidth of a single DDR-500 memory is 500 MHz×64 bit ÷ 8 = 4GB/s.

2)DDR2

   DDR2 standard formulated by JEDEC

Specification Number of pins (single side) Voltage core frequency I/O frequency Equivalent frequency Prefect bandwidth
DDR2-400 240(120) 1.8V 100 MHz 200 MHz 400 MHz 4 bit 3.2 GB/S
DDR2-533 240(120) 1.8V 133 MHz 266 MHz 533 MHz 4 bit 4.3 GB/s
DDR2-667 240(120) 1.8V 166 MHz 333 MHz 667 MHz 4 bit 5.3 GB/s
DDR2-800 240(120) 1.8V 200 MHz 400 MHz 800 MHz 4 bit 6.4 GB/s

   The notebook has a pin count of 200. The DDR2 standard enhanced by the same manufacturer, and DDR2-1066, has an equivalent frequency of 1066 MHz.

   The maximum data transmission bandwidth of a single DDR2-1066 memory is 1066 MHz×64 bit ÷ 8 = 8.53GB/s.

3)DDR3

   DDR3 standard formulated by JEDEC

Specification Number of pins (single side) Voltage core frequency I/O frequency Equivalent frequency Prefect bandwidth
DDR3-800 240(120) 1.5V 100 MHz 400 MHz 800 MHz 8 bit 6.4 GB/S
DDR3-1066 240(120) 1.5V 133 MHz 533 MHz 1066 MHz 8 bit 8.5 GB/s
DDR3-1333 240(120) 1.5V 166 MHz 667 MHz 1333 MHz 8 bit 10.6 GB/s
DDR3-1600 240(120) 1.5V 200 MHz 800 MHz 1600 MHz 8 bit 12.8 GB/s
DDR3-1866 240(120) 1.65V 233 MHz 933 MHz 1866 MHz 8 bit 14.9 GB/s
DDR3-2133 240(120) 1.65V 266 MHz 1066 MHz 2133 MHz 8 bit 17.0 GB/s

   The notebook has a pin count of 204. DDR3-1866 and DDR3-2133 were introduced at a later stage, and even DDR3-2400 appeared; at the same time, a low-voltage version of DDR3 was released, with a voltage of 1.35V.

   DDR3 memory architecture:

   Since the bit width of most memory particles is 8bit, 8 chips are often used to form a rank.

4)DDR4

   DDR4 standard formulated by JEDEC

Specification Number of pins (single side) Voltage core frequency I/O frequency Equivalent frequency Prefect bandwidth
DDR4-1600 288(144) 1.2V 100 MHz 800 MHz 1600 MHz 8 bit 12.8 GB/S
DDR4-1866 288(144) 1.2V 133 MHz 933 MHz 1866 MHz 8 bit 14.9 GB/s
DDR4-2133 288(144) 1.2V 166 MHz 1066 MHz 2133 MHz 8 bit 17.2 GB/s
DDR4-2400 288(144) 1.2V 200 MHz 1200 MHz 2400 MHz 8 bit 19.2 GB/s
DDR4-2666 288(144) 1.2V 233 MHz 1333 MHz 2666 MHz 8 bit 21.3 GB/s
DDR4-3200 288(144) 1.35V 266 MHz 1600 MHz 3200 MHz 8 bit 25.6 GB/s

Note: DDR4-1600 and DDR4-1866 are generally used in special fields, and the retail field starts from 2133.

   We found that the Prefech of DDR4 has not changed (because it is very difficult to improve the prefetching), and a new concept of BANK GROUP has been added to the original DDR3 memory architecture, and two banks are assembled into a BANK GROUP, which is equivalent to improving the Prefech to 16bit.

2)DDR5

   The DDR5 standard formulated by JEDEC is expected to be up to DDR5-6400, and Prefech is upgraded to 16 bit.

4. Some basic knowledge that needs to be understood

4.1. Expansion of knowledge about CPU

4.1.1. Brands of Mainstream CPU Manufacturers

   At present, mainstream CPU manufacturers include Intel and AMD.

  • Intel CPU

   Common series are: Celeron, Pentium, Core, Xeon, positioning from low to high.

   Among them, Celeron and Pentium are positioned as low-end office platforms for home use, with weak performance, and are commonly named after G.

   Core is positioned as a high-performance gaming platform, commonly starting with i, such as i5, i7, i9, and the general naming rule is ix xxxx (F/K/X/XE/S), where F stands for non-core display (can be equipped with independent graphics card), K stands for the processor does not lock the multiplier, which can overclock the CPU (the performance can be stronger), X and XE are the extreme class, and S stands for the low-power version. At present, most notebooks use BGA-packaged CPUs, which generally require professional machines to replace. Therefore, the CPUs of our common notebooks usually have X (high-performance processor), H (high-voltage and non-removable processor), HQ (with core display, comparable to mid-range discrete graphics card), M (standard voltage processor), U (low-voltage processor), Y (ultra-low-voltage processor) and other endings.

   The Xeon series is positioned as a server platform.

  • AMD CPU

   Common series are: Phenom, Athlon (starting with K), Sempron, Bulldozer (FX), and Ryzen. Of course, there are some intermediate series, such as Duron and so on.

   We are more common is the Ryzen series. Released in 2017, mainly to replace the Bulldozer series. Ryzen starts with R, such as R5, R7, and R9. The general naming rule is Rx xxxx(G/X), where G stands for the nuclear display series, and X stands for the automatic overclocking series.

4.1.2. What is CPU main frequency, FSB and multiplier

  • main frequency

   The main frequency of the CPU is the clock frequency at which the CPU core works (CPU Clock Speed). The clock frequency generator of the CPU is also on the motherboard, which uses current to stimulate the quartz oscillation to form a stable pulse signal. The main frequency of the CPU and the running speed of the CPU are not a linear relationship, but increasing the main frequency is crucial to improving the CPU operation speed.

   The higher the main frequency, the faster the processing speed. Frequency is currently only used to compare the speed of the same CPU.

   The core frequency of the earliest 4004 chip is 740kHz, which means it can pulse 740,000 times per second. In 2004, the highest frequency of Pentium 4 reached 3.4GHz, and the main frequency did not change much in the following ten years (mainly due to the influence of power consumption and heat generation). By 2022, the latest 12th generation Core i9 12900HX, the main frequency range is 2.3GHz-5GHz, and the maximum frequency can be 5 billion times per second.

Note: In the past, we saw that the main frequency of the CPU may have a range of 2.3GHz-5GHz, which means that the main frequency of the processor is 2.3GHz, and the maximum frequency can reach 5GHz. However, in the past, if you want to reach the highest frequency, you need to manually set it, but now we find that it has begun to display the turbo    frequency .

  • FSB

   The FSB is the frequency outside the CPU. It is the speed at which the CPU and the main board run synchronously, and it is also the base frequency of the entire computer system. (Most of the frequencies are based on the FSB, multiplied by a certain multiple to achieve)

   It can be understood that the FSB of the CPU is directly connected with the memory to realize the synchronous operation state between the two. The FSB is related to the memory and the chipset of the motherboard. The FSB can be overclocked but unstable.

   Why is there the concept of FSB?

   The emergence of the most classic 80486 (33MHz outer frequency) processor laid the foundation for the chipset. The Intel 420 series has the concept of the chipset. The concept of frequency is based on this. At the same time, the CPU is connected to the bus of the North Bridge chip as FSB (Front Side BUS, front -end bus), and the CPU exchange data through the North Bridge chip and memory and graphics cards. Before Pentium 4, since the speeds of the CPU and the memory are not much different, the speed of the CPU FSB is the same as that of the memory between the motherboards, that is to say, the speed of the CPU FSB and the front side bus are the same (the same frequency is beneficial to system stability).

   Later, the working speed of the CPU continued to increase, and the FSB of the CPU gradually increased from the original 33MHz and 66MHz to 100MHz, 133MHz, 166MHz, 200MHz, 300MHz and so on. In terms of memory, due to the relationship between the electrical structure, it cannot keep up with the speed of the CPU, which seriously affects our obsession with the pursuit of speed. Data bandwidth = (bus frequency × data bit width) ÷ 8. The higher the frequency of the front-side bus, the greater the data transmission capability between the CPU and the north bridge chip. If there is no fast enough front-side bus, no matter how powerful the CPU is, it will not be able to significantly improve the overall speed of the computer.

   In order to increase the operating frequency of the memory, Intel has racked its brains. In order to alleviate this situation, Pentium 4 has made major changes to the overall CPU and chipset architecture. Pentium 4 adopts quad pumped (4 times concurrent) technology, which enables the system bus to transmit data 4 times in one clock cycle, which is equivalent to using 4 original front-side buses to interact with memory.

   For the FSB of 133MHz, the speed of the front side bus reaches 133 x 4 = 533MHz. At that time, the Pentium 4 south bridge chip was upgraded to ICH4, and the memory controller of the north bridge also supported DDR memory. At this stage, the DDR memory was still a first-generation DDR (the second-generation DDR was only mass-produced in 2004).

   Detection of CPUZ:

   Note: The speed of the bus here refers to the FSB.

  • multiplier

   The full name is the frequency multiplication factor, which is a ratio relationship between the core operating frequency of the CPU and the external frequency. This ratio is the frequency multiplication factor, referred to as the frequency multiplication factor.

   When the FSB remains the same, increasing the multiplier will result in a higher CPU frequency. Originally, there was no concept of frequency multiplication. The main frequency of the CPU was the same as the speed of the system bus. However, as the speed of the CPU became faster and faster, frequency multiplication technology came into being. It can make the system bus work at a relatively low frequency, and the CPU speed can be infinitely improved through frequency multiplication. There is only one default multiplier for a CPU, and the motherboard must be able to support this multiplier. Therefore, you must pay attention to this point when purchasing the motherboard and CPU. If the two do not match, the system will not work.

   CPU operating frequency = multiplier * FSB .

4.1.3 What are integrated display and independent display

  • set display

   There are two types of sets:

   One is integrated on the motherboard (in the north bridge chip or directly soldered on the motherboard). Using this kind of motherboard can meet the general display function without a discrete graphics card.

   The other is integrated in the CPU, Intel is called the core graphics card, and AMD is called the APU (Accelerated Processing Units, accelerated processor). Relying on the powerful computing power of the CPU and the intelligent energy efficiency adjustment design, the same excellent graphics processing performance and smooth application experience can be achieved at lower power consumption.

   Now basically the integrated display is a nuclear display, and it is relatively rare to integrate it on the motherboard.

  • Unique

   The independent graphics card is an independent graphics card, which provides an additional graphics card interface on the motherboard. If you feel that the integrated graphics card cannot meet your requirements, you can use the independent graphics card, which has better performance.

  • The difference between integrated display and independent display

1) The video memory is different

   Discrete graphics card has independent video memory, does not occupy system memory, has independent graphics processing core and independent video memory, and can meet complex and huge graphics processing requirements, especially large-scale 3D games.

   The core display integrates the graphics core into the CPU, which can independently accelerate or reduce the frequency, and share the third-level cache, further enhancing the efficiency of graphics processing.

2) Different power consumption

   Discrete graphics cards are higher than core graphics cards.

   Low power consumption and cost-effectiveness are the main advantages of the core display. Efficient processing performance cores and greatly reduced computing time further reduce the power consumption of the core display.

4.1.4. Hyper-Threading Technology

   When we buy a computer, we often look at the parameters of the CPU. There are several descriptions of the CPU: "dual-core", "dual-core four-thread", "quad-core", "quad-core four-thread", "quad-core 8-thread"...

   The curious cat quickly opened the task manager, ready to find out:

   Is this true 4 cores or 4 threads? I was so scared that I quickly tested my computer with CPUZ: it was a dual-core four-thread.

   This is a technology released by Intel in 2002, called Hyper-Threading ( HT , Hyper - Threading ).

   Dos command can be used without CPUZ

Win+R, enter wmic

Enter separately

cpu get Name CPU name/number of CPUs (number of CPUs on physical hardware)

cpu get NumberOfCores CPU core number (CPU core unit group number)

cpu get NumberOfLogicalProcessors number of threads (one core corresponds to at least one thread, but through hyper-threading technology, one core can correspond to two threads)

4.1.4.1. What are processes and threads

  • process

   Before the operating system introduced processes, because the CPU can only execute one program at a time, multiple programs can only be executed sequentially . However, the speed of the CPU is very fast, and the speed of IO such as disks and networks is very slow, resulting in a lot of idle time for the CPU. At this time, the utilization rate of the CPU is very low. In order to solve the problem of low CPU utilization, the operating system introduced processes (proposed in the 1960s ) and interrupt processing .

   Process (Process): It is the smallest unit for resource allocation by the operating system. A process is an execution process of a program. Every time a process is started, the operating system will allocate an independent memory space for it to store PCB, data segment, program segment and other resources, that is, each process occupies an independent memory space.

  • thread

   In the 1960s, the basic unit that can own resources and run independently in the operating system is the process. However, with the development of computer technology, the process has many disadvantages. First, because the process is the resource owner, there is a large space-time cost for creating, canceling and switching. A light process needs to be introduced. Therefore, in the mid-1980s, in the field of operating systems, a basic unit that is smaller than a process and can run independently——thread was proposed.

   Thread (Thread): A lightweight process is the smallest unit for scheduling by the operating system. A thread is an execution process of a task (a program segment), and the thread does not occupy memory space, it is included in the memory space of the process. In the same process, multiple threads share the resources of the process, and a process has at least one thread.

4.1.4.2 Overview of Hyper-Threading Technology

   Our pursuit of speed (performance) has never stopped, and we will never give up until we squeeze out the idle time of the CPU. So in February 2002, hyper-threading technology appeared for the first time in Xeon server processing, and the desktop version of the Pentium 4 processor released in November of the same year also integrated hyper-threading technology.

   Hyper-threading allows a single processor to grab and execute two independent code streams in parallel at the same time, that is to say, a single CPU is used to simulate dual CPUs to balance the performance of the program, so that multiple threads of the application can be executed on one processor at the same time.

4.2. Overview of computer software system

   Computer systems are hierarchical, and are divided into hardware systems and software systems from a macro perspective. In the past, we mainly introduced some knowledge of computer hardware from the macro level, and then we mainly introduced some knowledge of software from the micro level.

4.2.1. Overview of computer system hierarchy

   Let's talk from bottom to top, at the hardware system level:

   Digital logic layer : it is the lowest machine hardware, which is some electronic components composed of digital logic circuits;

   Micro-architecture layer : it is the upper level of the digital logic layer, it is some micro-programs, and the micro-instructions issued by it can be recognized by the machine hardware;

   Instruction system layer : It is the upper level of the microarchitecture, also called the machine language level, which is the machine instruction that can be interpreted by the microprogram;

   At the software system level:

   Operating system layer : It is implemented by operating system programs. These operating systems are composed of machine instructions and generalized instructions. These generalized instructions are software instructions defined and interpreted by the operating system. It is the carrier that connects hardware and software.

   Assembly language layer: It provides programmers with a symbolic form of language instead of machine language to reduce the complexity of programming;

   High-level language layer: It consists of various high-level languages, which simplifies the complexity of the symbolic formal language, and the high-level language will eventually be compiled into an assembly language program.

4.2.2. Development of computer software system

  • First Generation Software (1946-1953)

   In the tube era, the first generation of software was written in machine language, which is the instructions built into computer circuits and consists of 0s and 1s. The initial instruction system has only a dozen to dozens of lines.

   Programmers punch the program code made up of 0 and 1 numbers on a paper tape or card, 1 is punched, 0 is not punched, and then the program is input into the computer through a tape machine or a card machine for calculation. Such machine language is composed of pure 0 and 1, which is very complicated, inconvenient to read and modify, and prone to errors.

  • Second Generation Software (1954-1964)

   In the transistor era, when hardware became more powerful, more powerful software tools were needed to use computers more efficiently. The emergence of assembly language solves this problem. Assembly instructions are written in an easy-to-remember format for machine instructions. Mnemonics are used to replace the opcodes of machine instructions, and address symbols (Symbol) or labels (Label) are used to replace instructions or operands. However, programmers still have to remember many assembly instructions.

   Note: In today's practical application of assembly language, it is usually applied at the bottom layer. Drivers, embedded operating systems, and real-time programs all require assembly language.

  • Third Generation Software (1965-1970)

   The emergence of integrated circuits has greatly improved the computing speed of processors, so we need a more effective way to control the various hardware in the computer to coordinate work, so the concept of operating system is introduced.

  • Fourth Generation Software (1971-1989)

   With the emergence of microprocessors, in order to facilitate the modification and maintenance of programs, structured programming technology appeared in the 1970s. Both Pascal language and Modula-2 language were formulated using structured programming rules. Basic, a language designed for third-generation computers, was also upgraded to a structured version. In addition, a flexible and powerful C language appeared.

  • Fifth generation software (1990-present)

   The rise of Microsoft, which has a dominant position in the computer software industry, the emergence of object-oriented programming methods, and the popularization of the World Wide Web have accelerated the rapid development of modern informationization.

   And it is these high-level languages ​​that we have to learn.

Guess you like

Origin blog.csdn.net/xiaoxianer321/article/details/127180920