Computers & Components
A-Level Computer Science Topic 3 22:40 English narration · English + 中文 subtitles burned in
Chapters
Transcript
Open up any computer — past the case, past the chips, all the way down to the silicon — and you find switches.
打开任何一台计算机——穿过外壳,穿过芯片,一直深入到硅片——你会发现开关。 不是成千, 而是数十亿个。
Not thousands. Billions. And each one does something almost absurdly simple: it answers a single yes-or-no question.
而每一个都在做一件近乎荒谬地简单的事:它回答一个"是"或"否"的问题。
Yes and yes.
是且是。
This or that. Not this.
这个或那个。
Stack enough of these tiny decisions together, and out of pure yes and no, you build everything: a spreadsheet, a game, an entire world.
不是这个。 把足够多这样微小的决定叠在一起, 仅仅从"是"和"否"里,你就造出了一切:一张电子表格、一个游戏、一整个世界。
A computer is switches, memory, and the parts around them.
一台计算机,就是开关、存储器,以及它们周围的部件。
Today: the building blocks, memory and storage, the logic gates that make every decision, wiring them into circuits, and how machines sense and control the world.
今天:基本组成、存储器与存储、 做出每一个决定的逻辑门、把它们连成电路,以及机器如何感知和控制这个世界。
Let's begin.
让我们开始吧。
Every computer has four parts, plus a brain.
每一台计算机都有四个部分,再加一个大脑。
Input devices bring data in — a keyboard, a mouse, a sensor.
输入设备把数据送进来——键盘、鼠标、传感器。
Output devices send results out — a screen, a speaker.
输出设备把结果送出去——屏幕、扬声器。
The processor, the CPU, does the actual thinking.
处理器,也就是 CPU,负责真正的思考。
Primary memory — RAM — holds the program it is running right now, close at hand.
主存储器——RAM——就近保存它此刻正在运行的程序。
And secondary storage — a disk — keeps everything else safe for later, even when the power is off.
而辅助存储器——磁盘—— 把其余的一切安全地留到以后,哪怕断了电。
Look at the input devices you already own.
看看你已经拥有的输入设备。
A keyboard turns key presses into character codes.
键盘把按键变成字符编码。
A mouse reports movement and clicks.
鼠标报告移动和点击。
A microphone captures sound, and a scanner turns a paper page into a digital image.
麦克风采集声音, 扫描仪把一页纸变成数字图像。
Sensors feed in temperature, light and motion.
传感器送进温度、光线和运动。
Output devices run the other way: a monitor displays the screen image, speakers make sound, a printer puts ink on paper, and an actuator moves something in the physical world.
输出设备则反向: 显示器显示屏幕图像,扬声器发出声音,打印机把墨印在纸上,执行器让物理世界里的东西动起来。
One machine, two directions — data in, results out.
同一台机器,两个方向——数据进来,结果出去。
Two kinds of memory, and the difference is worth exact words.
两种存储器,它们的区别值得用准确的词说清。
Primary memory is the memory the processor reaches directly — that is RAM and ROM.
主存储器是处理器能直接访问的存储器—— 也就是 RAM 和 ROM。
It holds the program running right now and that program's data.
它保存此刻正在运行的程序,以及这个程序的数据。
Fast, and small.
快,而且小。
Secondary storage is slower and far larger, and it keeps programs and data while they are not in use: a hard disk, an SSD, an optical disc, a USB stick.
辅助存储器更慢、大得多,它在程序和数据不使用时把它们保存下来:硬盘、固态硬盘、光盘、U 盘。
Switch off, and primary memory empties.
一断电,主存储器就空了。
Secondary storage still remembers.
辅助存储器仍然记得。
The syllabus asks why each is needed, so answer with a reason, not a description.
考纲问的是每一类「为什么需要」,所以要用理由来回答,不是描述。
Input devices are needed because the computer can only work on data and instructions that have been entered.
需要输入设备,是因为计算机只能处理已经被输入进来的数据和指令。
Output devices are needed to present results in a form people can use.
需要输出设备,是为了把结果呈现成人能使用的形式。
Primary memory is needed because the processor can only execute instructions and use data held in memory it can address directly, and it must reach them fast.
需要主存储器,是因为处理器只能执行它可以直接寻址的内存中的指令和数据, 而且必须很快地取到它们。
Secondary storage is needed because primary memory is volatile and small: programs and data must survive the power being switched off, in a larger and cheaper store — and removable storage lets data be carried between computers or kept as a backup.
需要辅助存储器,是因为主存储器易失而且容量小: 程序和数据必须在断电之后仍然存在,存放在更大也更便宜的地方—— 而可移动存储让数据能在计算机之间携带,或者作为备份保存。
Not every computer looks like a computer.
不是每一台计算机都长得像计算机。
An embedded system is a computer built into another device to do one fixed job.
嵌入式系统是内置在另一台设备里、只做一件固定工作的计算机。
No keyboard, no screen you would recognise, and it never runs anything else.
没有键盘,没有你认得出的屏幕,它也从不运行别的东西。
Look around you: a washing machine choosing a cycle, a microwave counting down, an engine management unit metering fuel, a thermostat watching the room.
看看你身边:洗衣机在选择洗涤程序, 微波炉在倒计时,发动机管理单元在计量燃油,恒温器在盯着房间。
Each has a processor, memory and a program — permanently dedicated to that single task.
每一个都有处理器、存储器和程序——永久地专用于那一件事。
The benefits follow from doing one thing.
好处来自只做一件事。
Hardware chosen for a single task can be small, cheap and low-power; it starts almost instantly; it is reliable, because there is less to go wrong; and in volume it costs very little.
为单一任务挑选的硬件可以做到又小、又便宜、又低功耗;它几乎瞬间启动; 它可靠,因为可能出错的东西更少;大量生产时成本极低。
But the drawbacks are the same coin turned over.
但缺点是同一枚硬币的反面。
It is limited to that one task.
它被限制在那一件工作上。
Updating it is hard — its firmware may need special tools.
更新它很难——它的固件可能需要专用工具。
It is often not repairable, and its security is sometimes weak.
它往往无法维修,安全性有时也很弱。
Now the principal hardware devices, one at a time.
现在一件一件看主要的硬件设备。
A laser printer begins with a laser scanning the page image onto a photosensitive drum that has been given an electric charge.
激光打印机先用激光把页面图像扫到一个带了电荷的感光鼓上。
Where the laser strikes, the charge pattern draws the page.
激光扫过的地方,电荷图案就画出了这一页。
Toner — a fine ink powder — sticks to the charged areas, and the drum rolls it onto the paper.
墨粉——一种很细的墨粉末——粘在带电的区域上, 鼓再把它滚到纸上。
Then a fuser heats the powder so it melts and bonds.
然后定影器加热粉末,让它熔化并牢牢粘住。
Fast, sharp, built for high volume.
快、清晰,为大批量而生。
A 3D printer works the other way round: it builds a solid object layer by layer.
3D 打印机反过来做:它一层一层地把实体物件搭起来。
The commonest kind, FDM, melts plastic filament and squeezes it through a hot nozzle, drawing one thin slice, then the next on top, until the object stands up.
最常见的一种叫 FDM,它熔化塑料丝, 从一个热喷嘴里挤出来,画出薄薄的一层,再在上面画下一层,直到物件立起来。
Stereolithography instead cures liquid resin with an ultraviolet laser, hardening one layer at a time.
光固化成型则用紫外激光把液态树脂一层层固化。
Both are used for prototypes, and for custom medical parts shaped to one patient's body.
两者都用来做原型件, 也用来做按某一位病人身体定制的医疗部件。
The sequence starts before the printer: a model of the object is designed in CAD software, or scanned from a real object, then sliced into layers for the printer to build up one at a time.
这个流程在打印机之前就开始了: 物体的模型先在 CAD 软件里设计出来,或者从实物扫描得到, 然后被切成一层一层,交给打印机一层层堆起来。
A microphone turns sound into an electrical signal.
麦克风把声音变成电信号。
Sound is moving air, so it pushes a thin sheet called a diaphragm back and forth.
声音是流动的空气,所以它推着一片叫振膜的薄膜来回运动。
That movement either changes the charge on a capacitor or drags a coil past a magnet — either way the signal copies the shape of the sound wave.
这个运动要么改变电容器上的电荷,要么让线圈在磁铁旁移动——不管哪种,信号都复制了声波的形状。
It is still analogue, so an analogue-to-digital converter samples it into numbers.
它仍然是模拟的,所以要用模数转换器把它采样成数字。
A speaker runs the same physics backwards: a varying current in a coil, inside a magnetic field, moves a cone, and the cone moves the air.
扬声器把同样的物理反过来做: 线圈里变化的电流处在磁场中,推动纸盆运动,纸盆再推动空气。
A magnetic hard disk stores data on platters — rigid discs coated with magnetic material, spinning thousands of times a minute.
磁性硬盘把数据存在盘片上——涂了磁性材料的坚硬圆盘,每分钟旋转几千圈。
Each surface is divided into concentric tracks, and every track is divided into sectors, so a block of data has an address: this surface, this track, this sector.
每个盘面被分成一圈圈同心的磁道,每条磁道又被分成扇区, 于是每一块数据都有地址:哪个盘面、哪条磁道、哪个扇区。
A read/write head floats a fraction of a hair above the surface.
读写头浮在盘面上方,高度不到一根头发丝。
To write, it magnetises tiny regions one way or the other; to read, it senses the magnetism already there.
写的时候,它把极小的区域磁化成这个方向或那个方向; 读的时候,它感应已经在那里的磁性。
Cheap per gigabyte, but slower than flash, with moving parts that can fail.
每 GB 便宜,但比闪存慢,而且有可能损坏的活动部件。
How it works, in the order the marks are given: the platters spin at thousands of revolutions per minute; each surface is divided into concentric tracks and each track into sectors; and the read/write heads sit on actuator arms that move them to the right track while the platter's rotation brings the right sector underneath.
它的工作方式,按给分的顺序说: 盘片以每分钟数千转的速度旋转; 每个盘面被分成一圈圈同心的磁道,每条磁道再分成扇区; 读写磁头装在音圈臂上,由臂把磁头移到正确的磁道, 再由盘片的旋转把正确的扇区送到磁头下面。
A solid-state drive holds the same data with nothing spinning.
固态硬盘保存同样的数据,却没有任何东西在转。
Each bit is charge trapped in transistors, read electrically.
每一位都是被困在晶体管里的电荷,用电的方式读出。
Because there are no moving parts — no head to swing, no platter to wait for — random access is far faster, and the drive survives being dropped and uses less power.
因为没有活动部件——没有要摆动的磁头,也不用等盘片转过来——随机访问快得多, 摔了也不容易坏,还更省电。
Two costs: it is dearer per gigabyte, and each cell wears out after many thousands of writes, so the controller spreads writes around to make it last.
两个代价:每 GB 更贵,而且每个单元在写过成千上万次之后会磨损, 所以控制器会把写操作分散开,让它用得更久。
An optical disc — a CD, a DVD, a Blu-ray — carries its data as a spiral of tiny pits pressed or burned into the surface.
光盘——CD、DVD、蓝光盘——把数据做成一条螺旋线上极小的凹坑,压出来或烧出来。
A low-power laser shines on the track, and the light reflects differently from a pit than from the flat land beside it.
一束低功率激光照在轨道上,凹坑反射回来的光和旁边平坦的地方不一样。
The drive turns that change in reflection into ones and zeros.
驱动器把这个反射变化变成一和零。
To write, the same drive uses a stronger laser to alter the surface's reflectivity — hence optical disc reader and writer.
要写,同一个驱动器用一束更强的激光改变表面的反射率—— 所以它叫光盘读写器。
Two devices you hold.
两件你握在手里的设备。
A touchscreen is an input device that senses where it is touched.
触摸屏是一种输入设备,它感知被触摸的位置。
Resistive screens have two conducting layers with a gap: press, they meet, and the meeting point is measured — they work with a glove or any stylus, but are less accurate.
电阻式屏幕有两层导电层,中间有缝隙:一按,两层接触,接触点就被测出来—— 戴手套或用任何触笔都能用,但不太精确。
Capacitive screens let your finger disturb a field of charge across the glass: accurate, multi-touch, and what your phone uses.
电容式屏幕让你的手指扰动玻璃上的一片电荷场: 精确、支持多点触控,也是你手机用的那种。
A virtual reality headset adds two small displays, one per eye, plus an accelerometer and a gyroscope that track your head, so the scene shifts as you look around.
虚拟现实头显再加上两块小显示屏,每只眼睛一块, 还有加速度计和陀螺仪来跟踪你的头部,于是你转头时画面就跟着变。
Here is a small idea that solves a big problem.
这里有一个小想法,解决了一个大问题。
A buffer is memory that holds data temporarily while it moves between two devices working at different speeds.
缓冲区是一块存储器, 它在数据从一个设备移到另一个速度不同的设备时,把数据临时存住。
Think of printing.
想想打印。
The processor can push out a whole document in a moment; the printer needs minutes.
处理器一瞬间就能把整份文档推出去;打印机却要好几分钟。
So the processor writes the document into the printer buffer at full speed, and is immediately free to do other work while the printer drains the buffer at its own pace.
于是处理器全速把文档写进打印机缓冲区,马上就可以去做别的工作, 而打印机按自己的节奏把缓冲区里的内容打完。
Buffers stop the fast device standing idle, waiting for the slow one.
缓冲区让快的设备不必闲着等慢的那一个。
The keyboard, streaming video and disk reads all use one.
键盘、流媒体视频和磁盘读取都用到它。
Memory comes in two flavours.
存储器有两种。
RAM is fast and read-write, but volatile — lose power, and you lose its contents.
RAM 又快又能读写,但它是易失的——一断电,里面的内容就丢了。
ROM is non-volatile and holds the start-up code that boots the machine.
ROM 是非易失的,保存着启动这台机器的开机代码。
Inside, cache memory uses fast SRAM, while main memory uses cheaper, denser DRAM, which must be constantly refreshed.
在内部,高速缓存用的是快速的 SRAM, 而主存用的是更便宜、更密集的 DRAM,它必须被不断刷新。
And for long-term storage: a hard disk stores data magnetically on spinning platters, while a solid-state drive stores it as charge in flash — faster, tougher, no moving parts.
至于长期存储: 硬盘把数据磁性地存在旋转的盘片上,而固态硬盘把数据作为电荷存在闪存里—— 更快、更结实、没有活动部件。
Let us pin RAM and ROM down properly, because examiners want the exact words.
我们把 RAM 和 ROM 钉死,因为考官要的是准确的词。
RAM is volatile: cut the power and the contents vanish.
RAM 是易失的:一断电,内容就没了。
It holds the operating system, every running program and that program's data, and it is read and written constantly.
它保存操作系统、每一个正在运行的程序以及这些程序的数据,而且被不停地读和写。
ROM is non-volatile: it keeps its contents with no power at all.
ROM 是非易失的:完全没有电也能保住内容。
It is usually written once, and it holds the firmware the machine needs the instant it wakes — the bootstrap, or boot loader, that starts everything else.
它通常只写一次, 保存机器一醒来就需要的固件——那个启动其余一切的引导程序,也叫引导加载器。
ROM starts the system; RAM then holds the active work.
ROM 启动系统;随后由 RAM 保存正在进行的工作。
Inside RAM there are two designs.
RAM 内部有两种设计。
SRAM stores each bit in a flip-flop — a little circuit of several transistors that simply holds its state.
SRAM 把每一位存在一个触发器里—— 一个由几个晶体管组成的小电路,就那么保持着它的状态。
It is fast, but several transistors per bit is expensive and not dense, so you only get a small amount.
它快,但每一位要几个晶体管, 既贵又不密,所以你只能装很少一点。
That is why SRAM is used for cache, the tiny fast memory beside the processor.
这就是为什么 SRAM 用作高速缓存, 也就是紧挨着处理器的那一小块快速存储器。
DRAM stores each bit as charge on one tiny capacitor: cheap and densely packed, but the charge leaks, so every row must be refreshed — rewritten — thousands of times a second, which makes it slower.
DRAM 把每一位存成一个极小电容上的电荷: 便宜、排得密,但电荷会漏掉,所以每一行都必须每秒被刷新——也就是重写——几千次, 这让它变慢。
Small and fast: SRAM.
小而快:SRAM。
Large main memory: DRAM.
大容量主存:DRAM。
There is a family of ROM you can program after the chip is made, and the letters tell you how.
有一族 ROM 是芯片做好之后还能编程的,名字里的字母就告诉你怎么编。
PROM is written once: a programmer burns fuses inside, and after that nothing can change it.
PROM 只写一次:编程器把里面的保险丝烧断,之后什么都改不了。
EPROM is erasable — but only by strong ultraviolet light through a window in the chip, which wipes the whole chip at once before you rewrite it.
EPROM 是可擦除的——但只能用强紫外线透过芯片上的一个小窗照射,一次把整块芯片擦干净, 然后再重写。
EEPROM is electrically erasable: no lamp, no window, no removing it from the circuit, and you can rewrite a single byte at a time.
EEPROM 是电可擦除的:不用灯、不用小窗,也不用从电路上取下来, 而且可以一次只重写一个字节。
Flash memory is its descendant, optimised to erase a whole block at once.
闪存就是它的后代,为一次擦除一整块而优化。
Now to those switches.
现在来看那些开关。
A logic gate takes ones and zeros, and outputs a single one or zero.
一个逻辑门接收一和零,输出一个单独的一或零。
NOT flips its input.
NOT 把它的输入翻转。
AND outputs one only if every input is one.
AND 只有在每一个输入都是一时才输出一。
OR outputs one if any input is one.
OR 只要有任何一个输入是一就输出一。
Add a little circle — a bubble — and you invert the output: AND becomes NAND, OR becomes NOR.
加上一个小圆圈——一个圆点——你就把输出取反:AND 变成 NAND,OR 变成 NOR。
And XOR outputs one only when its inputs differ.
而 XOR 只有在它的输入不同时才输出一。
Six gates, and their truth tables list every possible answer.
六个门,它们的真值表列出了每一种可能的答案。
A truth table lists every possible input and the output for each, so you never have to guess.
真值表把每一种可能的输入以及对应的输出都列出来,这样你就永远不必猜。
NOT has one input, so two rows: zero becomes one, one becomes zero.
NOT 只有一个输入,所以只有两行:零变成一,一变成零。
AND is the strict one — two inputs give four rows, and the output is one in a single row, the row where both inputs are one.
AND 是严格的那一个—— 两个输入给出四行,只有一行的输出是一,就是两个输入都为一的那行。
Everything else is zero.
其余全是零。
OR is the generous one: the same four rows, but the output is one whenever at least one input is one, so only zero-zero gives zero.
OR 是宽松的那一个:同样四行,但只要至少有一个输入是一,输出就是一,所以只有零零给出零。
Now the inverted three, and that little bubble on the symbol is your instruction: flip the output column.
现在看取反的三个,符号上那个小圆点就是给你的指令:把输出那一列翻过来。
NAND is AND upside down — AND was one only when both inputs were one, so NAND is zero only when both are one, and one in the other three rows.
NAND 是倒过来的 AND——AND 只有在两个输入都为一时才是一,所以 NAND 只有在两个都为一时才是零, 另外三行都是一。
NOR is OR upside down — OR was zero only for zero-zero, so NOR is one only for zero-zero.
NOR 是倒过来的 OR——OR 只有零零时是零,所以 NOR 只有零零时是一。
And XOR outputs one when the inputs differ.
而 XOR 在两个输入不同时输出一。
Write the plain gate's column first, then invert it.
先写出不带圆点那个门的一列,再把它取反。
Quicker, and safer.
更快,也更稳。
Watch what happens when two gates work together.
看看两个门一起工作会发生什么。
Feed the same two bits into an XOR and an AND.
把同样的两位同时送进一个 XOR 和一个 AND。
XOR gives one when the bits differ — that is the sum digit.
XOR 在两位不同时给出一——那是和的那一位。
AND gives one only when both bits are one — that is the carry.
AND 只有在两位都是一时才给出一——那是进位。
Together they add one plus one and get one-zero, in binary.
两者合起来,就把一加一算成二进制的"一零"。
That is a half adder, and it is where arithmetic comes from: gates, wired well.
这就是半加器,也是算术的来处:把门接对了,就有了算术。
Wire gates together, and you get a logic circuit that computes any Boolean expression.
把门连起来,你就得到一个逻辑电路,它能计算任何布尔表达式。
Take: X equals, A AND B, OR, NOT C.
比如:X 等于,A 与 B,或,非 C。
Draw one gate per operation: an AND gate on A and B, a NOT gate on C, and an OR gate joining the two.
每个运算画一个门:一个 AND 门作用在 A 和 B 上,一个 NOT 门作用在 C 上, 再用一个 OR 门把两者合起来。
To check it, build a truth table — every combination of inputs, worked through gate by gate.
要检验它,就建一张真值表——把输入的每一种组合, 一个门一个门地算过去。
Expression, circuit, truth table: three views of the very same logic.
表达式、电路、真值表:是同一个逻辑的三种看法。
Read a circuit the other way and you recover its expression.
反过来读一个电路,你就能把它的表达式找回来。
Start at the inputs, move forwards, and label each gate's output as you go — this AND gives A dot B, this NOT gives NOT C — until you reach the final output.
从输入开始往前走, 一边走一边给每个门的输出贴上标签——这个 AND 给出 A 点 B,这个 NOT 给出非 C—— 一直走到最后的输出。
Then the truth table.
然后是真值表。
For n inputs there are two to the n rows: two inputs, four rows; three inputs, eight; four inputs, sixteen.
n 个输入有 2 的 n 次方行:两个输入四行;三个输入八行; 四个输入十六行。
List every combination in binary counting order so none is missed, and fill the internal gates before the output column.
按二进制计数的顺序把每一种组合都列出来,就不会漏掉, 再先把中间各个门算出来,最后填输出那一列。
You can also go from a truth table back to an expression, with a recipe called sum of products.
你也可以从真值表回到表达式,方法叫"积之和"。
Look at every row that outputs one, and ignore the rest.
看每一行输出为一的行,其余的都不管。
For each of those rows, AND the inputs together, putting a NOT on any input that is zero in that row.
对这些行,把输入用 AND 连起来,凡是在这一行为零的输入就加上 NOT。
Then OR those terms.
然后把这些项用 OR 连起来。
Take a table that outputs one on A zero, B one, and on A one, B zero.
比如一张表,只在 A 为零、B 为一,以及 A 为一、B 为零时输出一。
Those rows give NOT A AND B, and A AND NOT B.
这两行给出"非 A 与 B"和"A 与 非 B"。
OR them, and it is exactly A XOR B.
把它们 OR 起来,正好就是 A XOR B。
Often the question is in English, and the first move is translation.
题目常常是用英语出的,第一步就是翻译。
Learn these five.
记住这五句。
Plain "A and B" is A AND B.
单纯的"A 且 B"是 A AND B。
"A or B, or both" is A OR B — in Boolean logic OR always includes both.
"A 或 B,或者两者都"是 A OR B——在布尔逻辑里,OR 永远包含"都"。
"Exactly one of A and B" is A XOR B, because XOR excludes the both case.
"A 和 B 中恰好一个"是 A XOR B,因为 XOR 把"都"排除掉。
"Neither A nor B" is A NOR B.
"A 和 B 都不"是 A NOR B。
And "not both" is A NAND B.
而"不是两者都"是 A NAND B。
Notice how close "or both" and "exactly one" sound in English, and how different the gates are.
注意"或者两者都"和"恰好一个"在英语里听起来多么接近, 而它们选的门却完全不同。
Now a worked example of the kind that carries several marks.
现在做一道能拿好几分的例题。
A machine's alarm, X, sounds when the guard is open — call that A equals one — and either the motor is running, B equals one, or the temperature is high, C equals one.
一台机器的警报 X 会响,条件是防护门打开——记作 A 等于一—— 并且要么马达在转,B 等于一,要么温度过高,C 等于一。
Pause and try it.
先暂停,自己试一试。
Take the English one clause at a time.
把英文一句一句拆开。
"Either B or C" is B OR C.
"要么 B 要么 C"就是 B OR C。
Then "A and that" wraps it: X equals A AND, bracket, B OR C, close bracket.
然后"A 并且这个"把它包起来: X 等于 A AND,左括号,B OR C,右括号。
Draw it as one OR gate on B and C, feeding an AND gate together with A.
画出来就是:一个 OR 门作用在 B 和 C 上, 它的输出再和 A 一起进一个 AND 门。
Second part: which rows make the alarm sound?
第二问:哪些行会让警报响?
X equals one needs A equals one, and at least one of B and C equal to one.
X 等于一需要 A 等于一,而且 B 和 C 中至少有一个等于一。
So one-zero-one, one-one-zero, and one-one-one — three rows out of eight.
所以是一零一、一一零和一一一——八行里的三行。
Notice too that A equals zero can never sound the alarm, whatever B and C do, because anything ANDed with zero is zero.
还要注意,A 等于零永远不可能让警报响, 不管 B 和 C 怎么变,因为任何东西和零相与都是零。
Now the trap.
现在说陷阱。
Drop the brackets, write X equals A AND B, OR C, and you have a different circuit altogether — one that sounds the alarm on a high temperature with the guard safely closed.
把括号丢掉, 写成 X 等于 A AND B,OR C,你得到的就是完全不同的另一个电路—— 在防护门关得好好的情况下,也会因为温度高而报警。
Bracket the OR.
记得给 OR 加括号。
Finally, computers reach into the real world through sensors and actuators.
最后,计算机通过传感器和执行器伸进真实的世界。
A sensor turns a physical quantity — heat, light, pressure — into a signal the computer can read.
传感器把一个物理量——热、光、压力—— 变成计算机能读懂的信号。
An actuator does the reverse: it turns a signal into an action — a motor, a valve, a heater.
执行器则相反:它把信号变成动作——马达、阀门、加热器。
A monitoring system just watches and reports.
监控系统只是观察并报告。
A control system goes further: it acts on what it senses, then re-measures the result — a feedback loop, correcting itself again and again.
而控制系统更进一步:它对所感知到的东西采取行动,再重新测量结果—— 一个反馈回路,一次又一次地自我修正。
Both read sensors.
两者都读取传感器。
The difference is what happens next, and that one sentence is often the whole mark.
区别在于接下来做什么,而这一句话往往就是全部的分。
A monitoring system collects readings and reports them; it takes no action.
监控系统收集读数并报告出来;它不采取任何行动。
A weather station logs temperature, rainfall and wind speed all night, and by morning it has data — the weather is unchanged.
一座气象站整夜记录温度、降雨量和风速, 到早上它有了数据——天气一点没变。
A control system uses the same readings to decide, then acts through an actuator.
控制系统用同样的读数做判断,然后通过执行器行动。
A thermostat compares the room with its target and switches the boiler on or off.
恒温器把房间和目标温度比一比,再把锅炉开或关。
Monitoring watches.
监控只是看着。
Control changes the thing it watches.
控制会改变它正在看的那个东西。
The three-mark "describe the differences" answer: a monitoring system only measures, records or displays the readings, and at most raises a warning.
三分的「描述两者的区别」答案是: 监测系统只是测量、记录或者显示读数,最多发出一个警告。
A control system compares each reading with a preset value and then acts on the result through an actuator, changing the thing it is measuring — so it has feedback and a monitoring system does not.
控制系统把每个读数和一个预设值比较,然后根据结果通过执行器采取动作, 去改变它正在测量的那个量——所以它有反馈,而监测系统没有。
A sensor turns a physical quantity into an electrical signal.
传感器把一个物理量变成电信号。
For temperature, a thermistor — a resistor whose resistance changes as it warms — or a thermocouple.
测温度用热敏电阻——一个电阻值随温度变化的电阻—— 或者热电偶。
For pressure, a strain gauge.
测压力用应变片。
There are infra-red sensors, and sound sensors, and many more.
还有红外传感器、声音传感器,以及许多别的。
Nearly all of them give a continuously varying, analogue reading, so it must pass through an analogue-to-digital converter before the processor can use it.
它们几乎都给出连续变化的模拟读数,所以在处理器能用之前,必须先经过模数转换器。
An actuator is the opposite device: give it a signal and something physical happens — a motor turns, a valve opens, a heater warms, a buzzer sounds.
执行器是相反的器件:给它一个信号,就有物理上的事情发生——马达转动,阀门打开, 加热器发热,蜂鸣器响起。
What makes a control system a system is that it closes the loop.
让控制系统成为一个"系统"的,是它闭合了这个回路。
The actuator changes the environment — the boiler warms the room.
执行器改变环境——锅炉把房间加热。
Then the sensors measure it again, the new reading goes back to the processor, and the decision is made afresh: sense, decide, act, sense again.
然后传感器再测一次,新的读数回到处理器,判断重新做一遍:感知、判断、行动、再感知。
That is feedback.
这就是反馈。
Without feedback the system is blind to its own effect.
没有反馈,系统对自己造成的影响是瞎的。
A thermostat that never re-measured the temperature would switch the boiler on and heat the room forever, because nothing would ever tell it to stop.
一个从不重新测温的恒温器会把锅炉打开,然后把房间无限加热下去,因为永远没有人告诉它该停了。
Three marks to secure.
三个要拿稳的分。
First, RAM is volatile and read-write, ROM is non-volatile and holds the bootstrap; SRAM for cache, DRAM for main memory.
第一,RAM 是易失的、能读写,ROM 是非易失的、保存开机引导程序; 缓存用 SRAM,主存用 DRAM。
Second, learn the symbol, expression and truth table for all six gates, and build a circuit gate by gate.
第二,把全部六个门的符号、表达式和真值表都学会, 并一个门一个门地搭出电路。
Third, a monitoring system only reports, while a control system acts through a feedback loop.
第三,监控系统只报告,而控制系统通过反馈回路采取行动。
Master these, and computer components are yours.
掌握这些,计算机组成就是你的了。
The fixed-wording definitions, one answer only.
固定措辞的定义,只给一个答案。
An embedded system is a computer system with a dedicated function built into a larger device.
嵌入式系统,是内建在更大设备中、承担专用功能的计算机系统。
A buffer is an area of memory that temporarily stores data while it is transferred between devices working at different speeds.
缓冲区,是一块内存区域,在速度不同的设备之间传输数据时临时存放数据。
RAM is volatile memory that can be read from and written to, holding the programs and data in use; ROM is non-volatile memory whose contents cannot be changed in normal use, holding the start-up instructions.
随机存取存储器是易失性的,可读可写,存放正在使用的程序和数据; 只读存储器是非易失的,正常使用中内容不可更改,存放启动指令。
S RAM stores each bit in a flip-flop and needs no refreshing; D RAM stores each bit as a charge on a capacitor and must be refreshed continually.
静态 RAM 用触发器存每一位,不需要刷新; 动态 RAM 把每一位存成电容上的电荷,必须持续刷新。
A monitoring system uses sensors to measure and report on a physical process without changing it; a control system uses sensor readings to decide on and carry out actions, through actuators, that change the process.
监测系统用传感器测量并报告一个物理过程,而不改变它; 控制系统根据传感器读数做出决定,并通过执行器采取行动去改变这个过程。
A sensor converts a physical quantity into a signal for the computer; an actuator converts a signal from the computer into a physical action.
传感器把物理量转换成计算机能用的信号;执行器把计算机的信号转换成物理动作。
The traps.
陷阱。
Describe the operation, not the device — "it uses a laser" earns nothing, while charge the drum, laser removes charge, toner attracted, transferred, fused earns the marks.
要描述工作过程,不要只报设备名—— 「它用激光」不得分,而「给鼓充电、激光去掉电荷、吸附墨粉、转印、熔合」得分。
Do not say a monitoring system controls anything.
不要说监测系统「控制」了什么。
Do not write that RAM stores files permanently or that ROM stores the user's data.
不要写随机存取存储器「永久保存文件」,也不要写只读存储器「保存用户数据」。
A truth table needs all two-to-the-n rows, counted in binary so no combination is missed.
真值表要有全部二的 n 次方行,按二进制计数写,保证不漏组合。
And draw exactly the connections the expression needs — no spare line, no wire ending nowhere.
另外,表达式需要哪些连线就画哪些——不要多画一条,也不要留下没有终点的线。
Two more marks that are easy to lose.
还有两个容易丢的分。
First, be ready to define a buffer in one sentence — a temporary store holding data between two devices working at different speeds — and pair it with an interrupt, the signal a device sends to say it is ready, so the processor can stop and attend to it.
第一,要能用一句话定义缓冲区—— 一块把数据暂存在两个速度不同的设备之间的存储器——并且把它和中断配成一对: 中断是设备发出的信号,表示"我准备好了",好让处理器停下手上的事去处理它。
Second, when a question asks for a truth table, give every input combination, all two-to-the-n rows, and show the internal gate columns.
第二,题目要真值表时,就把每一种输入组合都给出来,全部 2 的 n 次方行, 并且把中间各个门的列也写出来。
And use the exact words: volatile, non-volatile, refreshed, feedback.
还要用准确的词:易失、非易失、刷新、反馈。