当前位置:网站首页>For programmers, those unfamiliar and familiar computer hardware
For programmers, those unfamiliar and familiar computer hardware
2020-11-09 23:53:00 【The way of architect's practice】
As soon as a programmer enters middle age , Before you know it, it will be overwhelming “ The sense of crisis ” Upper body , The boy who used to be no longer there , Time is so fair . Even if you can invent c Language , as time goes on , You are destined to be a slowly wilting eggplant , Slowly darkening grapes .
Watching the news of LETV's delisting , At the weekend, I quickly took my son's little hand , Review from the university that once took the exam ” Full marks “ The computer foundation of , You don't say , After reading only a small part of it, I found a fact , My memory is going down exponentially , The son can memorize , I'm in recession like I didn't go to college .
The original program written by a programmer is actually a program written by 0 and 1 The sequence of bits that make up , Or bit sequences ,8 A bit (bit) Be divided into a group , Called bytes . All the information in the system , Including the data sent over the network , Data in memory and disk files , Procedure, etc , It's all a bunch of bits (bit) It means . If you ask why you have to 8 Bytes? ? Can't Baidu ? I'm not a computer inventor ^_^. One thing may be very important , You can take it and blow water with the interviewer : An identical byte may represent an integer , Floating point numbers , Even strings , The only way to distinguish them is through the context of the data .
By the way , In fact, the way numbers are represented in a computer is a finite value , It's just that some high-level languages handle these values very well , I have to make complaints about it ,JavaScript It's not very good at dealing with this problem , Don't believe you can browser F12 Run it
0.1+0.2
0.30000000000000004
0.01 + 0.05
0.060000000000000005
Get down to business , As one has ” Code changes the world “ The dream programmer , Keep improving your craft , You have to understand the material structure of your true love . No matter how much diao The software runs on the basis of hardware , Although hardware has grown faster in recent years than you are aging , But the core content has hardly changed , This is the naked makeup of your true love .
CPU
Let's roll up this immature Baidu Encyclopedia
a central processor (CPU,central processing unit) As the computing and control core of computer system , It's information processing 、 The final execution unit of the program
To be frank , It's almost the core of the software , It's the engine that interprets and executes instructions . At present, the mainstream cpu At the heart of it is a 32 Bits or 64 position ( It could be even bigger in the future ) A storage device or register of length , It's called a program counter (PC, An abbreviation for egg pain ). At any moment , Program counters point to the address of an instruction in memory .
CPU On the surface, the instructions are executed according to a specific model , This model is determined by the architecture of the instruction set ( Every architecture type is different , That's why there is AMD,Intel). Since the system is powered up , Until the system is powered off ,CPU It's been executing instructions all the time . If there is no actual software execution instruction ? take windows Come on , Software layer virtual out of a “System Idle Process” process , It's called a system idle process , The process will tell cpu Hang up ( Stop working ), So this process is cpu Usage is the opposite of other processes , The higher the usage rate, the more CPU The less pressure .
CPU Read the instruction content from the memory address pointed to by the program counter , And explain that the instruction performs the operation of the instruction , Then update the program counter , Make him point to the next order , And it's very likely that this instruction is not adjacent to the last one . Simply speaking ,cpu The following operations may be performed frequently
- Data loading : Copy a piece of data from main memory to a register , To cover the original contents of the register .
- data storage : Copy a piece of data in a register to a location in main memory , To cover the original location of main memory .
- Command operation : Copy the contents of two registers to the logical unit , The logic unit will perform instruction operations on these two pieces of data , And store the result in a register .
- Command jump : Extract a piece of content from the instruction itself and copy it into the program counter , To override the original value in the program counter .
Main memory
Old rules , There is no knowledge beyond Baidu , A term without Baidu Encyclopedia , It's not very famous
Main memory (Main memory), Main memory for short . It is an important part of computer hardware , Its function is to store instructions and data , And can be done by the CPU (CPU) Direct random access . Modern computers are designed to improve performance , At the same time, the reasonable cost can be taken into account , Multi level storage system is often adopted . That is, the storage capacity is small , High speed cache memory , The main memory with moderate storage capacity and access speed is essential . Main memory stores information by address , Access speed is generally independent of address .
It's a temporary storage device , It is used to temporarily store program contents and processing results during program execution . In terms of Physics , Main memory consists of a set of dynamic random access memory chips ( You can think of it as a row of diodes ), Logically speaking , Main memory is a linear array of bytes , Each byte has a unique address , These addresses are from 0 At the beginning , Now the mainstream of the main existence on personal computers is already 16G Size , Let me still use this 4G The old man who lives is speechless .
Input/output device
The first computer class , The Mediterranean teacher talked about this concept , Although the details have now faded with my hair , But I can still occasionally see IO The word .
IO( Input and output ) It's the connection between the system and the outside world , Like the mouse and keyboard we use every day , Release the pressure to watch small movies on high-definition monitors , Store teacher Cang's disk and so on , These are all part of the I / O device .
Every IO Each device has a controller or adapter , It's a way to interact with the system , It's usually with IO Bus connection . Let's be frank , Every IO Every device has its driver , Otherwise, the system can't use the keyboard and mouse without any reason , Even today's peripherals are drive free .
The system bus
The bus is the bridge connecting the whole system , Physically, it's a set of electronic tubes . He is responsible for carrying information bytes and passing them between components , Like our software system design SOA The bus in . The bus transmits fixed length data according to the number of bits defined by the system , Every system is different , But now the mainstream length is either four bytes (32 position ), Or 8 Bytes (64 position ). From here we can think of ,64 Bit systems are faster than 32 A bit system is twice as fast , Maybe the future will soon enter 128,256 Era?
If you have to add a graph , This is the most representative picture 
More wonderful articles

版权声明
本文为[The way of architect's practice]所创,转载请带上原文链接,感谢
边栏推荐
- Hand in hand to teach you to use container service tke cluster audit troubleshooting
- Exhibition cloud technology interpretation | in the face of emergencies, how does app do a good job in crash analysis and performance monitoring?
- 害怕重构?都怪我太晚和你介绍该如何重构,现在我来了
- Assign the corresponding key and value in the map to the object
- What can CRM system help enterprises do?
- CUDA_ Get the specified device
- 利用尾巴作为时间序列进行处理来识别鲸鱼
- Operation and design of rights management in ERP
- 利用尾巴作为时间序列进行处理来识别鲸鱼
- Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
猜你喜欢

爱康国宾怒斥国信证券报告失实,已发律师函

Error running app: default activity not found solution

接缝雕刻算法:一种看似不可能的图像大小调整方法

Gets the property value of a column in the list collection object

飞鸽传书局域网找不到其他人的问题解决

eleven point nine

mongodb内核源码实现、性能调优、最佳运维实践系列-command命令处理模块源码实现一

Visit 2020 PG Technology Conference

Raspberry pie drum set WiFi

Functional guide for temporary users and novices of PL / SQL developer
随机推荐
LinkedList源码简析
公网IP地址和SSL证书可以提升SEO吗?
jt-day10
函数计算进阶-IP查询工具开发
Centos7 operating system security hardening series (2)
“wget: 无法解析主机地址”的解决方法
Explanation of Z-index attribute
Mongodb kernel source code implementation, performance tuning, best operation and maintenance practice series command processing module source code implementation 1
白山云科技入选2020中国互联网企业百强
Aikang Guobin denounced Guoxin Securities report as untrue and sent a lawyer's letter
Functional guide for temporary users and novices of PL / SQL developer
Nodejs: handwritten koa Middleware
Baishan cloud technology is selected as the top 100 Internet enterprises in China in 2020
消防知识线上答题活动小程序复盘
C / C + + Programming Notes: C language development tank war! In memory of our lost little overlord game
Win7 + vs2015 + cuda10.2 configuration tensorrt7.0
IP address SSL certificate
[leetcode] 92 integer inversion
Formal class D25
Simple use of JMeter