Binary Numbers · 二进制数
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| bit/bɪt/ | 位 | wèi |
| binary/ˈbaɪnəri/ | 二进制 | èr jìn zhì |
| decimal/ˈdesɪml/ | 十进制 | shí jìn zhì |
| power of two/ˈpaʊə ɒv tuː/ | 2 的幂 | 2 de mì |
| fixed number of bits/fɪkst ˈnʌmbə ɒv bɪts/ | 固定位数 | gù dìng wèi shù |
| overflow error/ˌəʊvəˈfləʊ ˈerə/ | 溢出错误 | yì chū cuò wù |
| Analog/ˈænəlɒɡ/ | 模拟 | mó nǐ |
| digital/ˈdɪdʒɪtl/ | 数字 | shù zì |
| sample/ˈsæmpl/ | 采样 | cǎi yàng |
| byte/baɪt/ | 字节 | zì jié |
Everything is bits
- Deep down, a computer knows only two states: on and off, written 1 and 0.
- A bit 位 is a single 0 or 1 — the smallest piece of data.
- Two states are easy to build from a wire (voltage or none) and hard to confuse.
- Counting with two digits is binary 二进制 (base 2); everyday decimal 十进制 (base 10) uses ten.
一切都是比特
- 深处,计算机只知道两种状态:开和关,写作 1 和 0。
- 一个位(bit)是单个的 0 或 1——最小的数据片。
- 两种状态容易从一根导线(有电压或没有)构建,且难以混淆。
- 用两个数字计数是二进制(binary,基数 2);日常的十进制(decimal,基数 10)用十个。
A single 0 or 1, the smallest piece of data, is called a . · 单个的 0 或 1,最小的数据片,叫一个。
Eight bits group into a byte. · 八个位组成一个字节。
Place values and conversion
- In binary, each position is a power of two 2 的幂, doubling leftward: $\dots, 8, 4, 2, 1$.
- To read binary → decimal, add the position values where there is a 1.
- To go decimal → binary, keep subtracting the largest power of two that fits.
Binary to decimal: $1011$ lines up with $8, 4, 2, 1$. The 1-bits are at $8, 2, 1$, so $8 + 0 + 2 + 1 = 11$. Decimal to binary: for $13$, take $8$ (leaves 5), then $4$ (leaves 1), skip $2$, take $1$ → $1101$.
位值与转换
- 在二进制中,每个位置是一个 2 的幂(power of two),向左翻倍:$\dots, 8, 4, 2, 1$。
- 要读二进制 → 十进制,把有 1 的位置值加起来。
- 要从十进制 → 二进制,不断减去能容纳的最大的二的幂。
二进制到十进制: $1011$ 对齐 $8, 4, 2, 1$。1 位在 $8, 2, 1$,所以 $8 + 0 + 2 + 1 = 11$。十进制到二进制: 对 $13$,取 $8$(剩 5),再取 $4$(剩 1),跳过 $2$,取 $1$ → $1101$。
Binary place values · 二进制位值
value = Σ place values where a bit is 1 · 值 = Σ 位为 1 处的位值
See how an 8-bit pattern maps to a decimal number by adding the place values (128, 64, 32, 16, 8, 4, 2, 1) wherever there is a 1. · 看一个 8 位模式如何通过把有 1 处的位值(128、64、32、16、8、4、2、1)相加映射到一个十进制数。
What is the binary number 1011 in decimal? · 二进制数 1011 的十进制是多少?
Place values 8,4,2,1 with 1-bits at 8,2,1: 8+2+1 = 11. · 位值 8、4、2、1,1 位在 8、2、1:8+2+1 = 11。
What is decimal 13 in binary? · 十进制 13 的二进制是多少?
8 + 4 + 1 = 13, so bits 8,4,1 are on: 1101. · 8 + 4 + 1 = 13,所以位 8、4、1 为开:1101。
With 4 bits, what is the largest value you can store (2^4 − 1)? · 用 4 位,你能存储的最大值是多少(2^4 − 1)?
2^4 = 16 patterns, from 0 up to 15. Adding 15+1 overflows. · 2^4 = 16 个模式,从 0 到 15。15+1 会溢出。
Fixed bits and overflow
- Computers store numbers in a fixed number of bits 固定位数, such as 8 or 16.
- With $n$ bits you can make $2^n$ patterns, from $0$ up to $2^n - 1$.
- If a result is too big to fit, the extra bits are lost — an overflow error 溢出错误.
- Worked idea. With 4 bits the largest value is $2^4 - 1 = 15$; adding $15 + 1$ needs a 5th bit that does not exist, so it overflows.
固定位数与溢出
- 计算机用固定位数(fixed number of bits)存储数字,如 8 或 16。
- 用 $n$ 位你能做出 $2^n$ 个模式,从 $0$ 到 $2^n - 1$。
- 如果结果太大放不下,多出的位就丢失了——溢出错误(overflow error)。
- 例题。 用 4 位,最大值是 $2^4 - 1 = 15$;$15 + 1$ 需要一个不存在的第 5 位,所以它溢出。
Turning a smooth analog sound wave into bits by taking many measurements is called: · 通过许多测量把平滑的模拟声波变成位,叫:
Each measurement is a sample; the stored result is digital data. · 每个测量是一个采样;存储的结果是数字数据。
Analog to digital
- Analog 模拟 data is smooth and continuous, like a real sound wave.
- To store it, a computer takes many quick measurements; each is a sample 采样.
- Each sample is rounded to the nearest storable value, so the copy only approximates the original.
- More samples and more bits per sample give a closer copy — the result is digital 数字 data.
模拟到数字
- 模拟(analog)数据是平滑而连续的,像真实的声波。
- 要存储它,计算机做许多快速测量;每一个是一个采样(sample)。
- 每个采样被舍入到最近的可存储值,所以副本只近似原始。
- 更多采样和每个采样更多位给出更接近的副本——结果是数字(digital)数据。
How many bits are in one byte? · 一个字节里有多少位?
Eight bits make one byte. · 八个位组成一个字节。
Bytes
- Bits are tiny, so we group them: eight bits make one byte 字节.
- A byte is the common unit of data size — enough for one letter of English text.
- Bigger units build on it: ~1000 bytes is a kilobyte, ~a million is a megabyte.
- Worked idea. A 200-letter message at 1 byte each is 200 bytes, or $200 \times 8 = 1600$ bits.
字节
- 位很小,所以我们把它们分组:八个位组成一个字节(byte)。
- 字节是数据大小的常用单位——足够存一个英文字母。
- 更大的单位建立在它之上:约 1000 字节是一千字节,约一百万是一兆字节。
- 例题。 一条 200 字母的消息,每个 1 字节,是 200 字节,即 $200 \times 8 = 1600$ 位。
A bit is one 0/1; binary (base 2) uses place values that are powers of two, so $1011_2 = 8+2+1 = 11$. A fixed number of bits limits the range to $2^n-1$; exceeding it is an overflow error. Analog signals become digital by sampling, and eight bits group into one byte.
一个位是一个 0/1;二进制(基数 2)用二的幂作为位值,所以 $1011_2 = 8+2+1 = 11$。固定位数把范围限制在 $2^n-1$;超过它就是溢出错误。模拟信号通过采样变成数字,八个位组成一个字节。