Python full stack day02 computer Principle--hardware

Source: Internet
Author: User
Tags time and date volatile

DAY02 Computer Principle Learning summary!

first, the programming language:

The computer programming language, the so-called mechanical code (binary 0101), is from the early gossip pattern evolved, and then later the relay (strong electrical contact 1, do not contact release 0), According to this situation evolved mechanical code calculation, and Binary.

Any programming language to realize its function, no matter how the transformation, must be converted to the computer can recognize the mechanical code, and the binary code, the computer can be Recognized.

second, the computer composition:

A computer is an electronic device that can perform numerical and logical operations, in order of procedure, and has the capability of storing and analyzing, which consists of two parts: hardware and Software.

The main five parts of the hardware are: operator (CPU), controller, memory (hard disk), input device (keyboard, mouse), output device (monitor, printer)

Software is divided into two main categories: operating systems and applications

The relationship between hardware and software is:

The hardware is the base layer, the operating system is based on the hardware to realize the Human-computer interface of the middle, the application is the role of the system based on the implementation of the user needs of the upper Layer. The user is the Topmost. Hardware operation requires operating system instructions to control the operation, the process of invoking the application, the work of the hardware is the program with the operating system to indirectly Control. Operation instruction is a one-level release, instructions can not leapfrog Operation.

third, CPU, memory, Hard disk understanding

Processor: the equivalent of the Computer's brain, in multiple applications need CPU processing, The CPU can only do one thing at the same time, the application in memory cache, CPU processing time in memory, each brand of the CPU has a set of its own instruction sets, different brands of CPU to deal with the issue of instructions are not working.

Memory: memory equivalent to the Processor's secretary, because the Processor's own memory is very small, although all operations require the CPU to handle, but because of insufficient storage, it is impossible to all the cache to be processed in their own storage space, so this reflects the function of memory. The cache of the application to be processed is temporarily saved in memory, and then the CPU needs to be processed to read from memory, which can efficiently improve the Cpu's processing power. At the same time, the memory speed is faster than the speed of the hard disk, which is high speed, but the memory can not be used for storage devices, the data will be lost after power loss.

Hard disk: as a Computer's storage device, is the device used to store information Data.

Iv. CPUs and registers

Because the CPU is slow to read from memory, there are registers between the memory and the CPU to hold the Data. is equivalent to a bridge between the command speed and the high-speed Operation.

The registers are divided into several major categories:

1. General register: save variable and temporary Result.

2, Program Counter: Save the application of the path cache, multi-threaded process can be timely automatic switching, The program counter will automatically add the application process 1, after execution is not returned.

3. Stack pointer: first in and out

4, program Status Word register: the kernel state and the user state switch, the system temporarily stores the variable cache, closes the window or loses power.

Register maintenance: The popular saying is that the process is finished or stopped, save the data after a rest, when needed to load again.

CPU handler is to follow the instructions, decoding, execution to operate, these three parts of the operation is in parallel, the implementation of the process in the decoding, decoding process in order to, non-interference, improve Efficiency. CPU This processing is not the light has a thread, but there are multiple threads working at the same time.

five, the kernel state and the user state

Kernel state: system processing, the highest priority, the system can operate call Hardware.

User-state: the application, the CPU will limit its priority to Run.

CPU real-time exchange between the kernel state and the user state, Jump. Application calls are used to switch between kernel State and user state, and the application needs to do some kind of process to tell the operating system that the operating system will give priority to its kernel state, and then the program can control the hardware implementation process. After the end, switch back to the user State.

vi, L1 cache, L2 cache, memory (ram), EEPROM and flash,

L1 cache: and registers, which exist in the CPU cores, enable No-delay exchange of visits between Cpus.

L2 cache: and cache, either inside the CPU or very close to the CPU Cache. Outside the CPU core but connected to all Cores. If there is a system in the L2 cache to store the call, the processing result is high-speed, the cache hit, or the cache misses, the CPU needs to read the memory, so the processing speed will feel slow.

Ram: and main memory is the System's random access to the storage ram, during the system running process, in the cache can not find, will be in Memory. At the same time memory is volatile storage, the data will disappear after the power outage.

EEPROM: refers to the erasable programmable random access memory, File command write save will not be lost, but after erasing and then re-write SLOW.

Flash: generally used on mobile storage devices, such as: mobile hard disk, u disk, SSD and so On. Flash memory faster than disk, and hard disk compared to the stability and shockproof strong, there is a self-protection program.

Vii. CMOS and BIOS battery

CMOS BIOS battery, hold time and date of a memory, powered by the battery, but the storage is also volatile! It can save the configuration parameters of the BIOS system and will be stored in the CMOS after the BIOS system Changes.

eight, disk Structure

Disk is mainly composed of disk, manipulator, head, each disk surface has two heads, a disk is generally composed of a plurality of such disk surface. The storage of the disk file requires the head to be burned on the disk track, and the head should be found in the corresponding track Sector. Each track on the disc can be divided into multiple sectors.

Disk storage A large file is a large file that is split into chunks and stored at the same time. Since the data is stored in a segment of the sector, reading a piece of data from the disk requires a seek time and a delay time.

Average seek time refers to the time spent by the head looking for the track of the data to be read.

Average delay time refers to finding a track, but not necessarily the data sector in which the head is rotated to the correct location of the Data.

nine, virtual Memory and MMU

Large files run, memory is not enough, the system will be cached on the hard disk virtual memory run, slow, virtual memory running is the equivalent of removing the program from memory to execute, and then put Back. Between the two is the mapping relationship between virtual memory, memory, and CPU is the MMU (memory management Unit) relationship.

ten, Tape

The storage speed is very slow, but the capacity is big, the mobility is strong, the general application is used in the storage domain.

XI. Device Driver and controller

Controller refers to the interface of the device connected to the corresponding one or a group of control chips, He is responsible for receiving commands from the system to control the connected Device.

Device driver refers to the control software for the normal operation of the connected Equipment.

12, Bus and South Bridge and North Bridge

Bus: a public communication trunk that transmits information between various functional parts of a computer. The various parts of the host are connected by bus, and the external device is connected with the bus by the corresponding interface circuit.

With the complication of computer, the increase of information transmission, the faster processing speed, the Single-bus mode no longer applicable, and then the Multi-bus mode Appears. In Multi-bus mode, There is a north bridge and a South Bridge. North bridge, PCI bridges, connected to the cpu, memory and other high-speed equipment, South Bridge is the ISA bridges, connected to hard drives, monitors, USB bus and other Low-speed Devices. meanwhile, the interconnection between the north and South Bridges realizes the interactive communication of Information.

13. Operating system Start-up process

1, power-on equipment;

2, the BIOS run, check the hardware, read the CMOS memory system configuration parameters, Select the boot device;

3, Read the keyboard, light the display, read the system disk configuration file;

4. Read into bootloader start the loading module and start the operating System.

5, the system asks the BIOS obtains the configuration information, checks whether the device driver exists, does not exist prompts the user to Install. The presence is stored in the Kernel.

14. Application Start-up Process

External mouse through the controller pass the operating system move cursor operation double-click Desktop shortcut;

Shortcut through the operating system, call the disk in the corresponding path of the file;

The application runs properly and starts on the Desktop.

Python full stack day02 computer Principle--hardware

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.