Number systems and conversions
| English | Chinese | Pinyin |
|---|---|---|
| binary | 二进制 | èr jìn zhì |
| base | 基数 | jī shù |
| denary | 十进制 | shí jìn zhì |
| hexadecimal | 十六进制 | shí liù jìn zhì |
| bit | 位 | wèi |
| byte | 字节 | zì jié |
| nibble | 半字节 | bàn zì jié |
| place value | 位值 | wèi zhí |
Why computers use binary 二进制
- A computer only has two states: on and off, written 1 and 0.
- A two-digit system is binary (base 基数 2) — and all data must become binary first.
- We use three number systems to work with it.
The three number systems
| System | Base | Digits |
|---|---|---|
| Denary 十进制 | 10 | 0–9 |
| Binary | 2 | 0 and 1 |
| Hexadecimal 十六进制 | 16 | 0–9 then A–F |
- The base is how many digits a system uses. Hex's A–F stand for 10–15.
- A bit 位 is one 0 or 1; 8 bits = 1 byte 字节; 4 bits = 1 nibble 半字节.

Adding two 8-bit numbers column by column; carries ripple to the left. 118 + 48 = 166.
Number systems
byte = Σ place values
Each bit is a power of two — flip the bits and watch decimal and hex update together.
How many bits does one hexadecimal digit represent?
One hex digit covers 16 values = a nibble = 4 bits.
Place value 位值 and binary ↔ denary
- In binary the place values double right to left. For 8 bits:
128 64 32 16 8 4 2 1. - Denary → binary: put a 1 under each value you need so they sum to your number. $150 = 128+16+4+2$ →
10010110. - Binary → denary: add the place values where there's a 1.

A microprocessor holds millions of tiny transistors, each a switch that is on (1) or off (0).
Convert binary 10010110 to denary.
128 + 16 + 4 + 2 = 150.
Convert denary 13 to binary (significant bits only).
13 = 8 + 4 + 1 → 1101.
Hexadecimal and why we use it
- Hex → binary: each hex digit becomes its own nibble (4 bits).
F08→1111 0000 1000. - Binary → hex: group bits into nibbles from the right; each nibble is one hex digit.
- Why hex? it is shorter than binary and easier to read, so fewer mistakes — used for MAC/IPv6 addresses, HTML colours (
#FF0000), and memory addresses.

A bitmap image is a grid of pixels; the resolution is the number of pixels (here 8 by 8).
Convert hexadecimal 1F to denary.
1 × 16 + 15 = 31 (F is 15).
Why do computer scientists use hexadecimal?
Hex is just a shorter, human-friendly way to write the same binary value (one digit = 4 bits).
You've got it
- binary base 2 (bit · byte = 8 bits · nibble = 4 bits); hex base 16, one digit = 4 bits
- denary → binary: pick the powers of 2 that sum to the number
- binary → hex by grouping nibbles
- hex is a shorter, readable way to write the same binary (addresses, colours)