当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Day85: Luffy: shopping cart switching price according to different validity period & shopping cart deletion operation & price settlement & foreplay of order page
- 【LeetCode】 92 整数反转
- [leetcode] 92 integer inversion
- SRM系统是什么系统?SRM供应商管理系统功能
- 11.9
- 自己上手写性能测试工具(二)
- 编码风格:Mvc模式下SSM环境,代码分层管理
- 表单验证,为避免全局污染,少定义全局变量写法
- jt-day10
- Hand in hand to teach you to use container service tke cluster audit troubleshooting
猜你喜欢

做个别人家的网页

Can't find other people's problem to solve

How SSL certificate and public IP address affect SEO

SRM系统是什么系统?SRM供应商管理系统功能

Must see! RDS database all in one

Exhibition cloud technology interpretation | in the face of emergencies, how does app do a good job in crash analysis and performance monitoring?

Validation failed for one or more entities. See 'entityvalidationerrors' solution

IP address SSL certificate

Explanation of Z-index attribute

Function calculation advanced IP query tool development
随机推荐
YouTube subscription: solve the problem of incomplete height display of YouTube subscription button in pop-up window
C++异常实现机制
CUDA_主机内存
编码风格:Mvc模式下SSM环境,代码分层管理
PL/SQL Developer临时用户和新手的功能指南
Common concepts and points for attention of CUDA
js label语法跳出多重循环
Bifrost 位点管理 之 异构中间件实现难点(1)
C++ exception implementation mechanism
CUDA_ Host memory
Important components of Apache Hadoop
leetcode之最后一个单词的长度
Fear of reconstruction? I'm too late to tell you how to refactor. Now I'm here
《Python Cookbook 3rd》笔记(2.1):使用多个界定符分割字符串
C / C + + Programming Notes: C language development tank war! In memory of our lost little overlord game
Operation and design of rights management in ERP
Function calculation advanced IP query tool development
【CentOS7操作系统安全加固系列】第(2)篇
Prometheus安装配置
Technical point 5: XML language