手机APP下载

您现在的位置: 首页 > 英语听力 > 英语演讲 > TED-Ed教育演讲 > 正文

二进制是如何工作的

来源:可可英语 编辑:max   可可英语APP下载 |  可可官方微信:ikekenet

Imagine trying to use words to describe every scene in a film, every note in your favorite song, or every street in your town.

想象一下,用词语来描绘电影中的每一处场景,你最爱的歌曲的每一个音符,或者你镇上的每一条街道。
Now imagine trying to do it using only the numbers 1 and 0.
现在想一下试着只用数字1和0来表达这些。
Every time you use the Internet to watch a movie, listen to music, or check directions,
每次你使用因特网观赏电影、听音乐、或者查找方位,
that's exactly what your device is doing, using the language of binary code.
你的设备就是这样工作的:使用二进制编码语言。
Computers use binary because it's a reliable way of storing data.
电脑使用二进制,因为它能可靠地存储数据。
For example, a computer's main memory is made of transistors that switch between either high or low voltage levels, such as 5 volts and 0 volts.
举例来说,电脑的主存储器由晶体管构成,晶体管在高压与低压之间转换,例如5伏和0伏。
Voltages sometimes oscillate, but since there are only two options, a value of 1 volt would still be read as "low."
电压有时会振动,但由于只有高压和低压之分,1伏仍然被认为是低压。
That reading is done by the computer's processor, which uses the transistors' states to control other computer devices according to software instructions.
这些数值由电脑处理器读取,根据软件指令,通过晶体管的状态来控制其他电脑设备。
The genius of this system is that a given binary sequence doesn't have a pre-determined meaning on its own.
这套系统的妙处是:给定的二进制序列本身没有既定含义。
Instead, each type of data is encoded in binary according to a separate set of rules.
相反,每种数据根据一套单独的规则,进行二进制编码。
Let's take numbers. In normal decimal notation, each digit is multiplied by 10 raised to the value of its position, starting from zero on the right.
让我们以数字为例。在通常的十进制计数法中,每个数位上的数字乘以10的指数次幂,指数从右向左,由0开始增长。
So 84 in decimal form is 4x10o + 8x101.
因此84的十进制形式是4x10⁰+8x101。
Binary number notation works similarly, but with each position based on 2 raised to some power.
二进制计数法的原理也很相似,但每个数位上的数值与2的指数次幂相乘。
So 84 would be written as follows: Meanwhile, letters are interpreted based on standard rules like UTF-8,
因此84的二进制形式如图所示:同时,字母根据标准规则,如UTF-8,
which assigns each character to a specific group of 8-digit binary strings.
用一组特定的8位二进制串进行编码。
In this case, 01010100 corresponds to the letter T.
在这种情况下,01010100指的是字母T。
So, how can you know whether a given instance of this sequence is supposed to mean T or 84?
那么,你怎么知道这个给定的二进制序列指的是T还是84呢?
Well, you can't from seeing the string alone -- just as you can't tell what the sound "da" means from hearing it in isolation.
事实上,单看这一串数字的确无法判断,就像单纯听到“DA”的声音,你不能判断它的意思一样。
You need context to tell whether you're hearing Russian, Spanish, or English.
你需要根据语境,判断听到的是俄语、西班牙语、还是英语。

二进制是如何工作的

And you need similar context to tell whether you're looking at binary numbers or binary text.

你同样需要语境来判断你看到的是二进制数字还是二进制文字。
Binary code is also used for far more complex types of data.
二进制编码也被用在复杂得多的数据类型中。
Each frame of this video, for instance, is made of hundreds of thousands of pixels.
例如,这个视频的每一帧,都是由无数的像素组成的。
In color images, every pixel is represented by three binary sequences that correspond to the primary colors.
在彩色图片中,每个像素由3个二进制序列表示,分别对应红、绿、蓝三原色。
Each sequence encodes a number that determines the intensity of that particular color.
每个序列编码成一个数字,决定了特定颜色的强度。
Then, a video driver program transmits this information to the millions of liquid crystals in your screen to make all the different hues you see now.
之后,一个视频驱动程序将此信息传递给你屏幕上数百万的液晶,形成了你现在看到的不同的色调。
The sound in this video is also stored in binary, with the help of a technique called pulse code modulation.
这个视频的声音也通过二进制的形式储存,通过脉冲编码调制技术实现。
Continuous sound waves are digitized by taking "snapshots" of their amplitudes every few milliseconds.
持续的声波被数字化,通过对其振幅进行几毫秒一次的快照。
These are recorded as numbers in the form of binary strings, with as many as 44,000 for every second of sound.
这些声音以二进制串的数字形式记录下来,每秒的声音包含多达44000个数字。
When they're read by your computer's audio software,
当它们被你电脑上的音频软件读取时,
the numbers determine how quickly the coils in your speakers should vibrate to create sounds of different frequencies.
这些数字决定了扬声器里线圈的振动速度,以转换成不同频率的声音。
All of this requires billions and billions of bits. But that amount can be reduced through clever compression formats.
所有这些需要数十亿、数百亿的二进制位。但是通过巧妙的压缩格式,这个数值能够显著减少。
For example, if a picture has 30 adjacent pixels of green space,
例如,如果一个图片有30个相邻的绿格像素,
they can be recorded as "30 green" instead of coding each pixel separately -- a process known as run-length encoding.
它们会被记录成“30绿”,而不是把每一个像素分别编码,这个过程叫做“行程编码”。
These compressed formats are themselves written in binary code.
这些压缩格式本身也被编成了二进制码。
So is binary the end-all-be-all of computing? Not necessarily.
那么二进制就是计算的最终目标了吗?不一定。
There's been research into ternary computers, with circuits in three possible states,
三进制计算机已有相关研究,将三种可能的状态形成循环。
and even quantum computers, whose circuits can be in multiple states simultaneously.
甚至有量子计算机,可以同时进行多重状态的循环。
But so far, none of these has provided as much physical stability for data storage and transmission.
但是到目前为止,这些研究中没有一种在信息存储和传输方面具有足够的物理稳定性。
So for now, everything you see, hear, and read through your screen comes to you
因此现在,你在屏幕上看到的、听到的和读到的一切,
as the result of a simple "true" or "false" choice, made billions of times over.
都是简单的“是”、“非”选择运行了数十亿次的结果。

重点单词   查看全部解释    
scene [si:n]

想一想再看

n. 场,景,情景

 
adjacent [ə'dʒeisnt]

想一想再看

adj. 毗连的,邻近的,接近的

联想记忆
genius ['dʒi:njəs]

想一想再看

n. 天才,天赋

联想记忆
describe [dis'kraib]

想一想再看

vt. 描述,画(尤指几何图形),说成

联想记忆
liquid ['likwid]

想一想再看

adj. 液体的,液态的
n. 液体

 
screen [skri:n]

想一想再看

n. 屏,幕,银幕,屏风
v. 放映,选拔,掩

 
intensity [in'tensiti]

想一想再看

n. 强烈,强度

 
sequence ['si:kwəns]

想一想再看

n. 顺序,连续,次序,序列,一系列
vt.

联想记忆
oscillate ['ɔsi.leit]

想一想再看

v. 振动,彷徨,犹豫 v. 使振动,使动摇

联想记忆
primary ['praiməri]

想一想再看

adj. 主要的,初期的,根本的,初等教育的

联想记忆

发布评论我来说2句

    最新文章

    可可英语官方微信(微信号:ikekenet)

    每天向大家推送短小精悍的英语学习资料.

    添加方式1.扫描上方可可官方微信二维码。
    添加方式2.搜索微信号ikekenet添加即可。