How does the computer run

1. In fact, the computer will only realize input, calculation, output 

These three modules are indispensable. The lack of input means that no user can use it. The lack of operation is equivalent to a wire. The lack of output is equivalent to the garbage bin that has been accumulating information.

Therefore, the hardware of the computer is composed of a large number of ICs (Integrated Circuit). Each IC has many pins, which are equivalent to wires. These pins are used for input and output. The operation may be a little difficult to understand, but simple What actually changed in the IC when it came was the change in current (the specific changes are slowly understood). The definition of current in humans is a number, and there are only two numbers 0 and 1, so it seems that the computer is actually a bit stupid, but how Can tens of thousands of functions be changed?

2. A program is a collection of instructions and data. No matter which program, the content is a list of values, and each value is either an instruction or data.

A set of instructions operate on a piece of data to form the most basic program

The recommended text for this set of instructions is "Function"

A piece of data can be divided into two categories, one is input data and the other is output data

The data can be given the name "variable" when programming

y=f(x)

3. The computer's processing method is sometimes different from human thinking habits

When people describe the color, it will form the picture red blue green

When the computer describes the color, it will form the digital information of the color, such as "255,0,0" means red 

4. Computers have been evolving

The way of thinking of computers has been changing and tends to the way of thinking of human beings. Everyone should sincerely welcome the evolution of technology, and no one will seldom have good code.

Programming methods have also been evolving. One is component programming (assembly of program parts together to complete the program), and the other is object-oriented programming (first modeling what is in your mind, such as building a car model, and then Personally customize the model, called the unique Maserati you created)

5. The computer is mainly composed of IC components

Just remember three:

CPU (Central Process Processor): can perform calculations on data and control memory and I / O

Memory (data registers in the CPU): See how many bits your computer is. 32 bits, 64 bits, and 86 bits are determined by the capacity of the registers and the number of data buses transmitted into the CPU. Equivalent to a water pipe, the water pipe is 32-bit, and the faucet must also be 32-bit

I / O (Input / Output): accept input and output of user equipment

 In addition to the above, several auxiliary components are required

Crystal oscillator (the main component of the clock generator): crystal oscillator, due to the piezoelectric effect of the crystal, when an alternating voltage is applied on both sides of the wafer, the wafer will repeatedly mechanically deform to produce vibration, and this mechanical vibration It will in turn generate an alternating voltage. An external clock circuit must be added to the crystal oscillator to oscillate. Generally, it is an amplifier feedback circuit. Only a crystal oscillator cannot be oscillated. In order to assist the operating speed of the CPU, the crystal oscillator will be generated according to the frequency of the vibration after energization Clock signal frequency is used to measure the operating speed of the CPU

IC pin: The so-called pin is the leg-like part exposed at the edge of the IC, with a sequence number that increases from 1 in accordance with the counterclockwise direction

6. Bit is used as the unit of sending and receiving information

A binary number is usually called 1 bit. Call 8 binary numbers 1 byte

Bits are the smallest unit of information, bytes are the basic unit of information

For example, a 32-bit computer sends and receives information in units of 32 bits

7. Connect the power supply, address bus and data bus:

Connect the power supply first

In order to specify the source or destination (address for accessing data) when inputting and outputting data, the CPU is equipped with " address bus pins ", for example, there are 16 pins, represented by codes A0 ~ A15, where A represents Address (address ), The following 0 ~ 15 represents the position of each digit in a 16-bit binary number, 0 corresponds to the last bit, 15 corresponds to the first bit, and the binary representation is 0000000000000000 ~ 1111111111111111, which can provide 65536 data access units (Memory storage unit or I / O address), input and output information.

Once the address for accessing the data is specified, the data bus pins can be used for data input and output. The data bus pins are similar to the address bus pins and are represented by codes D0 ~ D15.

8. Connect I / O:

Let's start connecting I / O, do you know the word register? Registers are " data storage " located in the CPU and I / O , which is very fast and directly interacts with the CPU. Assume that there are 4 registers on a parallel PIO device, 2 are for the functions of the PIO itself, and 2 are for Store data input and output with external devices

 

9. Connect the clock signal:

Connect the CLK (Clock clock) pin of the CPU and the CLK pin of the PIO to the pins of the clock generator. Under the action of the clock generator, they act in synchronization with the ticking clock, and then connect to other Pin (simply brought here)

10. CPU working principle:

The CPU interprets and executes the programs stored in the memory under the control of the clock signal, enters the data from the memory or I / O into the CPU according to the instructions in the program, performs calculations inside the CPU, and then outputs the calculation results to the memory or I / O

Published 105 original articles · won praise 4 · Views 5141

Guess you like

Origin blog.csdn.net/LBJ8888888/article/details/105454209