ADM-201 dump PMP dumps pdf SSCP exam materials CBAP exam sample questions

二进制是如何工作的 – 译学馆
未登录,请登录后再发表信息
最新评论 (0)
播放视频

二进制是如何工作的

How exactly does binary code work? - José Américo N L F de Freitas

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,
(从最右边 0开始计数)
starting from zero on the right.
乘以10的相应次幂
So 84 in decimal form is 4×10⁰ + 8×10¹.
所以84的十进制格式是4×10⁰ + 8×10¹
Binary number notation works similarly,
二进制数的原理类似
but with each position based on 2 raised to some power.
但每个位置都是乘以2的某次幂
So 84 would be written as follows:
因此 84可以写成如下格式
Meanwhile,letters are interpreted based on standard rules like UTF-8,
同时 字母是根据标准规则(如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.
与颜色对应的二进制序列表示
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 –
被记录为“30绿色” 而不对每个像素单独编码
a process known as run-length encoding.
这一过程称为行程编码
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.
简单的“真”或“假”的选择结果

发表评论

译制信息
视频概述

普及计算机底层的二进制工作原理知识

听录译者

收集自网络

翻译译者

winter

审核员

审核员 V

视频来源

https://www.youtube.com/watch?v=wgbV6DLVezo

相关推荐