Pular para o conteúdo

Fundamentos de informática

International Baccalaureate · IB Diploma · Computer Science · SL Tópico 1 6:38 Narração em inglês · Legendas em inglês + 中文 gravadas

barra de espaço play · ←/→ 5s · j/l 10s · f tela cheia · ,/. velocidade

Capítulos

Transcrição
You tap a photo app. 你点开一个相册应用。
Within a second its code is copied from storage into memory, the processor runs millions of instructions, the graphics chip draws the picture, and the operating system shares the processor with the music still playing. 不到一秒,它的代码从存储器复制到内存,处理器执行数百万条指令,图形芯片画出图片,操作系统还要把处理器分给仍在播放的音乐。
One tap uses every part of the computer. 一次点击就用到了计算机的每个部分。
The central processing unit has three main parts. 中央处理器有三个主要部分。
The control unit fetches and decodes instructions and sends control signals. 控制单元取指令、译码并发出控制信号。
The arithmetic logic unit adds, subtracts and compares. 算术逻辑单元做加减和比较。
The registers are tiny, very fast stores, such as the program counter. 寄存器是极小又极快的存储,比如程序计数器。
Buses join the CPU to memory: the address bus one way, the data and control buses both ways. 总线把 CPU 和内存连起来:地址总线单向,数据总线和控制总线双向。
Every CPU repeats one cycle. 每个 CPU 都重复同一个循环。
Fetch: the address in the program counter goes to the MAR, the instruction travels to the MDR and then the CIR, and the program counter goes up by one. 取指:程序计数器中的地址送到 MAR,指令传到 MDR 再到 CIR,程序计数器加一。
Decode: the control unit works out what it means. 译码:控制单元弄清指令的含义。
Execute: it is carried out, and the ALU's result goes into the accumulator. 执行:执行指令,ALU 的结果放进累加器。
Then the cycle repeats. 然后循环重复。
A CPU has a few powerful cores, good at varied tasks with many decisions. CPU 有少量强大的核心,擅长需要很多判断的各种任务。
A GPU has thousands of simple cores that do the same operation on many pieces of data at once, which suits graphics and machine-learning training. GPU 有成千上万个简单核心,同时对大量数据做同一种运算,适合图形和机器学习训练。
They work together: the CPU hands the parallel work, like drawing each pixel, to the GPU. 两者配合工作:CPU 把并行的工作,比如画每个像素,交给 GPU。
Memory is a hierarchy. 存储器是分层的。
Registers sit at the top, then cache, then RAM, then secondary storage. 最上面是寄存器,然后是高速缓存、内存,最下面是辅助存储器。
Each level down is slower but larger and cheaper. 越往下越慢,但容量越大、越便宜。
Cache works because programs reuse the same data again and again: a cache hit finds it there, a cache miss must fetch it from RAM. 缓存有效是因为程序反复使用同样的数据:缓存命中就在缓存里找到,缓存未命中就要去内存取。
Secondary storage keeps data without power. 辅助存储器断电后也能保存数据。
A hard disk stores bits as magnetised spots on spinning platters: cheap, but slower, with moving parts. 硬盘把位存成旋转盘片上的磁化点:便宜,但较慢,有活动部件。
A solid-state drive stores charge in flash memory: fast, silent and robust, but dearer. 固态硬盘把电荷存在闪存里:快、安静、耐用,但更贵。
An optical disc uses pits read by a laser. 光盘用激光读取盘面上的凹坑。
Compression makes files smaller. 压缩让文件变小。
Lossless compression lets the original be rebuilt exactly, which text and programs need. 无损压缩可以完全还原原文件,文本和程序必须这样。
Run-length encoding turns five Ws, three Bs and two Ws into five W, three B, two W. 游程编码把五个 W、三个 B、两个 W 写成5W3B2W。
Lossy compression removes detail people are unlikely to notice, as in JPEG photos and MP3 music, and the original is gone. 有损压缩去掉人们不太会注意的细节,比如 JPEG 照片和 MP3 音乐,原文件无法还原。
Cloud computing provides resources over the internet, paid for as they are used. 云计算通过互联网提供计算资源,用多少付多少。
Software as a service is a finished application, like web e-mail. 软件即服务是现成的应用,比如网页邮箱。
Platform as a service gives you a platform to run your own apps. 平台即服务提供运行你自己应用的平台。
Infrastructure as a service rents virtual machines and storage. 基础设施即服务出租虚拟机和存储。
But you need a reliable connection, and another company holds your data. 但你需要可靠的网络,而且数据由别的公司保管。
Each bit has a place value, doubling from the right. 每一位都有位值,从右往左翻倍。
One hundred and eighty-two is one hundred and twenty-eight plus thirty-two plus sixteen plus four plus two, so it is one zero one one, zero one one zero. 一百八十二等于一百二十八加三十二加十六加四加二,所以是 1011 0110。
Each group of four bits is one hex digit: one zero one one is B, zero one one zero is six, so the hex is B6. 每四位是一个十六进制数字:1011 是 B,0110 是 6,所以十六进制是 B6。
Two's complement stores negative numbers: the leftmost bit is worth minus one hundred and twenty-eight. 补码用来存负数:最左边一位的位值是负一百二十八。
To write minus forty-two, write forty-two in binary, flip every bit, then add one. 要写负四十二,先写出四十二的二进制,把每一位取反,再加一。
Check: minus one hundred and twenty-eight plus sixty-four plus sixteen plus four plus two is minus forty-two. 检验:负一百二十八加六十四加十六加四加二等于负四十二。
An image's size is width times height times colour depth. 图像大小等于宽乘高乘色深。
A full-HD picture at twenty-four bits is about fifty million bits; divide by eight to get about six point two megabytes. 一张 24 位全高清图片约五千万位,除以八约 6.2 MB。
Sound is sample rate times bit depth times channels times seconds: a minute of CD stereo is about ten point six megabytes. 声音大小等于采样率乘位深乘声道数乘秒数:一分钟 CD 立体声约 10.6 MB。
A logic gate takes binary inputs and gives one output. 逻辑门接收二进制输入,给出一个输出。
AND is one only when both inputs are one. 与门只有两个输入都为一时才输出一。
OR is one when either is. 或门只要有一个为一就输出一。
XOR is one when the inputs differ. 异或门在输入不同时输出一。
NOT flips its single input, and NAND and NOR are AND and OR with the output flipped. 非门把唯一的输入取反,与非门和或非门就是把与门、或门的输出取反。
To trace a circuit, label each gate's output. 追踪电路时,给每个门的输出加标签。
P is A AND B, which is one only when A and B are both one. P 是 A 与 B,只有 A、B 都为一时才为一。
Q is NOT C. Q 是非 C。
X is P OR Q, so it is zero only when C is one and P is zero. X 是 P 或 Q,所以只有 C 为一且 P 为零时才为零。
Three inputs need eight rows; count up in binary so none is missed. 三个输入需要八行,按二进制递增排列,就不会漏掉。
An operating system manages the hardware and serves programs. 操作系统管理硬件并为程序服务。
It shares the CPU between processes, gives each program its own protected memory, organises files and controls devices through drivers. 它在进程之间分配 CPU,给每个程序独立且受保护的内存,管理文件,并通过驱动程序控制设备。
For security it first identifies and authenticates the user, then authorizes the action, then records the change. 在安全方面,它先识别并认证用户,再授权操作,最后记录更改。
The scheduler switches processes so fast they seem to run together. 调度程序切换进程非常快,看起来它们像同时运行。
In round robin each gets a fixed time slice in turn. 时间片轮转中,每个进程轮流得到固定的时间片。
With a two-millisecond slice, P1 needs five, P2 three and P3 one. 时间片两毫秒,P1 需要五毫秒,P2 三毫秒,P3 一毫秒。
P1 runs, then P2, then P3 finishes at five. P1 先运行,然后 P2,P3 在第五毫秒结束。
P1 again, P2 finishes at eight, and P1 finishes at nine. P1 再运行,P2 在第八毫秒结束,P1 在第九毫秒结束。
With polling, the CPU checks each device again and again: simple, but wasteful when nothing has happened. 轮询时,CPU 一遍又一遍地检查每个设备:简单,但什么都没发生时就浪费了。
With an interrupt, the device sends a signal; the CPU finishes its instruction, saves its state, runs the handler, then carries on. 中断时,设备发出信号;CPU 执行完当前指令,保存状态,运行处理程序,然后继续。
A key press is rare and unpredictable, so a keyboard uses interrupts. 按键少见又不可预测,所以键盘用中断。
Try these. Describe the fetch stage and name the registers. Write minus nineteen in eight-bit two's complement. Find the size of an eight hundred by six hundred image at sixteen bits. And schedule two processes with round robin. 试试这些:描述取指阶段并说出用到的寄存器;把负十九写成八位补码;求一张 800×600、16 位色深图像的大小;再用时间片轮转调度两个进程。
In the exam, follow the fetch order exactly and say that the program counter increments. 考试时,严格按取指顺序写,并说明程序计数器加一。
Show place values for conversions, and flip then add one for two's complement. 进制转换要写出位值,补码要写出取反再加一。
For file sizes give the formula, numbers and unit. 文件大小要写公式、数字和单位。
Truth tables need two to the n rows in binary order, with a column for every gate. 真值表需要二的 n 次方行,按二进制顺序,每个门一列。

Entrar ou criar conta

IGCSE, A-Level & AP