Inside your computer - Bettina Bair

深入你的电脑- 贝蒂娜 贝尔

3,110,631 views ・ 2013-07-01

TED-Ed


请双击下面的英文字幕来播放视频。

翻译人员: Boxi Sun 校对人员: Zhiting Chen
00:15
Do you remember when you first realized
0
15353
1861
还记得你是什么时候第一次发现
00:17
that your computer was more
1
17238
1397
你的计算机不仅仅
00:18
than just a monitor and keyboard?
2
18659
2059
只是一个显示器和键盘的?
00:20
That between the mouse click and the video playing,
3
20742
2559
从鼠标的点击到视频播放,
00:23
there was something that captured your intention,
4
23325
2334
这之间有什么东西捕捉到了你的意图,
00:25
understood it,
5
25683
721
理解了它,
00:26
and made it real?
6
26428
1452
并将其变为现实?
00:28
What is that something?
7
28650
1596
这个东西到底是什么?
00:30
Is it gremlins?
8
30270
1713
难道是小妖精?
00:32
Let's imagine that we can shrink down
9
32007
1762
让我们假想一下自己可以缩小
00:33
to the size of an electron
10
33793
1324
到和一个电子那么大
00:35
and inject ourselves into a click of a mouse.
11
35141
2729
并把自己注入到鼠标的一次点击中去。
00:37
If you took your mouse apart,
12
37894
1613
如果你把鼠标拆解了,
00:39
you'd see that it's really a very simple machine.
13
39531
2638
你会看到其实它是一个非常简单的机械设备。
00:42
It has a couple buttons
14
42193
1227
它有一对按键
00:43
and a system for detecting motion and distance.
15
43444
3279
和一个用于检测动作和距离的系统
00:46
You might have an optical mouse
16
46747
1477
你用的可能是光电鼠标
00:48
that makes these measurements with lights and sensors,
17
48248
2596
它借助光以及传感器来完成这些检测,
00:50
but older ones did this with a hard rubber ball
18
50868
2239
但老款鼠标通过一个硬橡胶球
和几个塑料轮子来完成。
00:53
and some plastic wheels.
19
53131
1421
00:54
Same concept.
20
54576
1725
同样的原理。
00:56
When you click the button on your mouse,
21
56325
1565
当你点击鼠标上的按键时,
00:57
it sends a message to the computer
22
57914
1778
它会发向电脑发出一个
00:59
with information about its position.
23
59716
2085
包含其位置信息的消息。
01:01
When your mouse click is received,
24
61825
1642
当你的鼠标点击消息被收到,
01:03
it's handled by the basic input/output subsystem.
25
63491
3365
它会被基本输入/输出子系统来处理。
01:06
This subsystem acts like the eyes and ears
26
66880
2540
这个子系统的作用就像是计算机的眼睛,耳朵,
01:09
and mouth and hands of the computer.
27
69444
2585
嘴和手一样。
01:12
Basically, it provides a way for the computer
28
72053
2143
它主要给计算机提供了一个与
其外界环境交互的途径。
01:14
to interact with its environment.
29
74220
2199
01:16
But it also acts like a buffer
30
76443
1623
但它也同时起到了缓冲的作用
01:18
to keep the CPU from being overwhelmed by distractions.
31
78090
3387
以保证中央处理器不至于被干扰信息所淹没。
01:21
In this case, the I/O subsystem decides
32
81501
2286
这里,输入输出子系统决定
01:23
that your mouse click is pretty important
33
83811
2107
你的鼠标点击信息非常重要
01:25
so it generates an interrupt to the CPU.
34
85942
2973
所以它生成了一个打断信号并发给了中央处理器。
01:28
"Hey, CPU! Got a click here."
35
88939
2136
“嘿,中央处理器!这儿有一个点击信息。”
01:31
The CPU, or central processing unit,
36
91952
2351
CPU,全称是中央处理器,
01:34
is the brains of the whole computer.
37
94327
2171
是整个计算机的大脑。
01:36
Just like your brain doesn't take up your whole body,
38
96522
2526
就像你的大脑不会占据你的整个身体一样,
01:39
the CPU doesn't take up the whole computer,
39
99072
2481
中央处理器也不会占据整个计算机,
01:41
but it runs the show all the same.
40
101577
2661
但尽管如此,它还是操控着整个计算机。
01:44
And the CPU's job, its whole job,
41
104262
2220
中央处理器的任务,也是它的全部任务,
01:46
is fetching instructions from memory
42
106506
1914
就是从内存里获取指令
01:48
and executing them.
43
108444
1983
并执行计算。
01:50
So, while you're typing, typing, typing,
44
110451
1905
所以,当你在不断地敲击键盘,
01:52
maybe really fast,
45
112380
1206
速度可能真的很快,
01:53
like 60 words a minute,
46
113610
1454
比如一分钟60个字,
01:55
the CPU is fetching and executing
47
115088
1978
中央处理器也在获取和执行
01:57
billions of instructions a second.
48
117090
2023
每秒数以亿计的的指令。
01:59
Yes, billions every second:
49
119137
3015
是的,每秒数以十亿计:
02:02
instructions to move your mouse around on the screen,
50
122176
2782
这些指令包括你在屏幕上挪动鼠标,
02:04
to run that clock widget on your desktop,
51
124982
2139
在桌面上运行一个时钟组件,
02:07
play your internet radio,
52
127145
1723
运行网络收音机,
02:08
manage the files you're editing on the hard drive,
53
128892
2381
管理你在硬盘上编辑的文件,
02:11
and much, much more.
54
131297
1579
如此等等。
02:12
Your computer's CPU is one heck of a multitasker!
55
132900
3260
你计算机的中央处理器是个真正的处理多任务的能手!
02:16
"But oh my gosh
56
136439
1150
“但我的天啊
02:17
there's a very important mouse click
57
137613
1272
现在有一个非常重要的鼠标点击信息
02:18
coming through now!
58
138909
1097
正传进来!
02:20
Let's drop everything now and deal with that!"
59
140030
2530
让我们先把其他的事情放一放来处理它!“
02:23
There are programs for everything
60
143207
1572
中央处理器处理每个任务
02:24
that the CPU does.
61
144803
1509
都有其对应的程序。
02:26
A special program for the mouse,
62
146336
1698
一个专门的鼠标程序,
02:28
for the clock widget,
63
148058
1010
专门的时钟组件的程序,
02:29
for the internet radio,
64
149092
1187
专门的网络收音机的程序,
02:30
and for dealing with letters sent by the keyboard.
65
150303
2809
和专门的用于处理键盘打出的字母的程序。
02:33
Each program was initially written by a human
66
153136
2528
每个程序最开始都是人们
02:35
in a human-readable programming language,
67
155688
2194
用人类可读的编程语言来编写的,
02:37
like Java,
68
157906
835
像Java语言,
02:38
C++,
69
158765
1009
C++语言,
02:39
or Python.
70
159798
1397
或者Python语言。
02:41
But human programs take up a lot of space
71
161219
2498
但人工程序会占据很大的空间
02:43
and contain a lot of unnecessary information to a computer,
72
163741
3685
而且包含很多的对计算机来说不必要的信息,
02:47
so they are compiled and made smaller
73
167450
1762
所以它们会通过编译被缩小
02:49
and stored in bits of ones and zeros in memory.
74
169236
3393
并记录在许多由0和1二进制位组成的信息里存入内存。
02:52
The CPU realizes that it needs instructions
75
172653
2733
中央处理器发现他需要指令
02:55
for how to deal with this mouse click,
76
175410
1977
来明白如何去处理这次鼠标点击,
02:57
so it looks up the address for the mouse program
77
177411
2286
所以他去查询鼠标程序的地址
02:59
and sends a request to the memory subsystem
78
179721
2351
并向内存子系统发出一个请求
来获取存储在相应位置的指令。
03:02
for instructions stored there.
79
182096
2083
03:05
Each instruction in the mouse device driver
80
185287
2048
每个在鼠标设备驱动器里的指令
03:07
is duly fetched and executed.
81
187359
2359
都会被及时的获取并加以执行。
03:09
And that's not nearly the end of the story!
82
189742
2347
可这还远远没有结束!
03:12
Because the CPU learns that the mouse was clicked
83
192113
2517
因为中央处理器得知鼠标在被点击的时候
03:14
when the cursor was over a picture
84
194654
1620
光标是在显示器屏幕里
03:16
of a button on the monitor screen,
85
196298
1855
的一个按钮图片上的。
03:18
and so, the CPU asks memory for the monitor program
86
198177
3047
所以,中央处理器会从内存里获取显示程序
03:21
to find out what that button is.
87
201248
2081
来弄清这个按钮是什么。
03:23
And then the CPU has to ask memory
88
203353
2224
接着,中央处理器会从内存中
03:25
for the program for the button,
89
205601
1812
获取这个按钮的程序,
03:27
which means that the CPU needs
90
207437
1487
这意味着中央处理器需要再次调用
03:28
the monitor program again
91
208948
1716
显示程序
03:30
to show the video associated with the button,
92
210688
2148
来显示与这个按钮相关联的视频,
03:32
and so it goes.
93
212860
1858
这样视频才能得以播放。
03:34
And let's just say there are a lot of programs involved
94
214742
2721
可以说,甚至在你点击
03:37
before you even see the button on the screen
95
217487
2096
屏幕上的这个按钮使其高亮之前
03:39
light up when you clicked it.
96
219607
1748
已经有很多的相关程序被调用了。
03:41
So, just the simple task of clicking your mouse
97
221379
2445
所以,仅仅一个简单的点击鼠标的任务
03:43
means visiting all of the critical components
98
223848
2344
意味着要访问你计算机架构里
03:46
of your computer's architecture:
99
226216
1956
所有的重要组成部分:
03:48
peripherals,
100
228196
1018
外设,
03:49
the basic input-output system,
101
229238
1785
基本输入-输出系统,
03:51
the CPU,
102
231047
1308
中央处理器
03:52
programs,
103
232379
751
程序,
03:53
and memory,
104
233154
962
和内存,
03:54
and not one gremlin.
105
234140
1993
和小妖精一点儿关系没有。
关于本网站

这个网站将向你介绍对学习英语有用的YouTube视频。你将看到来自世界各地的一流教师教授的英语课程。双击每个视频页面上显示的英文字幕,即可从那里播放视频。字幕会随着视频的播放而同步滚动。如果你有任何意见或要求,请使用此联系表与我们联系。

https://forms.gle/WvT1wiN1qDtmnspy7