当前位置:网站首页>Principles, language, compilation, interpretation
Principles, language, compilation, interpretation
2022-07-02 15:07:00 【An engineering man who wants to be a writer】
Preface
Study Principles and language of computer Content !
List of articles
One 、 Hardware and software
Hardware : Things that can be seen and touched , for example , mouse 、 keyboard 、 Monitor .
Software : Things that can't be seen or touched , for example , Programs installed on the computer ,qq And wechat .
Two 、 The three principles
Computers are essentially performing :“ Input -> operation -> Output ” step , Most of what computers do is these three steps .
for example , Enter information on the keyboard , Click the relevant buttons of some programs to calculate , And then on the screen result .
for example , See a movie : Search for ( Input )-> Networking requests ( operation )-> Show search results ( Output ).
Input 、 Operations and output operations are data .A set of instructions and data is a program .
Program : The program is Instructions and data Set , Instructions are also a special kind of data .
Instructions : Do not participate in the operation , It's about controlling operations , An instruction is an order . Control how the computer inputs , operation , Output . Analogy work in which the leader gives you orders , Arrange a task , You are responsible for completing . Every line of code we write can be regarded as an instruction to the computer , Instructions can be combined .
data : It can be divided into two kinds , Input data and output data . No matter how complicated the program is , It is essentially a collection of data and instructions .The information processed by the computer is all digital -> Binary system -> Data is stored in memory in binary form .
written words , video , How to express colors in numbers ?
Color :RGB.
written words : You need to use numbers to represent the computer to understand , By character encoding .
Computers only know numbers , That only needs to show the information as a number one A corresponding mapping table is not enough ?ASCIICode is to convert words into numbers recognized by computer .
3、 ... and 、 Computer language
Computer language is for both sides , One is Computer , The other is people , It is a connection between computer and human bridge .
Or the language is computer friendly , Or be friendly . Friendly to people is called High-level language , Computer friendly is called Low level language .
- Low level language
- machine language : Machine language is also called native code , Is the native language of computer (
0and1Two programming languages written in binary numbers ), Can be directly recognized by the computer , No additional translation is required , Computer friendly . - assembly language : take
0and1Put together data that contains specific instructions and give it a name , Use English letters to indicate , This kind of thing is called Mnemonic symbol .
- machine language : Machine language is also called native code , Is the native language of computer (
- High-level language
Four 、 Compilation and interpretation
clear : Whether compiling or interpreting , It's all... In essence translate , Translation is to translate a program into another state . for example , Translate English into Chinese , Translate the source code of the program we wrote into the machine language that the computer can execute, that is, the form of binary ( The ultimate purpose of Translation ), To complete the work .
- compile
It is to translate all source code into machine language at one time , Fast execution . - explain
Not a one-time translation , When the program is executed , Translate the source code into machine language one by one , Slow execution . - difference
compile : After the program is compiled, another set of Storable Code for . for example ,javaCompile and generate bytecode , Is storable .
explain : Explain and execute , Explain one thing and execute another , The process is Do not generate storable Code for
summary : compile When translating and executing Separate Of , and explain It is Sync On going
5、 ... and 、 Translation and execution
- Translated Purpose : Generate code in another format , take
AbecomeBThe process of ,BCan be executed directly by the computer . - compile : One step in place , Directly translate the source code into the target machine code ( machine language ), It can run directly . The emphasis is on one-off , Translate the source code directly into machine code , If you want to run, you can directly read the run .
- explain :
AbecomeB,BIt's not machine language , It cannot be directly executed by the computer , It belongs to a kind of intermediate code , It needs to be translated into target machine code again ( machine language ) To be executed by a computer . The process of retranslation is generally interpretation , The emphasis is to translate again , That is to translate one by one , Translate and execute . - perform : The ultimate goal of execution is to run in the computer , To run, you need to perform the previous translation process .
5、 ... and 、 The two forms are combined
- Compile implementation : It is to translate the source program into the target machine code in one step , And then run directly .
- Explain to perform : Intermediate code to be generated , It's not the source program anymore , Then translate the intermediate code one by one into the target machine code , Translate one , To perform a , That is, execute while translating . for example ,
java, The intermediate code isclassfile , Bytecode .javaThe original document :xx.java, Generate intermediate code after compilation :xx.classBytecode file , It needs to be interpreted into the target machine code again for execution .
6、 ... and 、 compile
python First translate into intermediate code , Then give it to a specific ·python· The interpreter interprets and executes the generated object code , And then run .c c++ It's a compiled language , Translate the source program at one time ( compile ) Into machine code , And then run .
边栏推荐
- 解决el-radio-group 回显后不能编辑问题
- MFC 控制台打印,弹出对话框
- taobao. logistics. dummy. Send (no logistics delivery processing) interface, Taobao store delivery API interface, Taobao order delivery interface, Taobao R2 interface, Taobao oau2.0 interface
- 如何用 Sysbench 测试 TiDB
- forEach的错误用法,你都学废了吗
- Internet Explorer officially retired
- Reuse and distribution
- About text selection in web pages and counting the length of selected text
- info [email protected] : The platform “win32“ is incompatible with this module.
- C#延时、在线程中开启定时器、获取系统时间
猜你喜欢

How does CTO help the business?

Kityformula editor configure font size and spacing

mathML转latex

Tmall product details interface (APP, H5 end)

Edit the formula with MathType, and set it to include only mathjax syntax when copying and pasting
[email protected]: The platform “win32“ is incompatible with this module."/>info [email protected]: The platform “win32“ is incompatible with this module.

【NOI模拟赛】伊莉斯elis(贪心,模拟)

Onnx+tensorrt: write preprocessing operations to onnx and complete TRT deployment

TiDB数据迁移工具概览

Ad20 cannot select the solution of component packaging in PCB editor
随机推荐
[noi simulation] Elis (greedy, simulation)
C# richTextBox控制显示最大行数
编译原理课程实践——实现一个初等函数运算语言的解释器或编译器
Key points of compilation principle examination in 2021-2022 academic year [overseas Chinese University]
Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly
LeetCode 2310. 个位数字为 K 的整数之和
taobao. trade. Get (get some information of a single transaction), Taobao store order interface, Taobao oauth2.0 interface, Taobao R2 interface code docking and sharing
Base64 编码原来还可以这么理解
Some Chinese character codes in the user privacy agreement are not standardized, which leads to the display of garbled codes on the web page. It needs to be found and handled uniformly
[untitled] leetcode 2321 Maximum score of concatenated array
MFC console printing, pop-up dialog box
Printf function and scanf function in C language
LeetCode_滑动窗口_中等_395.至少有 K 个重复字符的最长子串
Introduction to mathjax (web display of mathematical formulas, vector)
Fundamentals of software testing
CTO如何帮助业务?
Btrace- (bytecode) dynamic tracking tool
Introduction to C language -- array
Sharp tool SPL for post SQL calculation
C语言中的算术运算及相关练习题