Day 1 Python入门

思维导图1

 

一 python是一门编程语言

编程语言 programming language

计算机编程语言是指用于人与计算机之间通信的语言,是人与计算机之间传递信息的,因为它是用来进行程序设计的,所以又称程序设计语言或者编程语言。

A programming language is a formal language comprising a set of instructions that produce various kinds of output. Programming languages are used in computer programming to implement algorithms.

编程 programming

编程是编定程序的中文简称,就是让计算机代码解决某个问题,对某个计算体系规定一定的运算方式,使计算体系按照该计算方式运行,并最终得到相应结果的过程。

Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a specific task.

程序 program

计算机程序是一组计算机能识别和执行的指令,运行于电子计算机上,满足人们某种需求的信息化工具。

进程 process

进程(Process)是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。在早期面向进程设计的计算机结构中,进程是程序的基本执行实体;在当代面向线程设计的计算机结构中,进程是线程的容器。程序是指令、数据及其组织形式的描述,进程是程序的实体。

为何要编程

为了让计算机按照人类的思维逻辑(程序)自发地去工作从而把人力解放出来

The purpose of programming is to find a sequence of instructions that will automate the performance of a task (which can be as complex as an operating system) on a computer, often for solving a given problem.

 

二 计算机硬件

1.计算机的五大组成部分:

控制器 control unit

计算机的指挥系统

This is the core unit which manages the entire functioning of the computer device. It is one of the most essential components of the computer system.

The Control Unit collects the data entered using the input unit, leads it on for processing and once that is done, receives the output and presents it to the user. It can be said to the centre of all processing actions taking place inside a computer device.

Basically, the instructions taken, interpretation of entered data, issuing signals to execute the data and then finally retrieving the data is all done in the Control Unit.

运算器 arithmetic and logical unit

实现算术运算和逻辑运算的部件

As the name suggests, all the mathematical calculations or arithmetic operations are performed in the Arithmetic and Logical Unit of the CPU.

It can also perform actions like a comparison of data and decision-making actions. The ALU comprises circuits using which addition, subtraction, multiplication, division and other numerical based calculations can be performed.

控制器+运算器=CPU (Central Processing Unit)

相当于人类的大脑

存储器 memory or storage unit

是计算机中用来存放所有数据和程序的记忆部件,它的基本功能是按指定的地址存入或者取出信息。

内存 Internal storage

基于电工作,存放的是电信号

特点:存取速度快,断电消失

相当于人的短期记忆

外存 External storage

机械磁盘HDD

Hard disk drive:基于磁工作

特点:存取速度远慢于内存,断电数据不丢失,永久保存数据

相当于人的记事笔记本

输入设备 input unit

输入设备是计算接收外界输入数据的工具,如键盘、鼠标,相当于人的眼睛或耳朵。

A computer will only respond when a command is given to the device. These commands can be given using the input unit or the input devices.

For example: Using a keyboard we can type things on a Notepad and the computer processes the entered data and then displays the output of the same of the screen.

The data entered can be in the form of numbers, alphabet, images, etc. We enter the information using an input device, the processing units convert it into computer understandable languages and then the final output is received by a human-understandable language.

输出设备 output unit

输出设备是计算机向外输出数据的工具,如显示器、打印机,相当于人说的话,写出的文章。

When we command a computer to perform a task, it reverts back for the action performed and gives us a result. This result is called output. There are various output devices connected to the computer. The most basic of which is a monitor. Whatever we write using a keyboard or click using a mouse, is all displayed on the monitor.

Thus, the output unit gives us the final result once the entire processing is done within the mechanism of a device.

For example: when we visit an ATM, we enter our details like language, pin, amount to be withdrawn, etc. and then the final money which the cash dispenser releases is our outcome. In this case, the cash dispenser acts as an output unit.

存储器如内存、磁盘等既是输入设备又是输出设备,统称为IO设备

When we enter the data into the computer using an input device, the entered information immediately gets saved in the memory unit of the Central Processing Unit (CPU). Because of the presence of some existing programming, the Memory Unit transmits the data further to the other parts of the CPU.

Similarly, when the output of our command is processed by the computer, it is saved in the memory unit before giving the output to the user.

2.软件的运行与三大核心硬件的关系

三大核心硬件: 中央处理器, 内存,硬盘

中央处理器 CPU Central Processing Unit
CPU的分类
精简指令集 RISC

Reduced instruction set computer

复杂指令集 CISC

Complex instruction set computer

CPU按照指令集可以分为精简指令集CPU和复杂指令集CPU两种,区别在于前者的指令集精简,每个指令的运行时间都很短,完成的动作也很单纯,指令的执行效能较佳;但是若要做复杂的事情,就要由多个指令来完成。后者的指令集每个小指令可以执行一些较低阶的硬件操作,指令数目多而且复杂,每条指令的长度并不相同。因为指令执行较为复杂所以每条指令花费的时间较长,但每条个别指令可以处理的工作较为丰富
x86架构64位
x86-64是一个处理器的指令集架构,基于x86架构的64位拓展,向后兼容于16位及32位的x86架构。
4核 8线程CPU

多核心处理器 Multi-core processor

是在单个计算组件中加入两个或以上的独立实体中央处理单元(简称核心,英语:Core)。这些核心可以分别独立地运行程序指令,利用并行计算的能力加快程序的运行速度。

多线程 Multithreading

指从软件或者硬件上实现多个线程并发执行的技术。

内存 RAM Random Access Memory
buffer 缓冲

In computer science, a data buffer (or just buffer) is a region of a physical memory storage used to temporarily store data while it is being moved from one place to another.

缓冲器为暂时置放输出或输入资料的存储器。

缓冲器内资料自存储设备(如硬盘),放置在缓冲器中,须待机送至CPU或其他运算设备。

(linux不能随便清)

cache 缓存

In computing, a cache is a hardware or software component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewhere.

高速缓存简称缓存,原始意义是指访问速度比一般随机存取存储器(RAM)快的一种RAM,通常它不像系统主存那样使用DRAM技术,而使用昂贵但较快速的SRAM技术。

硬盘

磁道

扇区 512字节 硬盘最小存储单位

柱面

机械硬盘HDD hard disk drive

IO延迟=平均寻道时间+平均延迟时间

一般小于20毫秒为可以接受

平均寻道时间 5毫秒

平均延迟时间 转速(7200转 大约4毫秒)

固态硬盘SSD Solid-state drive
虚拟内存 Virtual Memory

In computing, virtual memory is a memory management technique that provides an "idealized abstraction of the storage resources that are actually available on a given machine"which "creates the illusion to users of a very large memory".

虚拟内存是计算机系统内存管理的一种技术。它使得应用程序认为它拥有连续可用的内存(一个连续完整的地址空间),而实际上,它通常是被分隔成多个物理内存碎片,还有部分暂时存储在外部磁盘存储器上,在需要时进行数据交换。与没有使用虚拟内存技术的系统相比,使用这种技术的系统使得大型程序的编写变得更容易,对真正的物理内存(例如RAM)的使用也更有效率。

程序最先是存放于硬盘中的,程序的运行是先从硬盘把代码加载到内存中,然后cpu是从内存中读取指令运行。

 

三 操作系统

计算机系统三层结构

应用程序

包括各类语言的解释器以及图形界面程序

(面向用户)

操作系统 OS

Operating System

包含内核和系统接口层

(面向程序员)

计算机硬件

 

补充知识

1.马云与埃隆马斯克对话

对话全文实录:https://www.ifanr.com/1253696

2.《模仿游戏》

二战期间,英国剑桥大学的教授艾伦·图灵(本尼迪克特·康伯巴奇 饰)获军情六处秘密任命,与一群专家组成解密组,试图破解由纳粹德国独创,号称世上最精密的情报机器——“Enigma”密码机。图灵独具才能,被丘吉尔任命为组内的领导人,但其古怪的脾气却使他受到组员的抵制,过程遭遇重重挫折,幸好在聪明艳丽的新成员琼恩·克拉克(凯拉·奈特莉 饰)的鼓励下,图灵主动打破和同僚的隔阂,最终合力研发出破译地方机密的装置,超过1400万人得以避开战火,而世上电脑的雏形亦宣告在那刻诞生。然而战后多年,图灵却被揭发自己的同性恋倾向,而被英国政府入罪...

3.爱迪生和特斯拉

https://www.zhihu.com/question/20926563/answer/987769444?utm_source=wechat_timeline

4.量子计算机 Quantum computer

是一种使用量子逻辑进行通用计算的设备。不同于电子计算机(或称传统计算机),量子计算用来存储数据的对象是量子比特,它使用量子算法来进行数据操作。马约拉纳费米子反粒子就是自己本身的属性,或许是令量子计算机的制造变成现实的一个关键。量子计算机在舆论中有时被过度渲染成无所不能或速度快数亿倍等,其实这种计算机是否强大极度看问题而定,若该问题已经有提出速算的量子算法只是困于传统计算机无法执行,那量子计算机确实能达到未有的高速,若是没有发明算法的问题则量子计算机表现与传统无异甚至更差

 

posted @ 2020-12-15 16:23  fengshili0721  阅读(191)  评论(0编辑  收藏  举报