Binary Numbers
| English | Chinese | Pinyin |
|---|---|---|
| bit | 位 | wèi |
| binary | 二进制 | èr jìn zhì |
| decimal | 十进制 | shí jìn zhì |
| power of two | 2 的幂 | 2 de mì |
| fixed number of bits | 固定位数 | gù dìng wèi shù |
| overflow error | 溢出错误 | yì chū cuò wù |
| Analog | 模拟 | mó nǐ |
| digital | 数字 | shù zì |
| sample | 采样 | cǎi yàng |
| byte | 字节 | 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.
A single 0 or 1, the smallest piece of data, is called a ______.
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$.
Binary place values
value = Σ place values where a bit is 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.
What is the binary number 1011 in decimal?
Place values 8,4,2,1 with 1-bits at 8,2,1: 8+2+1 = 11.
What is decimal 13 in binary?
8 + 4 + 1 = 13, so bits 8,4,1 are on: 1101.
With 4 bits, what is the largest value you can store (2^4 − 1)?
2^4 = 16 patterns, from 0 up to 15. Adding 15+1 overflows.
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.
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.
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.
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.